mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#1027
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 @KLOP09 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2535
What happened
On Windows, adding a second NVIDIA card (a GTX 1650 that drives no display and is hidden from CUDA with
CUDA_VISIBLE_DEVICES=<RTX 5070 UUID>) made the low-RAM resident mode stop page-locking its RAM copy. Same config, same engine, before and after:Cause: the largest single pinned allocation is halved, the total is not. Measured with the CUDA driver API (
cuMemHostAlloc,PORTABLE | DEVICEMAP, the same flags as the complement), only the RTX 5070 visible, ~26 GB RAM available:It looks like two ~7.3 GiB regions instead of one ~14.7 GiB region. Logging out does not change it (7.344 / 14.0 GiB again). With both GPUs visible to CUDA, and with the
defaultflags, 6 GiB is granted and 8 GiB refused, as with only the 5070 visible. Windows reports 15,945 MB of shared GPU memory per adapter (half of 31.1 GB). Before the 1650 went in, a 14 GiB complement was pinned on this PC and a 19.8 GiB one was refused.Why the engine is hit: on Windows,
FileExpertSource::pin_cache_complement(v0.1.44.1, the same file on main today — read, not run) still asks for the whole complement with onecudaHostAlloc(Mapped | Portable). The stepped registration of #1250 is only switched on inside#if defined(__linux__), andSTRATA_PARTIAL_PINregisters a single prefix. So with the default settings the whole 14 GiB stays pageable, the prompt path streams it through the stager, and the decode's PCIe share is off.STRATA_PIN_BY_NEEDis inArenaExpertSource::openonly.Suggested fix: #2485 does this for the SYCL port (2 GiB chunks,
complement_at()), asGgufExpertSource::mirroralready does. A CUDA counterpart would fix it here, with two changes for this kind of limit:What it costs (0.1.31, Qwen3.8-Flash-Next IQ2_XS,
--resident-budget-gib 14, 64K, MTP, the same agentic tasks on two runs, logged in both times)So pinning is worth 3–5 % in decode and 2–10 % in prompt reading here: modest. The bigger reason is the next part.
Possibly related to #879/#606 (not proven): the all-NaN signature hit twice in the pageable run, 2 of 30 new sessions. Replies were
!only, with the expert-cache hit at 99.1–99.9 % and decode at 74–127 tok/s. In the first event 14 requests in a row each ran to 32,000 tokens, until we stopped the server; the second was cut by a watcher after 61 s. Both times it struck the first request of a new session right after a ~31K-token session ended. That request read its 8.5–9.4K-token prompt from token 0. In the first event a dozen tokens came out normal and then the run collapsed; the fresh prompts that followed (also read from token 0) did the same, so the poisoned state was not only the conversation's K/V. With the complement pinned it was 0 of 233 new sessions before the 1650 went in. A replicate the next morning with the 1650 disabled gave 0 of 28 new sessions, 8 of them right after a ≥ 29K-token session. 2 of 30 against 0 of 28 alone is not significant (one-sided Fisher p ≈ 0.26). Against all pinned runs it is 0 of 261 (p ≈ 0.01, mixed conditions). The second GPU and a Windows update arrived on the same day, but pinned vs. pageable is the one engine-side difference we found.Workarounds (not yet measured): disable the second card while Strata runs;
--resident-budget-gib 7(fits one region);STRATA_PARTIAL_PIN=1 STRATA_PARTIAL_PIN_GIB=7(half pinned).Probe script (Python, ctypes, CUDA driver API)
Strata version, GPU, OS
0.1.31 (the code path above is the same in v0.1.44.1 / main) · RTX 5070 12 GB (PCIe 5.0 x16) + GTX 1650 4 GB (PCIe 3.0 x4, no display, hidden from CUDA) · Windows 11 Pro 26H2 build 26300.9711 · NVIDIA 617.14 · HAGS on · Ryzen 7 9800X3D · 32 GB
@KLOP09 commented on GitHub (Oct 15, 2026):
Follow-up with the second GPU enabled again. Same PC, same 0.1.31 engine and config, one server start per setting. Short probe: 1 warm-up, 2 reads of a 17,937-token prompt, 2 generations of 400 tokens.
--resident-budget-gib 14STRATA_PARTIAL_PIN=1 STRATA_PARTIAL_PIN_GIB=7--resident-budget-gib 7STRATA_PARTIAL_PIN_GIB=7registers a 7 GiB prefix without trouble. That makes it the usable workaround on this machine today. It is no slower than the default, and a little faster in this probe; with two samples the decode spread is wide.@KLOP09 commented on GitHub (Oct 15, 2026):
Long-run result with the partial pin, as promised. Same 0.1.31 config and the same task set each time: 12 agentic runs, 12 repo runs and 4 high-effort runs, roughly 3 hours, with a fresh server for each stage.
!corruptionSTRATA_PARTIAL_PIN=1 STRATA_PARTIAL_PIN_GIB=7Related reports from my search for a driver-side fix. I found none: nobody reports a setting that changes this limit.
So with a second NVIDIA card installed, an engine-side split still looks like the only fix without a loss: chunks of 1 GiB or less, keeping whatever is granted.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. 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.
@thestigma commented on GitHub (Oct 31, 2026):
Closing note with fresh measurements: the 'halved largest pinned allocation' on a 2-GPU box is the per-allocation ceiling of the shared non-local pool — on a 64 GiB RAM desktop with two NVIDIA cards the DXGI NON_LOCAL budget is 47268 MiB and cumulative 1-GiB pins reach 45.0 GiB, while a SINGLE cudaHostAlloc/cudaHostRegister fails at 24 GiB and succeeds at 23 even with 58 GiB free RAM (one global pool, per-allocation cap ≈ half of it). Stock 0.1.55 hits exactly this: 'allocating 23.24 GiB page-locked cache complement -> page-locking refused -> trying pageable memory' with ~22 GiB of pool still free. PR #4860 adds an opt-in sliced-registration path (STRATA_RESIDENT_PIN_MODE=register) that keeps each call under the ceiling and pins the full complement (verified: '43 slices pinned (20 GiB); locked 2518 MiB via working-set minimum + VirtualLock').