mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1920] Prompt-cache checkpoint pool: two alternating long conversations evict each other and both re-read from token 0 every turn (no batch-groups) #757
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#757
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?
Originally created by @xingyun618 on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1920
Engine version
0.1.42 (compiled from main for sm_70, CUDA 12.0, Linux)
Hardware
1x Tesla V100-SXM2-32GB, 23 GB system RAM, i5-8400 (6 cores)
Model: Qwen3.8-Flash-Next IQ2_XS, low-RAM resident mode,
--max-context 262144 --kv q4_0What happened
Two Hermes agent conversations share one Strata server. Both grew to ~170K tokens.
While both were active, every turn of both conversations re-read the whole prompt
(~145 s per turn at ~1190 tok/s), even though the engine kept writing checkpoints:
The alternating short request is the third conversation (a tool-call turn, ~600 tokens).
No
skip parkinglines in the log (conversation-cache parking never engaged; this isthe
--prompt-cachecheckpoint pool, not the parked-session tier).Diagnosis
With the default
--prompt-cache-every 16384, a ~170K conversation wants ~11-12checkpoints of its own. Two such conversations need ~24 slots but the pool is 6 by
default (I raised it to 12, then 16): each turn rewrites its own 12 checkpoints and
evicts the other conversation's, so neither finds a matching prefix on its next turn
and both re-read from token 0. The
N checkpointscounter stays healthy — it countswrites, not reuse — which is what makes this easy to miss.
Single-conversation use is fine (reuse 99.9%, 1-2 s per turn on ~890-token deltas);
it only collapses when two long conversations alternate. This looks like the same
family as #1604 (checkpoint pool starvation with more than one conversation) but
without
--batch-groupsinvolved — plain serial serving, one slot.Workaround applied
--prompt-cache 16 --prompt-cache-every 32768(a ~170K conversation then wants ~6checkpoints, so 16 slots hold both). I have not yet measured the steady state after
the change; will report back.
Suggestion
When the pool is too small to hold the checkpoints of the conversations that were
active in the last N turns, consider a cheaper retention policy: keep the FIRST
checkpoint of each conversation (the system-prompt root,
--prompt-cache-rootalready exists) even when the tail checkpoints of that conversation are evicted, so
an alternating long conversation at least reuses the root instead of re-reading from
token 0. A one-line log when a checkpoint write evicts another conversation's newest
checkpoint would also make this diagnosable from the log alone.
Thanks for the engine — the resident low-RAM mode runs IQ2_XS at 68-88 tok/s on this
V100 box, which is genuinely remarkable for a 23 GB RAM machine.
@xingyun618 commented on GitHub (Oct 11, 2026):
Update: root cause found, and it is not the checkpoint count
I first blamed
--prompt-cachepool exhaustion (6 slots vs. two ~170K conversations).Raising the pool to 16 and widening the interval to 32K did not fix it — a
conversation that came back after the other one had run still read from token 0.
The real cause is that the conversation (parking) cache is disabled by default
(
--conversation-cache-mib 0), so checkpoints rotate out of the bounded--prompt-cachepool and each alternating conversation re-reads everything.Fix that works
Added to the engine arguments:
Measured on the same box (1x V100-SXM2-32GB, 23 GB RAM, IQ2_XS low-RAM resident,
262144 context,
--kv q4_0), two conversations of ~176K tokens alternating(A1 B1 A2 B2):
Engine log for the returning turns:
97.6% of the prompt reused, restore in ~290 ms, and
evictions=0— both parkedconversations fit. Steady-state RAM for two parked 176K conversations: ~4.3 GiB
against the 5 GiB budget, on a machine where the engine itself holds ~17.5 GiB RSS.
Why this is easy to miss
--conversation-cache-mib 0) is documented, but the symptom —healthy-looking
N checkpointscounters on every request, while reuse is 0 —looks like a checkpoint-pool sizing problem, not a missing tier.
every turn re-reads from token 0.
176K conversation) is a real budget question, so raising
--prompt-cachefirstfeels like the cheaper lever. It is not a substitute.
Suggestion
tier served it (live session / parked conversation / checkpoint / root / none).
That single addition would have pointed at the missing parking tier immediately
instead of at the checkpoint count.
reusedis always 0 whileN checkpointsis non-zero, the pool is rotating,not undersized.
Still a great engine — the resident low-RAM mode runs this at 68-88 tok/s on a
23 GB machine. Thanks.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.