pub enum O1State {
Collecting {
m: usize,
w: usize,
sink: usize,
q_buf: Vec<f32>,
},
Sealed {
states: 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-Q-head streaming states, and DROPS the full KV. Sealed:
decode replaces cache attention with NystromState::step().
Variants§
Collecting
Fields
Sealed
One state per Q head: the far field T̂/Ẑ depends on that head’s own query landmarks, so GQA groups cannot share it. The window K/V is duplicated across the group’s Q heads (×heads_per_kv) — the price of keeping the golden-parity kernel intact; still O(1) in context and far below full KV at depth.
Fields
states: Vec<NystromState>