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#543
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 @btc1000w on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1341
Summary
On engine 0.1.40 (server 0.1.40.1) with a dual-GPU layer split, a prompt of about 120k tokens hangs while "reading the prompt". The engine's own #29 watchdog fires after 60 s, writes a stall dump, and aborts the engine; the server then reloads the model (about 2 minutes) and the request fails. Setting
--pipeline-windows 0makes the same long cold reads pass.The hang is in the pipelined verify-window prompt reader (
read_windows_pl), which is only used when--pipeline-windows >= 1. The engine prints noillegal memory accessin this reproduction.Environment
82f46a8), Windows 11, CUDA 13.0 release build, compute capability 8.6--pack ... --native ... --ple-gguf ... --expert-profile ... --expert-cache auto --prefill auto:32768 --spec 4 --spec-min-p 0.70 --mtp ... --max-context 262144 --kv int8 --kv-resident 32768 --vision --vram-reserve-mib 690 --pool-workers 8 --trim-stage-weights --pipeline-windows 2 --layer-split 26Observed
Production, same config: a request with a 129,038-token prompt failed (finish=error, 0 output tokens) and the server reloaded the engine. Earlier the same day a 107,882-token prompt ended with
prefill copy_i32: an illegal memory access was encountered(the sticky-label class) plus the #29 watchdog, in the batched reader (stage "reading the prompt (batched): layer 27 of the prompt chunk from token 107882").Reproduced 2/2 with a cold ~120,000-token prompt (a fresh, uncached prompt; nothing reused):
The second run was identical (
for 56 s, dumpstrata-stall-22140.dmp). The prompt read rate was normal before the hang (120k tokens in about 95 s, ~1260 tok/s), so it is not a slow-read timeout.Note the expert pool line: 0 of 0 jobs claimed -> no prefill job is running at all; the reader is parked waiting on something that is never signalled, not merely slow.
Instrumentation: the two reproduction runs set
CUDA_LAUNCH_BLOCKING=1andSTRATA_PF_STEP_SYNC=1to localise the stage. The production failures ran with the same config and no instrumentation. Launch blocking normally makes races less likely, which points to a deterministic missing-signal deadlock rather than a timing race.Suspected cause
The stage label
reading the prompt (pipelined verify windows)is emitted only fromread_windows_pl(src/program/generate.cpp:8521; the label is at :8522). That reader is selected only when--pipeline-windows >= 1:with
int pl_pw = pipe ? o.pipeline_windows : 0;(generate.cpp:8494). So the deadlock is in the overlapped cross-stage verify-window prompt read. The engine does not report an illegal access in this reproduction, so theprefill copy_i32label seen in production is the stickycudaGetLastError()mis-attribution (see src/kernels/cuda/qsa.cu:77) rather than the actual faulting kernel.The earlier production signature (batched reader, layer 27) may be a sibling manifestation of the same verify-window handshake; I could not attribute it separately.
Workaround (verified)
--pipeline-windows 0: 3/3 cold long reads pass, no fault, no stall, no reload:(all genuinely cold;
--prefill auto:32768unchanged). Before the change: 2/2 cold ~120k reads stalled.Trade-off: this gives up the ~+16-21% decode and ~129 MiB of headroom that
--pipeline-windowsprovides (docs/MULTI_GPU.md).Dumps
strata-stall-16932.dmp,strata-stall-22140.dmp(this reproduction),strata-stall-23716.dmp(production, batched path, layer 27 / token 107882). Happy to attach any of them.Related
@btc1000w commented on GitHub (Oct 7, 2026):
Follow-up: a middle path that keeps the decode overlap AND avoids the deadlock
STRATA_LOGPOSalready gates the pipelined reader, so the overlap can be kept while the long prompt read goes through the serial path.From
src/program/generate.cpp:With
STRATA_LOGPOSset, the prompt read falls back to the serialread_windowspath (the same one--pipeline-windows 0uses). The decode overlap is decided independently:and
pl_snap2is allocated fromo.pipeline_windows >= 2(generate.cpp:6215), not from how the prompt was read. The only other use of the variable is the logprob hook:If
fopenfails,logpos == nullptrand the whole hook is skipped (no I/O, no cost). Pointing it at a path that does not exist therefore disables the pipelined prompt reader with zero overhead.Config used
Measured on the affected machine (2x RTX Laptop, Qwen3.8-Flash-Next IQ3_XXS, 262144 context, sm_86, CUDA 13.0, engine 0.1.40,
--layer-split 26):--pipeline-windows 0--pipeline-windows 2--pipeline-windows 2+STRATA_LOGPOSThe cold rounds were 121,026 / 126,025 / 131,025 prompt tokens with
cached_tokens: 0(a fresh nonce was prefixed each round so the prefix cache always missed); round 1 is the exact prompt that deadlocked 2/2 withoutSTRATA_LOGPOS. Zero fault/restart lines in the engine log across the 3/3 run, and the prefill rate was unchanged (1887 tok/s at 121k, 1841 tok/s at 126k).Decode numbers are 5-round means from one harness (temperature 0,
max_tokens 800, both prompts warmed first withmax_tokens 8so the prefill is not measured). Round-to-round spread is wide and the 64K difference between pw2 and pw2+LOGPOS is inside that noise band; the 1K result is clearly above pw0.So setting
STRATA_LOGPOSto an unopenable path keeps--pipeline-windows 2for decode while routing the long prompt read through the serial path, which avoids the verify-window handshake deadlock. This is a workaround for operators, not a fix for the deadlock inread_windows_plitself.@ischencheng commented on GitHub (Oct 7, 2026):
@btc1000w the two reproduction runs had CUDA_LAUNCH_BLOCKING=1, and that alone hangs the first verify window after any prompt: the launch waits for the graph, which waits for the host. On two L40S it hangs the same way with --pipeline-windows 0, and without it a cold 120k prompt reads fine with 0 and 2; #1383 makes the engine say so at start.
@Niko1221 commented on GitHub (Oct 8, 2026):
Thanks @btc1000w for the report and the middle-path note. #1383 (@ischencheng) found that
CUDA_LAUNCH_BLOCKING=1alone hangs every verify window: the window's graph waits for flags the host raises aftercudaGraphLaunchreturns, and a blocking launch returns only when the graph is done. It is in 0.1.41 with the author's credit: the engine says so at start, and the #29 stall line names the variable. We reproduced it on an RTX 3060 (a 2,400-token prompt, one GPU, no layer split): the engine stops after 60 s, the start line and the stall line both nameCUDA_LAUNCH_BLOCKING=1.What we could not reproduce:
--pipeline-windowsis off on one GPU (it needs a layer split on two), so the pipelined reader itself did not run on our boxes, and the two failures you saw without the variable (the 129k request that ended with an error, and the 107kprefill copy_i32illegal access in the batched reader) are still open. Could you run one cold 120k prompt on 0.1.41 withCUDA_LAUNCH_BLOCKINGandSTRATA_PF_STEP_SYNCunset, and attach the stall dump and the engine log if it still stalls?@krzysztofkuczek commented on GitHub (Oct 9, 2026):
strata-stall-21176.dmp
Another data point on 0.1.41 — same stall shape in the pipelined prompt path, but with a different trigger on the host side (memory pressure, not
CUDA_LAUNCH_BLOCKING), and this time the engine stayed up with the slot busy instead of aborting.Environment
--trim-stage-weights --pipeline-windows 2--max-context 196608 --kv int8(full VRAM),--vision(encoder on a third, idle GPU),--pcie-frac 0.00, 11 CPU pool workersCUDA_LAUNCH_BLOCKINGanywhereWhat happened
Long agent session (the client resends a ~101k-token context every request). A request with a 101,016-token prompt was in flight when the engine stopped making progress; no engine log lines for ~50 minutes. The stall detector then wrote:
Notable details:
/healthok,/slotskept reportingis_processing: true, n_prompt_tokens: 101016for the whole window. The request never finished and the slot never drained until we intervened client-side.nvidia-smisampled GPU0 at a sustained 100% with GPU2 at 0% (three samples 5 s apart), while Windows Task Manager showed ~0% — consistent with a wait kernel burning SM occupancy while waiting for host-raised flags.Questions this raises for us
CUDA_LAUNCH_BLOCKINGmechanism #1383 explained (the host raises flags aftercudaGraphLaunchreturns, and a thrashing host is arbitrarily late)?Artifacts
strata-stall-21176.dmp— the engine-written thread stacks from this stall (attaching via the web UI; ~360 KB)strata-stall-28796.dmp/strata-stall-30228.dmp(Oct 6, engine 0.1.40, before any report of this class) andstrata-stall-18640.dmp(Oct 6 evening) /strata-stall-27496.dmp(Oct 9 morning, 0.1.41) — so the machine has produced five in four days, always in long-context agent sessions. Happy to attach whichever are useful.Not yet tested
The
--pipeline-windows 0/STRATA_LOGPOSserial-reader fallback on this exact workload; we can run the A/B on demand if it would help pin the reader.@CC-David-CC commented on GitHub (Oct 13, 2026):
btc1000w
https://github.com/Niko1221/Strata/pull/2209
let me know if that worked for you. i spent much longer than i am happy with on this
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.