You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Design doc for #73, written after the fact (the PR skipped this step; future work starts here). Overlaps #51/#64 — a synthesis proposal is at the end.
Problem
Any prefix lost from device residency is re-prefilled: 53 s at 118k (int8, 5090), 234 s at 134k on a 24 GiB card. 2. Trajectories forking from a shared prefix (subagents) pay the full prefix per branch.
Design (implemented in #73, opt-in --kv-host-cache-mib N, N=0 inert)
Chained page keys: key[i] = fold(key[i-1], token_i) over ids, types, all MRoPE axes, and per-item media SHA-256, per KV page. One 64-bit match certifies the whole prefix — the causal validity KV needs. Salted by kv-dtype/spec config + format version.
Pinned segment store: budget-bounded chunks; page dedup by key with refcounts; whole-segment LRU (never punctures a chain); shared pages pinned during staging so eviction cannot race a save.
Anchors at terminal + rewrite-checkpoint frontiers: GDN linear state, MTP watermark, boundary hidden — the sound fork points for hybrid attention.
Hostpack kernels: batched gather/scatter between pool planes and packed staging borrowed from the idle workspace arena.
Engine seam: ContentRestore reuse path planned only when resident paths miss; save at terminal completion; decode never touches the machinery.
Numbers: 118 828 tokens cold 53 379 ms → restore 422 ms (126×), byte-identical; branch switch over a shared prefix ≈ 100 ms; production soak on the sm_86 fork at 251×.
Planned follow-ups (in order; each lands only after feedback here)
Complementary shapes of one problem: #64 parks whole lanes by prefix identity (precise state, simple, no dedup/branching, slab per max-sequence); #73 stores content-addressed pages (dedup, branching, survives prompt rebuilds, needs retokenization stability). A workable synthesis: #64's park/restore-before-planning as the fast path, backed by a shared content-addressed page store as the substrate. Happy to converge on whichever shape you prefer.
Open questions
One host-cache substrate or two features?
Is the retokenization caveat acceptable, or should ledger token ids be the only key source?
Design doc for #73, written after the fact (the PR skipped this step; future work starts here). Overlaps #51/#64 — a synthesis proposal is at the end.
Problem
Design (implemented in #73, opt-in
--kv-host-cache-mib N, N=0 inert)key[i] = fold(key[i-1], token_i)over ids, types, all MRoPE axes, and per-item media SHA-256, per KV page. One 64-bit match certifies the whole prefix — the causal validity KV needs. Salted by kv-dtype/spec config + format version.ContentRestorereuse path planned only when resident paths miss; save at terminal completion; decode never touches the machinery.Numbers: 118 828 tokens cold 53 379 ms → restore 422 ms (126×), byte-identical; branch switch over a shared prefix ≈ 100 ms; production soak on the sm_86 fork at 251×.
Planned follow-ups (in order; each lands only after feedback here)
Relation to #64 (park evicted lanes)
Complementary shapes of one problem: #64 parks whole lanes by prefix identity (precise state, simple, no dedup/branching, slab per max-sequence); #73 stores content-addressed pages (dedup, branching, survives prompt rebuilds, needs retokenization stability). A workable synthesis: #64's park/restore-before-planning as the fast path, backed by a shared content-addressed page store as the substrate. Happy to converge on whichever shape you prefer.
Open questions
--host-kv-cache.