mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #751] [CLOSED] Persist conversation KV state in a bounded disk LRU cache #2805
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#2805
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/751
Author: @Averyyy
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:feat/disk-kv-lru📝 Commits (10+)
d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it57bd713sycl: pipeline the expert cache's profile fill (model load 3-4x faster)e3bdd74A prompt cancelled mid-read is logged and recorded with the tokens it read (#471)f2aaba1"The draft head does not fit" says what to change (#474)64987c8UPDATE.bat / update.sh: update Strata without starting the model (#475)6d0e648Opt-in: keep what the expert cache learned across restarts (--expert-profile-save, #477)5ccf3a7Engine 0.1.36: a cancelled prompt logged as read so far (#471), the draft-head hint (#474), UPDATE.bat (#475), --expert-profile-save (#477); setup requires it📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
tools/kv_persistence_batch.py(+2 -1)📄 Description
Completed conversations currently lose their cached state when the engine exits. This adds an opt-in disk LRU that preserves text, image and completed batch-slot state across graceful restarts, then restores the longest exact matching token/image prefix or turn checkpoint.
Snapshots stream authoritative INT8 K/V, QSA/GDN/PLE state, image identity and prompt checkpoints for every GPU stage through 64 KiB buffers. Solo snapshots include MTP draft K/V. Batch snapshots use an explicit signature without draft state; restoring them clears the drafter's resident and host K/V while the main model verifies generated tokens. Completed slots commit before overwrite or shutdown, and pipelined groups drain and commit before padding overwrites a finished row. Cancelled and partial work is not committed.
Slot-to-solo transfers retain the conversation's turn checkpoints. A request that finishes after leaving a slot can restore its original prompt or branch from disk after restart.
The shared directory defaults to a 30 GiB budget with durable global LRU eviction, temporary writes and atomic replacement. Configure
--kv-persist,--kv-persist-dir,--kv-persist-max-mib,--kv-persist-identityandengine_close_sthrough the existing server config. INT8, MTP and prompt checkpoints are required; RAM conversation parking stays disabled. The existing solo disk format remains compatible. Disk metrics accumulate across solo, admission, yielding and resumed request segments, alongside the upstream PCIe-offload metrics.Validation on Windows with two RTX 3080 20 GiB GPUs and Qwen3.8-Flash-Next IQ3_S:
The non-thinking document benchmark exposed one budget-arithmetic error (6976 instead of 7036), reproduced in a solo request; enabling thinking passed the same case.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.