pub enum GraphAttn<'a> {
Full {
wq: GraphW<'a>,
wk: GraphW<'a>,
wv: GraphW<'a>,
wo: GraphW<'a>,
q_norm: Option<&'a [f32]>,
k_norm: Option<&'a [f32]>,
bias: Option<(&'a [f32], &'a [f32], &'a [f32])>,
output_gate: bool,
cpu_k: &'a [Vec<f32>],
cpu_v: &'a [Vec<f32>],
},
Gdn {Show 15 fields
qkv: GraphW<'a>,
z: GraphW<'a>,
a: GraphW<'a>,
b: GraphW<'a>,
out: GraphW<'a>,
conv1d: &'a [f32],
a_log: &'a [f32],
dt_bias: &'a [f32],
norm: &'a [f32],
nv: usize,
nk: usize,
dk: usize,
dv: usize,
kk: usize,
cpu_state: &'a [f32],
},
ShortConv {
inp: GraphW<'a>,
out: GraphW<'a>,
taps: &'a [f32],
kernel: usize,
cpu_state: &'a [f32],
},
}Expand description
A layer’s token-mixing op: standard attention or a GDN (linear-attention) block. The surrounding norms + SwiGLU FFN are common to both.
Variants§
Full
Fields
§
bias: Option<(&'a [f32], &'a [f32], &'a [f32])>(bq, bk, bv) attention biases (Qwen2). None ⇒ no bias.
Gdn
Fields
ShortConv
LFM2 gated short convolution: a fused (B, C, x) projection, a depthwise causal conv over a (kernel−1)-deep per-channel ring, C-gating, and an output projection. This mixer is what most of an LFM2 stack is (22 of the 2.6B’s 30 layers), and before it had a graph arm the whole model fell to the per-op path — ~100 submits a token, 22 tok/s on an A100 for a 1.4 GB file.
Auto Trait Implementations§
impl<'a> Freeze for GraphAttn<'a>
impl<'a> RefUnwindSafe for GraphAttn<'a>
impl<'a> Send for GraphAttn<'a>
impl<'a> Sync for GraphAttn<'a>
impl<'a> Unpin for GraphAttn<'a>
impl<'a> UnsafeUnpin for GraphAttn<'a>
impl<'a> UnwindSafe for GraphAttn<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more