mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1444] can kvcache be saved and reused on disk? #580
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#580
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 @badelon on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1444
2. KV cache to disk — wired up, but the engine's writer is broken on this pack
Good news: the plumbing is correct.
Bad news: save always fails:
It was isolated rather than guessed — it is not any of these:
--kv-residentstreaming on -> fails--kv int8-> failsIt fails identically in all four, so it is not a config error. The error comes from
src/core/conversation_snapshot.cpp:21-24, wherevalid_extent()rejects when the token countexceeds the state's
max_cells.docs/DETAILS.md:774-814documents this working (a 63,025-tokensave, 1.2 GB), but that example is a standard setup-installed pack — ours is a hand-packed native
--compat-bf16Q6_K pack, and the snapshot writer appears not to handle that geometry in 0.1.40.This looks like an upstream bug, and it cannot be fixed without patching the engine's snapshot
code.
slot_save_pathwas left in place, since restore works and costs nothing.What was suggested instead
The RAM-side conversation cache gets the same reuse benefit and is a different code path that
upstream verified with native packs:
Upstream: a 9,276-token conversation restored in 51 ms. With 503 GB RAM, 32 GiB is conservative.
It needs no restart-persistence though — it does not survive a restart (only the session files
do, and those are what is broken).
Also worth knowing
That self-match bug
pgrep -f "serve.server --engine strata"matches its ownbash -ccommand line, sokillwaskilling the agent's own shell — the source of every "Killed by SIGTERM/SIGKILL" and every failed
bind. Fixed in
/home/jo/restart-strata.sh, which excludes$$/$PPID/bashwrappers and waitsfor the processes to be gone.
@Momoyeyu commented on GitHub (Oct 8, 2026):
I found a path on current main that produces this exact error when --mtp is omitted: SAVE unconditionally passes the unloaded drafter state (max_cells = 0) to conversation_snapshot_sources. The in-memory cache already handles an absent drafter, but the session-file path does not. I reproduced this with the existing host-transfer test and have a local fix for that path; hardware validation is still pending.
Was your Q6_K run started without --mtp? Could you share the engine arguments and the GGUF source/revision? I have not reproduced your specific pack, so I do not yet know whether this explains your report.
@Niko1221 commented on GitHub (Oct 8, 2026):
Saving a conversation to disk exists:
--slot-save-pathwith the/slots/N?action=save|restorecalls (docs/DETAILS.md), and the RAM-side--conversation-cache-mibyou found is the faster route that does not survive a restart. The error you got on save,conversation snapshot: invalid K/V extent, comes fromvalid_extent()in src/core/conversation_snapshot.cpp rejecting a token count above the KV state'smax_cells. We have not reproduced it, and we do not know yet why a native--compat-bf16Q6_K pack would differ. If you can post the engine log from the start (themax-contextand KV cell lines) and the number of tokens in the conversation when the save failed, we can check whethermax_cellsis smaller than the context for that pack.@Momoyeyu commented on GitHub (Oct 8, 2026):
An update on the no-MTP case from my earlier comment: #1492 fixes that path. With no drafter loaded, SAVE still passed its KV state with max_cells == 0, so any nonempty conversation failed the extent check. The host-transfer regression reproduced this before the fix; after the fix the host-only tests pass, and conversation_snapshot_test passed 4,055 checks on an RTX 4090 D, including the no-MTP disk round trip.
These tests use synthetic session state, not the reported Q6_K pack. I have not reproduced that configuration and cannot supply its startup log or failing token count. We still need the reporter to confirm whether --mtp was omitted and provide the requested logs. The PR deliberately leaves this issue open.
@Niko1221 commented on GitHub (Oct 10, 2026):
Saving a conversation to disk exists: start with --slot-save-path DIR and use the /slots/0?action=save and restore calls (docs/DETAILS.md, the slot section). The RAM-side --conversation-cache-mib is faster but does not survive a restart. For the save error "invalid K/V extent": PR #1492 has a fix for the case where no drafter is loaded (--mtp left out) and the save passed a zero extent. If your pack was started without --mtp, that is the likely cause; please say whether it was, and post the engine arguments and start-up log if the error continues.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.