mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #417] Windows: a 2-GPU split can't start on v1.1.25 — big pinned blocks use up the WDDM pin budget, so CUDA1 gets 0 GB #163
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#163
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 @Efs-O on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/417
Setup: Windows 10 Pro 19045, 2x RTX 5060 Ti 16 GB (+ an idle 3060), 128 GB DDR4, CUDA 13.0, Maya-S24,
--gpus 0,1, 128K ctx, v1.1.25 stock.What happens: CUDA0 pins its RAM tier, then CUDA1 is refused everything:
With
STRATA_GLM_PARALLEL_LOAD=0, the last line isthe pinned RAM tier did not allocate. Same result with the default lane and withCPU_LANE=6.At that point the process holds about 37.6 GB pinned (34.6 tier + 2x 0.81 KV + 2x 0.69 landing ring). In 1 GB pieces this PC pins 61 GB per process.
The new part: the budget depends on block size. This is the per-process ~RAM/2 WDDM budget from #147/#185/#207, but big
cudaHostAllocblocks use up much more of it than their size. A ctypes probe against cudart (nothing else running, contexts on every GPU,cudaHostAllocPortable) gave:So a tier class pinned as one multi-GB block can leave the second part nothing, even though plenty of budget would remain in small pieces. #110's one-after-another pinning makes the outcome deterministic (CUDA0 wins, CUDA1 gets 0). #153 changes the order classes are pinned in, not block size, so it wouldn't help here.
Workaround: cap the budget so it fits.
STRATA_GLM_RAM_GB=40→ tiers 20.5 + 19.5 GB, decode 9.7 tok/s;RAM_GB=48+CPU_LANE=6→ tiers 24.6 + 23.4 GB, decode 11.8 tok/s, prefill 173 @2K / 381 @8K. That works, but the 48 is found by trial, and it wastes ~13 GB of pinnable RAM.Fix we tested locally (on v1.0.3x, 2026-10-09): pin each RAM class in 1 GB pieces (a
slot(s)helper mapping slot → piece + offset, in place ofR.base + s*R.stride; envSTRATA_GLM_PIN_CHUNK_MB, Windows default 1024). Pinned total went 44.8 → 60.3 GB, disk waits 23 → 11 ms/tok, prefill 111/199 → 153/257. Decode stayed about the same on this box because the CPU lane is the bottleneck here. On a box where VRAM-hit is the limit it should matter more. Happy to rebase it onto main as a PR if you want it.@mw00 commented on GitHub (Oct 23, 2026):
Thanks for the measurements - the block-size finding was the key. In v1.1.26 the GLM RAM tier is pinned in pieces of at most 1 GB on Windows (
MAYA_GLM_PIN_PIECE_MB, 0 = one block as before), so the first GPU's tier no longer uses up the per-process budget and the second GPU gets its share. Could you try v1.1.26 on your 2-GPU setup without theMAYA_GLM_RAM_GBworkaround and tell us what each GPU's RAM tier comes out at?@air-terminal commented on GitHub (Oct 24, 2026):
Thanks for the fix. Here is a data point from a different 2-GPU Windows box, where one block already
pinned fine - and where the 1 GB pieces make decode slower.
Setup
--kv int8, MTP drafting,"gpu": [0, 1]RAM tier on v1.1.26 - the same with and without pieces, no "pinning cap" line in either:
Disk reads are 0/token in both. (Since v1.1.20 this box has pinned ~67.6 GB in one block per class;
on v1.1.15 CUDA1 hit the cap and got ~27 GB.)
Decode (
--bench, same day, same config; mean of each run)VRAM hit rate and MTP acceptance are unchanged; the difference is the CPU lane time per token
(glm stat "cpu lane ... in X ms/tok", the four bench requests):
So here the pieces cost about 7% of decode while pinning nothing extra. Would it be possible to pin
in one block first and fall back to the 1 GB pieces only when a pin is refused (or when a later GPU
would get less than planned)? That would keep Efs-O's case working without the slowdown where one
block fits. For now I run v1.1.26 with MAYA_GLM_PIN_PIECE_MB=0.
@Efs-O commented on GitHub (Oct 26, 2026):
Tested v1.1.28 on 2x RTX 5060 Ti 16 GB (CUDA 13.0, 128 GB RAM, Windows 10), Maya-S24, 131K ctx, CPU lane 6.
MAYA_GLM_RAM_GB, default 1 GB pieces: CUDA0 RAM tier 34.61 GB pinned (5222 slots); CUDA1 "a pinning cap: 0.00 GB more pin"; then "the warmed expert tables did not upload (out of memory)". Same withPIN_PIECE_MB=0(CUDA0 34.61 GB in one block).MAYA_GLM_RAM_GB=48: CUDA0 24.55 GB, CUDA1 23.43 GB; 11.5 tok/s decode (1.1.25: 11.8), prefill 163/376 at 2K/8K.pin_roomsees 0. Something in the process seems to hold ~26 GB of pinnable room between CUDA0's tier and CUDA1's.