mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1665] [CLOSED] resident RAM: spend --resident-budget-gib before an auto helper cache #3594
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#3594
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/1665
Author: @W1nge
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:codex/resident-budget-first📝 Commits (1)
30527dfresident RAM: spend --resident-budget-gib before an auto helper cache📊 Changes
1 file changed (+39 additions, -0 deletions)
View changed files
📝
src/program/generate.cpp(+39 -0)📄 Description
The problem
A prompt reads back every routed expert's blob from wherever it lives. With
--expert-cache-device1..3that is one copy per expert over that card's PCIelink, while the same bytes served by the host tier travel the primary's link.
On a 2080 Ti (Gen 3 x16) + P100 (Gen 3 x4) rig the auto cache gave CUDA1
8782 experts (14.29 GiB) and the prompt path read 14.63 GiB back per prompt at
the x4 link's saturated 3.4 GB/s: 4.3 s of an 8 s prompt, its largest single
term. The primary card was idle for most of it (
nvidia-smisampled at300 ms: 5-57 % utilization, 24-122 W of 310 W).
--resident-budget-gibalready exists to put experts in host RAM, but thehelper caches are filled first from the same ranked list, so the RAM copy only
ever gets the complement the helpers leave behind - raising the budget alone did
nothing (a 12 GiB and a 17 GiB budget both produced the same 10.84 GiB copy).
The change
The ranked list is now spent primary cache, RAM, helpers: the resident
budget's walk marks its pairs in
claimed, which is exactly what a helper'sfill already skips (a layer split's pairs are recorded there the same way). The
reservation uses the same bound the resident copy does
(
detail::clamp_resident_budget), so it cannot reserve more than the RAM willhold. An explicit
--expert-cache-device1 Nis left alone, and so is the wholetier set around one.
Measured
5K prompt fixture (cold prompt cache), 4 baseline runs vs 3 with the change;
the harness's run-to-run spread on the same config is +-8 %:
The decode side is the tradeoff: the helper's cache is also what lets it
compute a decode expert locally, so a smaller cache means more decode experts
fetched over PCIe. It lands ~3 % lower here, inside the fixture's own spread,
against a 7-20 % prompt gain - and the change only applies when an explicit
budget asks for the RAM residency, so a rig that values the helper cache can
leave
--resident-budget-giboff.Correctness: the bytes are the same bytes, only their tier changes; the daily
end-to-end fixture (5 cases, cold) passes, and the existing
--layer-splitpath's
claimeduse is unchanged.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.