pub struct GraphAttnGeom<'a> {
pub nkv: usize,
pub hd: usize,
pub dv: usize,
pub rd: usize,
pub invf: &'a [f32],
pub rope_scale: f32,
pub window: Option<usize>,
pub sink: Option<&'a [f32]>,
pub v_norm: bool,
}Expand description
Per-layer attention geometry for the wgpu graphs (see
GraphAttn::Full::geom). The layer’s CPU cache keeps K rows hd wide
and V rows zero-padded to hd; the device mirror stores V dv wide,
and a windowed layer keeps a ring of the last positions only.
Fields§
§nkv: usizeKV heads of this layer (divides the Q heads).
hd: usizeQ/K head width of this layer. The call-wide hd for every model
but Gemma-4, whose global layers are 512 wide over 256-wide sliding
ones (<= 512, a multiple of 4).
dv: usizeV head width, 4 <= dv <= hd, a multiple of 4.
rd: usizeRotary width of this layer (NeoX half-split over [0, rd)).
invf: &'a [f32]This layer’s RoPE inverse frequencies (rd / 2 of them).
rope_scale: f32YaRN attention-amplitude factor applied after the rotary pair
transform. 1.0 is ordinary RoPE; Mellum’s global layers use
1.277258872…. This is deliberately per-layer: local and global
layers may have different RoPE tables and factors.
window: Option<usize>Positions a query sees, its own included (MiMo-V2 SWA: 128); None = the whole context.
sink: Option<&'a [f32]>Learned per-Q-head sink logits (gpt-oss / MiMo-V2): they join the softmax max and denominator and carry no value row.
v_norm: boolGemma-4’s scale-less V norm: every V head is RMS-normalized (no
weight) before it is cached, as attention::vnorm_head does.