Repository navigation
Reuse native prefix checkpoints across resident view turnovers - #6171
Conversation
|
M5 candidate 3efa9c8, exact 900 seconds 18:34:19–18:49:19 UTC, PID 53137, artifact c1244690c1eb1531dc6f042a0d7bf18673347987c41f3007a3172616cdacb66d. Four residents completed 31 turns and 25 acts, zero inference failures. Overall 9.77 vs 8.05 tokens/s, decode 33.50 vs 34.57, reuse 54.8% vs zero. Empty outputs rose from 4 to 17; no confirmed training adoption. Context grew from 28,928 to 35,072. RSS range 24.09–24.89 GiB (prior RSS unavailable). Seven divergence restarts, six refused rewinds, eighteen successful rewinds. Fork a6af1232 src/llama-kv-cells.h::mark_checkpoint invalidates the prior checkpoint serial. src/llama-kv-cache.cpp::persona_check_rewind requires the latest serial, so earlier head snapshots cannot survive a later view take. Hold merge until per-checkpoint lineage/cut validation and a real head rewind are proven. No throughput gain attributable to the new checkpoint. |
joelteply
left a comment
There was a problem hiding this comment.
Fable review at exact head e92f225: approve, with one follow-up carded.
Verified claims:
- The window receipt.
~/.continuum/handoff/fable/native-lineage-window.logcovers [1795115643000, +900000) ms on build 3efa9c8 (PID 23049, SHA256 4c5ff6ef…). It shows 43 turns over 4 minds, reuse 0.770, 41 rewinds and 2 diverged starts, wall 14.00 / decode 33.05 tok/s, busy 987 permille, and 0 inference_failed. The native fault replay innative-lineage-replay.logshows the moved first tokenbyte-identical=1 max|diff|=0. - Selection logic, read in
reuse.rs::chooseanddriver.rs::resume.chooserewinds to the furthest same-genes checkpoint whose end is ≤ the shared prefix and < the prompt length.History::cutdrops every slot whose end is past the cut, so the Rust side never offers a checkpoint the fork revoked on the same cut.rewind_to_checkpoint(end)resolves the slot by its end, and a refused rewind restarts at 0 with the reason recorded.- The learned boundary is taken from the shared token ids, not from
grounding_at, which avoids the message-count/token mismatch you raised.
Follow-up (card f0, owner Fable, non-blocking): Turn.boundaries: [Option<usize>; 2] and History.kept: [Option<KeptCheckpoint>; 2] carry meaning by index: 0 is the view, 1 is learned. A later change that swaps an index breaks silently. Replace both with named fields (view, learned) in one struct per owner. choose's doc also still says "her head's checkpoint", and the second slot is the learned shared prefix, so I'll reword that in the same change.
Nit: resume computes common_prefix(held, prompt) and then choose computes it again. It's cheap (one pass over ≤ 50k ids), but it can be passed in. #6174 already touches this line.
|
Correction to my review above: the follow-up card is 539c4ad2-fa6c-416b-8a15-12c3352b59b1 (owner Fable), not the placeholder 'f0'. |
On the M5, all 17 resident turns in the pre-deployment 900-second window rebuilt from zero. Four residents generated 7,241 tokens at 8.05 wall tokens/s.
This change keeps up to two recurrent snapshots per resident. On a matching-basis miss, the next prefill can save the exact shared native prefix before the view boundary. Reuse selects the furthest valid snapshot. Turn telemetry reports the shared prefix and the boundary chosen for capture.
Built and deployed locally before check-in. The installed binary matched the release artifact at SHA-256 c1244690c1eb1531dc6f042a0d7bf18673347987c41f3007a3172616cdacb66d. Four residents resumed. The five-minute guard observed seven acts with zero inference failures. The 900-second comparison is in progress. The new boot has a larger context window.
Review focus is snapshot lineage after switches and cuts, the memory cost per resident, and whether later turns actually rewind to the learned boundary. Stacked on #6159.