Repository navigation
serve: "strata_checkpoint": false lets a one-shot request skip its conversation checkpoint (#830) - #861
Closed
brenoperucchi wants to merge 3 commits into
Closed
serve: "strata_checkpoint": false lets a one-shot request skip its conversation checkpoint (#830)#861brenoperucchi wants to merge 3 commits into
brenoperucchi wants to merge 3 commits into
Conversation
…nversation checkpoint (Niko1221#830) A request with "strata_checkpoint": false sends ckpt=0 to the engine. That request reads its prompt in one part and saves no checkpoint at its last turn boundary, nor the periodic ones of a long prompt. It still resumes from a checkpoint it matches and still saves the system-prompt root. Absent or true: today's behavior; an engine without the key skips it.
… skipped and when the root is taken
…gates see every request
brenoperucchi
force-pushed
the
prompt-cache-optout
branch
from
October 5, 2026 00:48
f7c5a7b to
7774875
Compare
Owner
|
Merged for 0.1.40: "strata_checkpoint": false lets a one-shot request skip its conversation checkpoint. Default unchanged. Documented in DETAILS. |
imanu86
added a commit
to imanu86/Strata-2080Ti
that referenced
this pull request
Oct 6, 2026
Merge di upstream v0.1.40 (1735d64) nel main del fork: 26 file in conflitto, 92 blocchi risolti tenendo entrambi i lati. Dove upstream ha rifatto una funzione che il fork aveva gia' (checkpoint di coda, accodamento K/V del draft, gather IQ3_S, ckpt per richiesta Niko1221#861) vince la versione upstream; restano del fork il porto SM75 e la sua quota di riserva, la cache elastica col nucleo (il flag interno si chiama ora elastic_vmm_ per non scontrarsi con vmm_ di upstream), il kernel Q2 esatto come predefinito (STRATA_Q2_LEGACY sceglie quello di upstream), --pool-tasks, la sonda gate-first e le sonde di laboratorio. Il probe del fork sugli scambi residenti usa la nuova firma con la scheda proprietaria del layer; il test conversation_split_failure_test di upstream ha un cast esplicito che MSVC richiede. Verifiche: CTest 99/101 passati (ple_parity cerca il modello in un percorso relativo, expert_multi_test chiede AVX512), q2_exact_parity 0 differenze su 570634 righe, iq256_dump identico alla PR Niko1221#930 (normale e gather); teacher forcing a posizionamento fisso identico byte per byte a upstream 0.1.40 puro su explain; su code il fork resta diverso da upstream come gia' in 0.1.39 (KL 6,5e-4 in entrambe le versioni) e rispetto alla 0.1.39 del fork cambia in 2 posizioni su 169, quante ne cambia upstream tra 0.1.39 e 0.1.40 (argmax e top-5 invariati). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #830. A request can now send
"strata_checkpoint": falsewhen no later request will continue it, such as a classification call or a probe. For that request only, the engine:--prompt-cache-everytokens;--conversation-cachedoesn't park it.It still resumes from a checkpoint it matches, and it still saves the system-prompt root when that reaches
--prompt-cache-root. Without the field, or withtrue, nothing changes. The server passes it to the engine asckpt=0, next tocvec=0; an engine without the key skips it.I didn't use
cache_prompt: falsefor this. In llama.cpp it means "don't reuse the cache", and these calls need to keep reusing the root.Changes
src/program/generate.cpp: parseckpt=0. With it,turn_atis dropped (the root is still looked for up to the last turn),pp_next_checkstays atINT64_MAX, andlive_okstays false.STRATA_STATE_HASHstill prints for the request.serve/server.py:"strata_checkpoint": falseaddsckpt=0to the request keys.serve/test_server.py: the key is sent only forfalse.cache_prompt: falsedoesn't send it.docs/DETAILS.md: one paragraph under the conversation cache.Measurements
I built this branch myself on Windows (CUDA 13.0, sm_120, Release) and ran both arms on the same binary and the same server start, alternating A B A B. Setup: RTX 5090 32 GB, Ryzen 9 5950X, 96 GB DDR4-3200, Swift IQ3_XXS,
--prefill auto:32768 --max-context 32768 --kv int8 --pcie-frac 0.20 --spec 4 --spec-min-p 0.70 --prompt-cache-root 64,STRATA_IQ_MT_MIN=1.The calls have the shape from #830: a fixed system prompt of about 70 tokens and 150 to 450 tokens of public code (excerpts of v0.1.32's
generate.cpp),max_tokens1, thinking off, 12 calls per size with the first 2 skipped. The client ran on the same PC. Medians of the second pair:prompt_mswithoutprompt_mswithfalsefalseThe table shows the smallest of the three pairs. The
prompt_mssaving per pair was 46/47/46 ms (A1/B1), 42/38/39 ms (A2/B2) and 47/44/45 ms (traced pair). Both arms reused the 69-token root on every call after the first one of each start, which builds it. All 216 one-token answers wereSAFEin both arms, so they only show that the label didn't flip.In a separate start with
STRATA_TRACE=1, after the first call, the default arm reads each prompt in two parts ((batched), then 6 tokens(windows)) and ends with2 checkpointskept. Withfalsethere is one(batched)read, no(windows)read, and1 checkpoints(the root).State parity
To check the state itself, I ran two more starts with
--adapt-swaps 0andSTRATA_STATE_HASH=1, the second one also withSTRATA_CKPT_REREAD=1, and compared the hash printed after each request. For the 18 requests with"strata_checkpoint": false,L,gdn,ple,tail,pooled,kvandmtpwere identical between restoring the root and reading it again (onlystalediffered, in 2 of them). The 18 default requests differed in every field, which I'd expect:STRATA_CKPT_REREADreads the 6-token header batched instead of through the windows. Withfalsethe header goes batched in both starts, so that pair compares the same reads.Not covered
--conversation-cache-mibor serve: park conversations on disk, keyed by a client id; requests without one stay in RAM #718's disk parking; for parking, the change is only thatlive_okstays false, and serve: park conversations on disk, keyed by a client id; requests without one stay in RAM #718's park checkslive_oktoo.--batch/"parallel": afalserequest that continues in a slot still leaves that slot cached. It does no extra copy and the next probe doesn't match that slot, but this change doesn't cover it.sycl/src/program/generate.cpp) has the same logic and isn't changed here. It ignoresckpt=0until it is ported.falserequest should skip that one too.falsethe 6-token assistant header goes through the batched path instead of the windows, so its rounding differs slightly from the default arm, as it does with--prompt-cache 0. A parity test should compare the same arm against itself, as above.I can rerun anything you want on this machine, for example
tools/conversation_cache_parity.pywith somefalserequests mixed in.