mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 21:05:40 +07:00
[GH-ISSUE #4637] [Engine] DS4_UMA_HEADROOM_GIB holds nothing back on a DGX Spark when the page cache is small #2102
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#2102
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 @chestercs on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4637
Area
[Engine]
Desktop app, Terminal or source?
Docker: the release engine package, with the server from a v0.2.7.1 checkout.
What happened
On a DGX Spark,
DS4_UMA_HEADROOM_GIBdoes not hold back memory when the page cache is small. When we set it to 16 GB and then 30 GB, the engine placed the same experts on the GPU both times. During the load MemAvailable fell to between 0.2 and 3.2 GB.uma_free()(src/dsv41/ds4_model.cu, line 236 at46c152a1) returns MemAvailable less the headroom only when that number is larger thancudaMemGetInfo's free. Otherwise it returnscudaMemGetInfo's free.On the GB10,
cudaMemGetInfo's free is MemFree. With the engine loaded we read:cudaMemGetInfofreeWhen the page cache is small, MemFree is close to MemAvailable. The function then returns MemFree, and the headroom is not applied. The page cache is small right after a boot, or after the model files' pages have been dropped. We drop them before each start, so that the placement is not sized against cached pages.
The four starts, on 2026-10-29. The first column is the engine's own log line,
ds4: the experts VRAM leaves over (~X GB) ... (Y GB of RAM free ...):DS4_UMA_HEADROOM_GIB--ssd-cache 0--ssd-cache 0--ssd-cache 0The experts total ~122 GB, so about 104 GB of experts were placed. Our memory guard stopped each load; it polls MemAvailable and kills below 6 GB, and the last column is its reading. The engine did not report an error before that.
Expected: the placement stays at or below MemAvailable less
DS4_UMA_HEADROOM_GIB, as the comment aboveuma_free()describes.Workaround: pass
--vram-experts F, with F = (MemAvailable − margin) / (MemFree − reserve), computed in a wrapper before the start. With a 16 GB margin the same start placed 11,488 of 15,744 experts (90.3 GB) on the GPU. MemAvailable stayed at 10.3 GB or more during the load.A possible change: on an integrated GPU, return MemAvailable less the headroom whenever MemAvailable is larger than the headroom, not only when that is above
cudaMemGetInfo's free. With a large page cache this is the same larger number as today. I can open a PR if that shape is fine with you.Smallest steps or command that reproduce it
Use a DGX Spark with other processes holding memory. Ours held ~15-20 GB beside Strata: an agent gateway, embeddings, Whisper and a browser.
Make the page cache small, so that MemFree is close to MemAvailable. A boot does this, as does
posix_fadvise(POSIX_FADV_DONTNEED)on the model files orecho 1 > /proc/sys/vm/drop_caches.Start the engine with
DS4_UMA_HEADROOM_GIB=16and then30, without--vram-expertsor--reserve-mib, and watch MemAvailable during the load:Not tested: Strata alone on the Spark. After a boot its page cache is small as well, so we expect the same placement there, but we have not measured it.
Reproduction status
Reproduced locally. Four loads, and the headroom at 16 and 30 GB gave the same placement. The link from
uma_free()to that result is our reading of the code, supported by thecudaMemGetInfo= MemFree measurement above.Strata version
Strata 0.2.7.1 (
46c152a1) · engine 0.1.53 (strata-dsv41-0.1.53-linux-aarch64-cuda-cuda13)Graphics card, memory and system
DGX Spark (GB10), 128 GB unified · Ubuntu (DGX OS), driver 580, CUDA 13.0
Model, size and settings
DeepSeek-V4.1-Flash-1017, ISTA-DASLab GSQ-RCO IQ1_M (1.75 bpw) with the DSpark drafter · 131,072 context · Faster mode (5 experts) · 10 CPU-lane threads pinned to the Cortex-A725 cores