mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3470] [Engine] CUDA layer split, 0.1.44.1: later-stage (CUDA1) free VRAM drops 2-6 MiB per long cold prompt and does not plateau #1416
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#1416
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 @Omnicef on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3470
Setup
CMAKE_CUDA_ARCHITECTURES=120, Release), Linux, driver 595.91.07--layer-split auto(K=23: CUDA0 layers 0-22, CUDA1 23-47 + head + MTP)--expert-cache auto --prefill auto --spec 4 --mtp <rt> --max-context 262144 --kv int8 --resident-experts --resident-budget-gib 31.58 --vision --vram-reserve-mib 700 --remote-expert-opt --pcie-frac 0.35 --spec-min-p 0.70(plus a control vector, not applied on these requests).
CUDA_MODULE_LOADINGunset (EAGER forced by generate).CUDA1: 203 MiB of VRAM free with everything loaded - LOW ... add --vram-reserve-later-mib 1265Observation
Free VRAM on CUDA1 (
nvidia-smi -i 1 --query-gpu=memory.free) after each request, fresh process, single client:capturing the N-token windowlines after the first prompt, so the verify graphs are not being recaptured.--resident-budget-gibshowed the same trend: 189 MiB at load, 126 after the first longprompt, 92 after 118 mixed requests.
Source read (0.1.44.1)
No allocator in
src/grows with prompt length or position:verify.cpp:1881-1887), one extra set for the doorbell path;prefill.cpp:1082-1219);pf_dev_buffer is a high-water mark of at most one chunk (mtp.cpp:1403);--max-context(generate.cpp:4446);gemm.cu:441);cudaMallocAsyncor memory pool.That leaves state inside the driver or cuBLAS, outside the source.
Mitigation tried:
--vram-reserve-later-mib 1265Same build and args, plus
--vram-reserve-later-mib 1265(the value the startup warning suggests), with--resident-budget-gibraised from 31.58 to 32.14 so that the experts dropped from the GPU caches still get a RAM copy.
2-6 MiB per long cold prompt, that is on the order of 100+ long prompts more than before.
read it as a measurable cost of the 310 fewer GPU experts.
(
generate.cpp:3800-3812,stage_room). The search sees 0.56 GiB less room on CUDA1 and moves one layer to CUDA0(K=23 -> 24). CUDA0's own expert cache, sized after the split, then has 0.29 GiB less free: -116 slots. CUDA1 loses
only 143 slots (not the ~275 the reserve alone would cost) because it no longer holds layer 23.
So for us,
--vram-reserve-later-mibis a workable mitigation. It delays the problem but does not stop the drop, and wealso restart the server on a schedule when free VRAM falls below 250 MiB.
Questions
--vram-reserve-later-mib(placement only,generate.cpp:3808) the intended mitigation?@Norhiro commented on GitHub (Oct 22, 2026):
Another data point for question 1 ("what happens when a later card fills"), on 0.2.2 (engine 0.1.47, CUDA, Linux), RTX 3060 12 GB + RTX 5060 Ti 16 GB, UD-Q4_K_XL,
layer_split: auto, default reserves: the start-up log saidCUDA1: 68 MiB of VRAM free with everything loaded - LOW ... add --vram-reserve-later-mib 1400. The verify windows captured on first use took CUDA1 from 68 to 10 MiB, and the next capture failed withverify: instantiate: out of memoryand the engine exited (exit code 1; onceprefill gemm: cublasGemmEx f16: cuBLAS status 14). It did this on every start (6 starts in 11 minutes), so on this pair a full later card ends the engine rather than stalling it.--vram-reserve-later-mib 1400fixed it here: 770 MiB free on CUDA1 after loading and no failed request in 10strata_bench.py --longruns (cold and warm, 5 split configurations). It cost 236 expert-cache slots on CUDA1 (K moved 18 → 19). Details and logs: #3702.@Niko1221 commented on GitHub (Oct 27, 2026):
Thank you. Fixed in 0.2.7: The private copy streams and events are handed back to a pool when a thread ends (#3350, #3470). We could check it with unit tests and builds, but not on your hardware or with your workload. Please try 0.2.7 and tell us how it goes.
Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7