Issues / #1444
#1444 can kvcache be saved and reused on disk?
open · @badelon · 1 コメント · GitHub で見る
Setup & installServer & APIDocumentation
本文
## 2. KV cache to disk — wired up, but the engine's writer is broken on this pack
Good news: the plumbing is correct.
```
[strata] slot save/restore on: /home/jo/Strata/strata-sessions
POST /slots/0?action=restore {"filename":"nope.bin"}
-> 404 "no saved session named nope.bin" <- right behaviour
```
Bad news: **save** always fails:
```
strata serve: session save .../chat1.bin: conversation snapshot: invalid K/V extent
{"error":{"code":500,"kind":"io"}}
```
It was isolated rather than guessed — it is **not** any of these:
- `--kv-resident` streaming on -> fails
- streaming off -> fails
- `--kv int8` -> fails
- default fp16 KV -> fails
It fails identically in all four, so it is not a config error. The error comes from
`src/core/conversation_snapshot.cpp:21-24`, where `valid_extent()` rejects when the token count
exceeds the state's `max_cells`. `docs/DETAILS.md:774-814` documents this working (a 63,025-token
save, 1.2 GB), but that example is a standard setup-installed pack — ours is a hand-packed native
`--compat-bf16` Q6_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_path` was 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:
```
--conversation-cache-mib 32768 --conversation-cache-slots 8
```
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 own* `bash -c` command line, so `kill` was
killing 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`/`bash` wrappers and waits
for the processes to be gone.
関連リンク
インストール・モデル・リリースへの站内リンク。