mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4168] [Engine] Lend part of the expert cache's VRAM to another program while requests run (layer split, opt-in) #1827
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#1827
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 @TacoTakumi on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4168
Area
[Engine]
What do you want to do?
I run Strata on a layer split over two RTX 3090 cards, and other programs on the same box need GPU memory from time to time: an image model, a vision encoder, a training job. Today the only choices are to unload the model or to start it with less cache for good. I would like another program to borrow part of one card's expert cache while Strata keeps serving, and give it back when it is done.
The contract is three HTTP routes on the server and three lines on the engine's stdin. It is written up as an engine-neutral spec, with a second engine (a GLM-5.3-Flash fork of Strata) already implementing it:
On Strata it builds on #533's segmented expert cache and on #2522's per-GPU caches on a layer split. A lease takes whole 512 MiB segments from a band between the cache's floor and the prompt path's loan, so the prompt path never meets a hole. The segments chosen are the coldest by the expert profile. The lend is answered between decode windows, between prompt chunks and when idle, and the return refills the experts in the background. It is opt-in ("vram_lend": true, engine flag --vram-lend). With it on, the VRAM command, POST /v1/vram and the elastic image encoder are refused, and --pipeline-windows and --batch are turned off with one line each, because they keep work in flight with no safe point for an unmap.
Branch: https://github.com/TacoTakumi/Strata/tree/vram-lend, now on v0.2.12. It has the 9 commits of #2522's current head (author kept, rebased onto v0.2.12, with the 4 fixes I described on #2522) and the 17 VRAM Lend commits.
My LLM helped me break out these data points for you. All on 2x RTX 3090 (one on a 6.1 GB/s link), Swift 1.5 IQ4_XS, vision on, through the server. The rows below were measured on v0.2.6. The re-test on 0.2.12 is after them.
Passed:
Failed:
Measured:
Not run:
Re-tested on 0.2.12 (Strata 0.2.12, engine 0.1.58, the branch above):
System: Ubuntu 26.04.1, kernel 7.0, NVIDIA driver 615.71.10, CUDA 13.3, 2x RTX 3090 24 GB for Strata, 125 GB RAM.
Full results: https://github.com/TacoTakumi/vram-lend/blob/main/bench/results/strata.md
Is this something you would take in, and if so, in what shape? I can split it into smaller PRs (the segment-set unmap and map in ExpertCache first, then the lend lines, then the server routes), or keep it on the fork if it is out of scope.
What do you do today instead?
I unload the model when the other program needs the card, or I start Strata with a smaller cache for good. #533's VRAM command shrinks the cache between requests, but it waits for the running request and is not meant for a borrower that comes and goes while requests run.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@TacoTakumi commented on GitHub (Nov 7, 2026):
/reopen
I rebased the branch onto 0.2.12 and re-ran the lend smoke and the unit tests on it. The issue body has the results and says what I did not re-run.
@github-actions[bot] commented on GitHub (Nov 7, 2026):
Reopened, thank you. A maintainer will pick it up from here.