mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2126] --batch hangs during startup on Linux/CUDA (3x RTX 3060, 0.1.43): 100% kernel time, GPU idle, the expert cache is never allocated #849
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#849
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 @nickycrc on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2126
Summary
Adding
--batch("parallel": 2or4) to a working config makesstrata servehang during startup, before the expert cache is allocated. Without--batchthe exact same config loads in ~6 minutes and serves normally.The hang is not I/O, not swap and not a plain RAM shortage: the host spins at 100% system time with the GPU completely idle (0%), and the kernel reports ~148k failed memory compactions.
stracecannot attach (container), but/proc/<pid>/statshowsutimefrozen whilestimeadvances 1000 ticks per 10 s.Environment
nvidia/cuda:13.0.0-devel-ubuntu24.04,--ulimit memlock=-1:-1,--shm-size 64mv0.1.43(src=e568e70371a3d2e0),CMAKE_CUDA_ARCHITECTURES=86, nvcc 13.0.48iq3_s_abl, 48 blocksConfig (the
argsarray, identical in every run below unless noted)plus
"gpu": [0,1,2],"layer_split": "16,32", and the variable under test"parallel": 2.Symptom
The log stops at exactly the same line every time, and never reaches the expert cache allocation:
grep -c "expert cache auto"on that log is 0. The next line in a successful (no--batch) start is:Measured while hung:
nvidia-smi: 0% utilisation on all three cards, VRAM frozen at 2578 / 2638 / 4034 MiB (a successful start reaches 11450 / 11354 / 11574 MiB)free: 6.9 GiB available, swap usage unchanged (1437 MiB) — so it is not swappingState: R (running),wchan=0,/proc/<pid>/syscall=runningon 20/20 samples/proc/<pid>/stat:utimefrozen (398),stime+1001 ticks per 10 s → 100% system timefutex_wait_queue/do_poll(normal)Kernel counters at the moment of the hang (
/proc/vmstat):/proc/meminfo:AnonPages 46953728 kB,Shmem 9353772 kB,Mlocked 27356 kB,MemAvailable 6089800 kB.So the host is repeatedly failing to obtain contiguous memory while the GPU sits idle.
What I ruled out (controlled, one variable at a time)
swapon --show)--vram-reserve-mib 700to 2000--batch 2and--batch 416,32, 3 GPUs) and 2 stages (20, 2 GPUs)--batchoff: all four configs load and serve fine (this is the config I run in production, 13 474 expert slots, hit rate 0.996-0.998, 50-57 tok/s decode).Possibly related
--batch 2. My working start-up reports exactly460 MiB of VRAM free with everything loaded, i.e. below that 500 MiB threshold. My hang is at start-up rather than during decode, but the VRAM-headroom figure matches.--batch/--batch-groupsproblems still open.docs/BATCHING.mdsays "Only a layer split of two stages on two GPUs has been run" - so a 3-stage split with--batchmay be untested territory.Notes
strace -pfrom the host fails withPTRACE_SEIZE: Operation not permitted(container isolation), so I could not capture the syscall. If there is a recommended way to trace inside the container, I can rerun and attach the output.--stats, debug env vars, a patched binary) on this machine - it reproduces 100% of the time and is otherwise idle.@xyzzing commented on GitHub (Oct 14, 2026):
A gfx1100 (RX 7900 XTX) data point on the gate this added, from a box that runs the 0.1.44.1 line as a daily driver.
The gate reads
free_huge_bytes()(order >= 9 in/proc/buddyinfo) at arena setup, before the arena is allocated — so on a restart it sees the state after the previous instance freed its memory, not the state while an engine runs. On this host (96 GB RAM, 46.84 GiB arena) that means the restrictive branch is essentially never taken:transparent huge pages requested (MADV_HUGEPAGE)transparent huge pages NOT requestedoccurs 0 times in the whole 75,438-line engine logusing 4 KB pageslines sit at log lines 215/263/308, from long-superseded versionsSo the scenario the gate is for is the one where something still holds the memory when the engine starts (an overlapping restart / a second engine), which matches the "wait for an engine that is still exiting" warnings that land in the log under exactly those conditions.
I also measured what the fallback costs, by forcing it with
STRATA_NO_ARENA_THP=1: steady state is unchanged at matched window mix (31.22/31.30 vs 31.17/31.26 ms per verify round, prefill 2154.1 vs 2150.0 tok/s), while startup wall time goes up about +8 s at 1K and +5 s at 128K. So the branch normally taken (THP) is the faster one and the 4 KB fallback is cheap insurance.Caveat, stated plainly: I did not reproduce the compaction stall itself on this box — free 2 MiB blocks at setup never drop below arena/2 here while still fitting the arena, so the condition is not reachable in a measurement window.
Full write-up, including the other new default-ON 0.1.44 path (
STRATA_COMMIT_BATCH): #2361@Brightfl commented on GitHub (Oct 17, 2026):
3x RTX 3060 12 GB on Windows/WDDM: the third stage fails with
CUDA1 free memory: out of memorywhile the same log reports 6.25 GiB free - reproduces on 0.1.43, 0.1.44.1 and 0.1.45Adding a data point from Windows (the report above is Linux/Docker, same card count).
Environment
probes read 0.8 GB/s on the x1 link (
CUDA2 link 0.8 GB/s -> miss cost x16.00) and 3.0 GB/s onthe x4 link, so the unusual link is priced in as usual - see the order-swap row below, which shows
the failure is not tied to that card.
"gpu": [0,2,1],--max-context 245760,--kv q4_0,--vram-reserve-mib 300,"parallel": 2Symptom.
strata servenever reachesready:. On 0.1.44.1 the split search even completes(
layer split auto: K=30,40 - the caches hold 14072 of 24576 profiled pairs (~97.7% of the routed mass), best of 1035 placements), every stage reports real room, and the next allocation fails:The engine contradicts itself two lines apart: 6.25 GiB free -> 0.00 GiB free.
What does not move the number (shortfall stays ~790-831 MiB in every case):
--max-contextparallelremoved)--prefill--vram-reserve-mib[0,2,1]->[1,0,2][1,0,2]the x1 card becomes CUDA0 and CUDA1 is the x16 card, same errorlayer_splitauto-> explicit20,24SeLockMemoryPrivilegegrantedlarge pages refused ... VirtualAlloc error 1314; using 4 KB pagestolarge pages are resident without a lock, failure identicalShortfall by engine: 0.1.43 ~ 790 MiB, 0.1.44.1 ~ 796 MiB, 0.1.45 ~ 831 MiB.
Two cards are fine, same model and flags,
"gpu": [0,2]:ready:in 34-37 s, 36.6 tok/s singlerequest, 19.6 + 21.0 tok/s with two requests in flight. So the model, the config and the disks are
healthy; only the three-stage split fails.
Questions
across adapters?), or is the middle stage's expert-cache allocation a bug?
STRATA_ARENA_PIN_GIB,--vram-elastic, an explicit per-device--expert-cache-device1/2/3,--split-skip-if-fits,--trim-stage-weights?@Adamyno commented on GitHub (Oct 17, 2026):
3× RTX 2080 Ti, native Linux, v0.1.45:
--batch 4starts normallyCounter-data point for the startup hang: on this 3-card Turing rig the
--batchpath does not hang, and it goes past the line where your run stops.Hardware: 3× RTX 2080 Ti 22 GB (sm_75), i9-7980XE, 125.5 GiB RAM, native Linux 7.0.0-38 (not a container), driver 580.178.04, CUDA 13.0.
Config: v0.1.45 (
477ac13c), Flash-Next UD-Q4_K_XL (packud-q4_k_xl), 262,144 ctx,--kv int8 --spec 3 --spec-min-p 0.54 --batch 4,"layer_split": "16,32",--expert-cache auto --trim-stage-weights.The log reaches and passes your stopping line:
The server was ready in 133 s (model load included), no 100% system time, GPU active during the load. So the hang is not inherent to
--batchon three CUDA cards; the remaining candidates are the container's--shm-size 64m/ memlock setup, the 62 GiB RAM with a 48-block IQ3_S pack, or the older 0.1.43 build (ours is 0.1.45).@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.