mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#3510
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/1529
Author: @konijiwa110
Created: 10/8/2026
Status: ❌ Closed
Base:
main← Head:conv-disk-tier📝 Commits (10+)
34e2409serve: keep evicted conversations on disk across restartsd258f18serve: restore a session file without holding its K/V in RAM0d846c1Merge remote-tracking branch 'upstream/main' into conversation-spill-disk1904b8aserve: recompute the RAM conversation match after a failed disk attempt: make_room may have evicted the entry the stale index named1a9e8b9Merge remote-tracking branch 'upstream/main' into conversation-spill-disk3a5daf6Merge branch 'pr-1269' into disk-only-cachedd146f4serve: --conversation-cache-disk-only - the conversation cache on disk, no RAM budgetb189048conversation_spill_test: disk-only checks; docs: --conversation-cache-disk-only, measured on Strix Haloff30368docs: --conversation-cache-disk-only restores measured from a cold page cache2987ac4serve: disk-only cache keeps each conversation's root as a persistent prefix entry📊 Changes
17 files changed (+2534 additions, -98 deletions)
View changed files
📝
CMakeLists.txt(+6 -1)📝
docs/DETAILS.md(+107 -4)📝
include/strata/core/conversation_cache.hpp(+138 -16)📝
include/strata/core/conversation_file.hpp(+28 -0)📝
include/strata/core/conversation_snapshot.hpp(+30 -0)➕
include/strata/core/conversation_spill.hpp(+151 -0)📝
serve/server.py(+55 -2)📝
serve/test_monitor.py(+44 -0)📝
serve/web/app.js(+28 -1)📝
serve/web/index.html(+4 -0)📝
src/core/conversation_file.cpp(+227 -32)📝
src/core/conversation_file_test.cpp(+122 -0)📝
src/core/conversation_snapshot.cpp(+79 -14)➕
src/core/conversation_spill.cpp(+470 -0)➕
src/core/conversation_spill_test.cpp(+428 -0)📝
src/core/conversation_state.cpp(+17 -2)📝
src/program/generate.cpp(+600 -26)📄 Description
Builds on #1480 by @routhjim, which stacks #1271 by @ANBAL534 and #1269 by @pspranger-throw. This branch sits on #1480's current head (
8c0a5af, on v0.1.41) with their commits unchanged; mine are the three on top (d9beea0and86ec596for the code,42cb955for the numbers in DETAILS.md). If #1480 lands first, this rebases down to those three.I had a similar disk tier running locally for a while. When I compared it with yours, the session-file base and the streamed save and restore were better than mine, so I moved the parts of mine that still helped onto your branch instead of opening a competing PR.
What changes
spill_async). Before, it was written and flushed inside the request that caused the eviction. The writer thread only callssession_file_write, and the index is only touched on the main thread:wait()joins the write and indexes the file. This happens before a disk match, before a streamed save, and at shutdown, so a file is never matched before it is complete. A failed write removes its file.--conversation-cache-disk-onlywrites it. A disk hit larger than the RAM budget is streamed back the way that mode reads it. This applies on one GPU, without--batchor--peer-device, like disk-only.put()calledmake_roomwithout the spill callback. An image larger than its estimate could evict conversations that were then lost. They now go to the disk tier too, and so does an imageput()refuses.make_roomcould not free the room or the physical-RAM admission said no, so the request fell back to a prefix or a full read. It is streamed back now. I hit this on my own box: a 166K-token conversation came back with only its 46K prefix and re-read 122K tokens (99 s).940011dstays. Since an evicted image now goes to the writer thread and stays in RAM until it is written, the park waits for that write before it gives up.--conversation-cache-disk-min-tokens N(default 0, off). Conversations shorter than N are not written.--session-min-free-mibfree, as SAVE does.With the defaults and the RAM cache off, behaviour is the same as #1480.
Measured
Measured after the rebase onto v0.1.41: #1480 at
8c0a5afagainst this branch at86ec596, same machine, same flags.Setup. RTX 2080 Ti 22 GB, i5-12490F, 62 GB RAM, Ubuntu, NVMe. Swift 1.5 IQ3_S,
--kv int8 --kv-resident 32768 --spec 4 --mtp.Workload. Three agent-style conversations take turns with
--conversation-cache-slots 1. They share a system prompt; each first prompt is about 16K tokens, and each later turn adds about 2.2K. There are 3 rounds, an engine restart (SIGTERM), then 2 more rounds. Decoding is greedy with 24 output tokens. The table shows prompt-read time for the 12 later turns.--conversation-cache-mib 4096--conversation-cache-mib 4096--conversation-cache-mib 256--conversation-cache-mib 256serve/server.py's 10 s wait before it kills the engine was never reached.Tests.
conversation_spill_testhas 34 new checks of mine; on the rebased branch all 107 pass (93 before the rebase, also under ThreadSanitizer). The checks cover the background write, the index waiting for it, branching at the root,put()evicting through the callback, waiting in the destructor, and refusal on the free-space floor. The other conversation tests pass. Before the rebase it also built on Windows (CUDA 12.6, VS 2022) with the tests passing there; I've been running it on a 2080 Ti and a 3080 since.Not included
The discussion in #1331 (@shahrokhzargarpour) and #1489 (@CC-David-CC) also helped shape this. Thanks to all of you. Happy to rebase or split it differently if that suits the stack better.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.