mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1683] [Feature]: --resident-budget-gib keeps no lend region, so every prompt chunk reads the borrowed slots' experts from the SSD #672
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#672
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 @KarlGrier on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1683
What do you want to do?
Use
--resident-budget-gib(to cap how much RAM the expert copy takes) without the prompt path reading its borrowed cache slots' experts from the SSD on every chunk, when a larger budget, or RAM, has room for them.Today a RAM budget turns the RAM copy's lend region off.
pin_cache_complementsetslend_from_slot = -1in its budget branch (expert_source.cpp L2291 at v0.1.41, commented "A budget turnslendoff"). So the experts of the GPU slots that a prompt chunk borrows are in neither VRAM nor RAM during the prompt, and every chunk reads them from the drive, even when the budget already holds every other expert and RAM has room for these too. A larger budget does not help: the budget branch only places experts the GPU cache does not hold. Without a budget,--resident-expertskeeps them ("2225 of the prompt path's 2225 lendable slots keep their experts in RAM too").Measured 2026-10-09 on stock v0.1.41 (source build with
-DSTRATA_MMQ_KQUANTS=ON). UD-Q4_K_XL (unsloth, 71.7 GiB of routed experts), RTX 5080 16 GB alone, 96 GB RAM,--prefill auto:16384. Served, A B B A, a fresh server per arm, model page cache dropped first. Two different 32,768-token prompts per arm, nothing reused:--resident-budget-gib 66--resident-expertsFour 32K reads per setting (two arms, two prompts each). The budget arm takes about 26 % longer to read a 32K prompt (11.76 s against 9.33 s on average) and reads about 24 times as much from the drive. The engine's own I/O line for one 32K prompt: "the OS read 28821.4 MB from storage (14 major faults) for 27507.6 MB of expert reads" with the budget, and "the OS read 1215.3 MB from storage ... for 0.0 MB of expert reads" with
--resident-experts. Decode after these prompts was 61.0-68.4 tok/s with the budget and 66.6-71.1 with--resident-experts. These are short answers, one per prompt; we did not look into that difference.The start warning in budget mode says:
With a budget the count is 0 whatever the chunk size, so its advice (a smaller
--prefill, or auto) cannot keep them in RAM here.Two ways this could go: the budget mode keeps a lend region inside the budget, filled after the complement as far as the budget reaches (as
--resident-expertsdoes from available RAM). Or the warning names the budget as the cause when one is set.Related: #669 and #765 (the warning itself), #1389 (lend coverage with
--resident-experts, where the line now warns when it is not N of N), and #1190 (the same gap for a layer split; it leaves the single-GPU path as it is).Not tested: a helper GPU, a layer split, Windows, other files and chunk sizes,
--prefill auto, and longer prompts (on 2026-10-08 a local build of v0.1.41 showed the same warning in budget mode and read a 120K prompt in 34 s).Measured and drafted with Claude Code.
@Niko1221 commented on GitHub (Oct 10, 2026):
Thank you, this is a clear report and the code agrees with it. In
pin_cache_complement, a RAM budget setslend_from_slot = -1, so no lend region is kept, and a larger budget cannot change that because the budget branch only places experts the GPU cache does not hold. Your numbers (28.8 GB read per 32K prompt against 1.2 GB) fit that exactly. The start warning also does give advice that cannot work in that mode, which we will fix whatever else we do.The change we would look at is the first one you suggest: with a budget, keep the lend region too, filled after the complement (hottest first) as far as the budget reaches, so the budget stays a hard cap. Only where experts are placed changes, not the maths, so the output should stay identical; we would verify that, and A/B the prompt read time and MemAvailable on a machine where the RAM is smaller than the model. A budget that is too small for the complement plus the lend region would simply keep fewer lent slots and warn, as
--resident-expertsdoes now.One question: with
--resident-budget-gib 66, MemAvailable went down to 16.6 GiB, and with--resident-expertsto 12.2 GiB. Is there a reason you did not use a budget of about 72 (the complement plus the 6.5 GiB the lend slots need) to compare? It would only show the same 0 of 2,225, as you say, but we want to be sure what you measured before we change the code.@KarlGrier commented on GitHub (Oct 11, 2026):
Thanks. To your question: no, there was no reason against 72; I just didn't know yet that the lend region mattered. The budget was sized before the model's first start. The 5080's cache would hold about 2,650 experts, and every other expert came to 63.9 GiB. Since the budget branch only allocates what it places, I expected anything above 64 GiB to hold every expert, and set 66 for some slack. The lend slots' 6.5 GiB was not part of that sum, because I didn't know a budget turns the lend region off. I only learned that from the start warning, and then from
pin_cache_complement, which also showed that a larger budget could not change the count. So I didn't measure one, and for the issue I kept 66 to match the earlier run.I have now measured
--resident-budget-gib 72on stock v0.1.42 (61b3fb5d, built with-DSTRATA_MMQ_KQUANTS=ON) withSTRATA_ROUTE_TAIL_SKIP=0. Everything else is as in the issue: machine, file, flags and method (served, a fresh server per arm, the model's page cache dropped first, the same two 32,768-token prompts). I ran 66 and--resident-expertsagain in the same session to compare. My first try at these runs was cut short by a RAM stability problem on my machine (now fixed). The RAM now runs at 6000 MT/s instead of the issue's 6200, and the NVIDIA driver is 615.71.09, so compare these rows with each other rather than with the issue's.--resident-budget-gib 72--resident-budget-gib 66--resident-experts(The 5080 now has about 50 MiB more free at start, so its cache gets 2,669 slots instead of 2,651 and lends 2,258 instead of the issue's 2,225.)
The engine's lines with 72:
So 72 behaves exactly like 66. The RAM copy stops at the 63.95 GiB complement, 0 of the 2,258 lent slots keep their experts in RAM, and each 32K prompt reads about 29 GB from the drive. The other 8 GiB of the budget stay unused. They would have been enough: the complement plus the lent slots is 63.95 + 6.59 = 70.54 GiB, which is what
--resident-expertsholds (70.53 GiB). With those experts in RAM, the 32K read takes 8.8-8.9 s instead of 11.2-11.3 s, and the drive reads drop from about 29 GB to 1.2 GB per prompt.Measured and drafted with Claude Code.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.