mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2881
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/861
Author: @brenoperucchi
Created: 10/5/2026
Status: ❌ Closed
Base:
main← Head:prompt-cache-optout📝 Commits (3)
11cd9f3serve: "strata_checkpoint": false lets a one-shot request skip its conversation checkpoint (#830)42a81aeckpt=0: its session is neither continued nor parked; docs say what is skipped and when the root is taken7774875ckpt=0: still print STRATA_STATE_HASH for the request, so the parity gates see every request📊 Changes
4 files changed (+26 additions, -4 deletions)
View changed files
📝
docs/DETAILS.md(+5 -0)📝
serve/server.py(+4 -0)📝
serve/test_server.py(+5 -0)📝
src/program/generate.cpp(+12 -4)📄 Description
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 #718's disk parking; for parking, the change is only thatlive_okstays false, and #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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.