Expand description
ROUND-STREAM: the model-generic device machinery for pre-issued M-round speculative bursts with zero per-round host readbacks (extracted from the qwen spec loop 2026-07-12 so the gemma/next-model loops reuse it instead of re-growing their own).
The pieces that live here are pure device-buffer plumbing — every model-specific thing (the draft-chain graph, the verify trunk, commit semantics) stays in the caller:
StreamBufs: the per-burst device buffers (verify tokens, break, pending, ring, accept counters, device position) sized from (k, m_rounds).kv_len_ptr_table: the per-layerkvl.len_dpointer table the device rollback kernel walks (pointers are stable for the cache’s lifetime — cache.rs note).drain_ring: the one host sync per M rounds — reads the ring and appends tokens.
The kernels these feed (spec_accept_greedy_dc, spec_ring_commit,
spec_rollback_stream, spec_seed_gather, spec_assemble_verify) are already
model-generic in lib.rs; this module is the buffer/lifecycle half.
Structs§
Functions§
- kv_
len_ ptr_ table - Per-layer
kvl.len_ddevice-pointer table (+ the position counter appended whenpos_ctris given) forspec_rollback_stream. Pointers are stable for the cache’s lifetime; 0 marks layers without KV (linear-attention / KV-shared).