mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #718] [CLOSED] serve: park conversations on disk, keyed by a client id; requests without one stay in RAM #2786
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#2786
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/718
Author: @evaanp
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:pr/disk-parking📝 Commits (10+)
8b9bb4edocs: add community benchmark submission guideb4f70e7docs: add RTX 5090 community benchmark resultse30cd9bBench: RTX 3090 / dual RTX 3090 on EPYC 74536f21f22CS-T: the partial pin of the RAM tier opt-in (STRATA_PARTIAL_PIN=1)c4175bdMerge branch 'f-q4-on242' into r131-finalf6c18ffdocs: Unsloth UD-Q4_K_XL manual import (docs/UNSLOTH_Q4.md); DETAILS: the mapped mode without experts.bin, --resident-budget-gib, the tier counters652437bMerge branch 'f-q4-on242' into r131-final9259cadEngine 0.1.31: Unsloth UD-Q4_K_XL runs on a 64 GB PC (experimental: split GGUF, Q4_K/Q5_K/Q5_1/Q8_0 experts, RAM budget + SSD tier with routing prefetch), the low-RAM mode reads GGUF experts in place, Windows GGUF load 2x (#230), server status race (#266) and tokenizer (#268) fixes, truncated tool calls (#211/#231), AMD intrinsics (#262); setup requires it3fb00c1HIP (S6): RDNA4 matrix-core prompt attention for int8 KV, opt-in (STRATA_HIP_WMMA=1, gfx12 only)648ab7fHIP (S6): router_top10 without its serial parts on AMD, bitwise the same (default on HIP; STRATA_HIP_ROUTER_OLD=1: old)📊 Changes
1 file changed (+28 additions, -15 deletions)
View changed files
📝
tools/conversation_cache_parity.py(+28 -15)📄 Description
Builds on #716 (parking with --layer-split); the first 12 commits are that PR.
What
Parking in RAM (#57) needs host RAM that a PC running this model has little of: the experts take it. A long agent
conversation is 1-2.5 GiB of snapshot, so with a few sub-agents and side calls the budget is gone, and every switch
back reads the whole prompt again.
--conversation-disk-dir DIRparks on disk instead.X-Strata-Conversation: <id>(or the body fieldstrata_conversation) namesthe conversation; the engine gets it as
conv=. The id only picks the files: the prompt must still continue whatwas parked, otherwise the request reads from the deepest checkpoint it shares.
checkpoints; pages the files already hold are kept.
--conversation-disk-gib N(default 32) bounds the directory;the oldest conversation goes first.
restores there, and never pushes a keyed conversation out. A session holding a keyed conversation is never parked
in RAM too, and a keyed request is looked up only on disk.
does not continue its live end: diverges at N of M (prompt P); live=...|... prompt=...|..., with the token idsaround it. That is how a client that re-renders its own history (a template, a tool-call parser, a tokenization
the model did not sample) can be found; without the line the request just read from a checkpoint or from 0.
tools/conversation_cache_parity.py:--scenario disk(A with an id, B, A again, a request without an id, arewind to a checkpoint) and
--scenario mixed(A with an id, B and C without, interleaved), each against a runwith no cache at all.
Measured
RTX 5060 Ti 16 GB + RTX 2000 Ada 16 GB (
layer_split 30), Ryzen 7 9700X, 64 GB RAM, Samsung NVMe.On our own branch (v0.1.38 merged with this code plus unrelated patches of ours; the parking code is the same as
here), IQ3_S,
--conversation-cache-mib 1024:--scenario disk: PASS (A/B/A, delta parks, a rewind to a checkpoint; tokens and main-model state byte-exact).~2K-token conversation: the first park writes 254.5 MiB in ~0.36 s, a later one 113-226 MiB while keeping 141-255
MiB already on disk; coming back reads its running state in 0.2-0.4 s and restores 28.5 MiB in 50-75 ms.
--scenario mixed: PASS. Only A (with an id) parked on disk; B, B+, C and B++ (without one) parked in RAM, and B+ andB++ came back from RAM, each turn byte-exact against its conversation played through without a cache.
Earlier, IQ2_XS with the 0.1.34-based version of this code:
plus 0.4-1.1 s of running state.
--scenario disk: tokens and main-model state byte-exact.it again took ~90 s; two sub-agents alternating per call switched in ~1.5 s each.
Developed with an AI coding assistant; all numbers measured on the machine above (Linux, CUDA 13).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.