mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1572] [Feature]: Optionally reclaim disposable host caches when session SAVE needs RAM #629
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#629
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 @tuandat3019 on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1572
What do you want to do?
Let an explicitly enabled session SAVE reclaim reconstructible host caches before refusing its RAM preflight. This is useful on a 32 GiB PC when saving a long conversation to unload the LLM and use the GPU for another local workload.
The current admission check correctly protects the physical-RAM floor, but parked conversations, retained K/V and non-selected checkpoints can occupy RAM that the file will not contain. Our local workaround releases those caches before SAVE; I would like to contribute a narrower, opt-in implementation that only evicts under measured pressure, preserves explicit pins and the checkpoint selected for the file, and checks the original floor again after each release.
No lower RAM floor, format change, RESTORE change, process working-set trimming, or guarantee of saving under arbitrary pressure is proposed. Eviction is a tradeoff: later prefix reuse may require prefill, and released auxiliary caches cannot be rolled back if subsequent I/O fails. The live session and any previously published file must remain valid.
I searched the existing session/disk-cache PRs, including #668, #1269, #1271, #1480, #1489 and #1529. This proposal addresses SAVE admission independently of disk spilling, streamed RESTORE or non-MTP support.
Prepared against main
fb58e0d(0.1.41), tested on Windows with RX 6800 16 GiB and 32 GiB system RAM. A draft PR will include CPU failure-injection/file-parity tests and HIP build/runtime results; CUDA build validation is not available on this machine.@Niko1221 commented on GitHub (Oct 10, 2026):
Fixed in v0.1.42 by #1573 (opt-in --session-save-reclaim): a SAVE that fails its RAM check first releases retained K/V, then the oldest unpinned parked conversations, then unpinned checkpoints other than the one the file uses, and the server waits briefly for the RAM to show as available before retrying. Tested on an RTX 3060 box: with 420 MiB available a SAVE is refused without the flag; with it the engine freed two parked conversations (521 MB) and the SAVE, a restore and the next turn all worked with identical token ids.