Repository navigation
server: --checkpoint-every-nt N, context checkpoints inside a long message (off by default) - #338
professorpalmer wants to merge 2 commits into
Conversation
|
Works as described, and the default is a no-op (same checkpoints as base). One snag: |
…e every N prompt tokens (off by default); a prompt that diverges inside a long message restores the nearest checkpoint instead of processing the whole prompt again
…acing to N (creation, the user-message break and eviction used --checkpoint-min-step, which filtered these checkpoints)
64f569a to
3439ae7
Compare
|
Thank you, that was a real gap. Fixed in
RTX 4070, Bonsai 2 27B, |
Overview
The server makes context checkpoints only where a user message starts and near the end of the prompt. A hybrid / recurrent model cannot roll back its state without a checkpoint. When an agent client changes a prompt inside one long message (for example, a tool result that is edited or cut, or a stop and a new message in the middle of a long turn), the nearest checkpoint can be tens of thousands of tokens back, and the server processes the whole prompt again.
This change adds
--checkpoint-every-nt N(envLLAMA_ARG_CHECKPOINT_EVERY_NT). With N > 0, the server also makes a checkpoint at the start of a prompt batch when N or more prompt tokens are after the last checkpoint. A later prompt that diverges inside a long message then restores the nearest checkpoint. The default is 0: the behavior does not change. The existing limits (--ctx-checkpoints,--checkpoint-min-step) still apply.Additional information
Bonsai 2 27B PTQ1_0 with the MTP head (hybrid: Gated DeltaNet + attention), our fork with the same commit (applies to
prism8b0c19c without changes), a bench that sends 11 agent-like requests (quote a file, edit it with a tool call, plain answers) after a long first message. Wall time of each request after the first, mean (min-max):--ctx-checkpointsx the state size (32 x about 170 MiB for this model). On the 2060 the server working set went from 6834 to 7333 MiB at 64k.Requirements