pub enum O1State {
Collecting {
m: usize,
w: usize,
sink: usize,
rect: O1Rect,
q_buf: Vec<f32>,
},
Sealed {
groups: Vec<NystromState>,
},
}Expand description
Per-layer O(1) Nyström attention state (runtime attn_type
override — spec §7 presence-driven pattern, no format change).
Collecting: the prompt pass still runs EXACT cache attention (the
prefill outputs feed the residual stream, so they cannot be
deferred) while the per-position rotated queries are buffered;
o1_seal() then freezes landmarks + M from the full prompt, replays
it into per-KV-group streaming states, and DROPS the full KV.
Sealed: decode replaces cache attention with
NystromState::step_group().
Variants§
Collecting
Fields
Sealed
One state per KV GROUP, each holding its group’s Q heads. The
exact window / sinks / K̃ are stored once per group (every Q head
of the group reads the same k/v rows); only the far field, Q̃ and
M — the query-dependent pieces — stay per Q head. See
NystromState for which piece is which and why.
Fields
groups: Vec<NystromState>