mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1471] [CLOSED] feat: optionally offload idle session state while keeping model weights loaded #3477
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#3477
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/1471
Author: @W1nge
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:codex/idle-session-offload📝 Commits (1)
71c5d7efeat: offload idle serving session state with stable CUDA addresses📊 Changes
10 files changed (+676 additions, -13 deletions)
View changed files
📝
CMakeLists.txt(+7 -1)➕
docs/IDLE_SESSION.md(+38 -0)➕
include/strata/core/idle_cache.hpp(+61 -0)📝
include/strata/core/mtp.hpp(+5 -0)📝
serve/server.py(+13 -0)➕
serve/test_idle_cache_status.py(+25 -0)➕
src/core/idle_cache.cpp(+249 -0)📝
src/core/mtp.cpp(+7 -4)📝
src/program/generate.cpp(+180 -8)➕
tests/cuda/idle_cache_test.cpp(+91 -0)📄 Description
An idle serving process currently keeps its session VRAM and host checkpoint payloads allocated even when the model should stay loaded but no request is running. This adds opt-in session offload using the existing CUDA VMM implementation: commit a process-local snapshot, release physical session pages, then restore at the same virtual addresses on the next command.
The default remains disabled. The supported scope is one CUDA VMM GPU with fully resident KV; incompatible batch, pipeline, remote, multi-GPU and elastic-KV configurations are rejected. Writes finish before memory is released; write failure retains memory. Missing, corrupt or expired snapshots clear cached history and reread the next prompt. GPU remap failure is fatal. The server exposes cache state and released bytes in
/v1/status. Usage and limitations are indocs/IDLE_SESSION.md.Validation on Windows / RTX 2080 Ti, based on v0.1.40.3:
idle_cache_test: exact multi-region restore, CUDA graph replay after remapping, constants, corruption/truncation/missing/expired files and cleanup.Linux/HIP and other GPUs were not runtime-tested. Explicit conversation SAVE/RESTORE commands have not received a separate offloaded-state integration test. This is a focused port of our local idle-session implementation, adapted to upstream VmmRange and current checkpoint fields; no machine-specific tuning is enabled.
Prepared and tested with Codex at the repository owner's request.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.