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#113
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 @qin428 on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/217
Symptom
Engine stalls during batched prompt ingestion (the prompt-reading path, before any token is generated) on the very first request of a fresh server. The stall signature matches the family of issue #31 but the trigger phase is different. It survives the v0.1.14 fix and the v0.1.25 prompt-path rework. PR #205 does not address it either (see "What I already tried" below).
The 60-second watchdog (issue #29) catches it, prints a stall report, and restarts the engine — same recovery as #31. So the engine survives, but the request is lost and the user sees a 503.
Reproduction
A 200-token user message in my tests reproducibly stalls. The stall does not depend on:
Stall report (engine 0.1.27, first request)
wrote the thread stacks to ...\strata-stall-35908.dmp(PID 35908 was the engine at the time).The same stall is reproducible at slightly different positions on different runs —
done up to token 99,… 127,… 133,… 139all observed within an hour. The signature (served/plan/copies flags all 0, GPU rang 1, host idle 60+ s) is identical across runs.Environment
v0.1.27release, SHA256cbb44dd8…5200b839)a790805Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf(native IQ2_XS pack)expert cache autoshrank from 6886 (0 MiB free)pcie_frac 0.27What this is not
reading the prompt (batched), before any token is produced. The "GPU rang N, copies (B) N-1" pattern from #31 is not seen here either — herecopies (B) 0.errrace. #205 needs a previous request to have been cancelled mid-prompt. This stall fires on the first request of a fresh engine, with no prior traffic.What I already tried
PUT … 0.1.14fix). Stall unchanged.err.clear()at three points insrc/prefill/prefill.cppandsrc/program/generate.cpp). Rebuilt the engine locally with VS 2022 + CUDA 13 + ninja; re-ran. Stall unchanged.session is up (engine 0.1.27), andengine/strata.exeis 32 MiB (locally built) rather than 104 MiB (release binary).Thread-stack dumps
strata-stall-35908.dmp— first request after fresh engine (token 99)strata-stall-26880.dmp— second request on the restarted engine (token 139)strata-stall-36940.dmp— earlier 0.1.27 capture (token 133, before PR #205 patch)strata-stall-23928.dmp,strata-stall-32064.dmp— earlier 0.1.24 captures for contextHappy to attach the .dmp files and the matching symbols (
strata-windows-x64-symbols.zipfor 0.1.27) if helpful — say the word and I'll attach.Suspected surface (analogy to #31, but on the prompt path)
The flag pattern
served 0, plan (A) 0, copies (B) 0plusthe GPU rang 1plus host idle looks like the same family of bug as #31 — host is waiting on a GPU-side step whose ring has already fired — but on the batched prompt prefill code path rather than the verify window of the generation loop. The 0.1.14 fix replaced the generation-pathcudaMemcpyAsyncDMA copy with a GPU kernel copy (--pcie-mode kerneldefault). If the prompt-reading path also issues acudaMemcpyAsyncfrom inside the verify window before flagging plan/copies, the same--pcie-mode kernelworkaround may be available there as an interim mitigation.I have not yet tested
--pcie-mode kernelon the prompt path — happy to, if it would help.Ask
Is the prompt-reading batched prefill path known to have the same
cudaMemcpyAsync+ driver-lock deadlock as the generation path in #31? If so, is the same kernel-copy workaround applicable, or does it need a separate fix?strata-stall-36940.dmp
strata-swift-iq2_xs.log
strata-stall-26880.dmp
strata-stall-35908.dmp
@Niko1221 commented on GitHub (Sep 30, 2026):
Thanks for the log. The stall is in the verify window that reads the last few prompt tokens after the batched part, not in the batched part itself. The stage label was stale; 0.1.28 fixes it. Your log shows 0 MiB of VRAM free, which is the paging stall that 0.1.27's larger draft head causes (#199); 0.1.28 fixes that too. Until then, add
"--vram-reserve-mib", "1100"to theargsof yourstrata-<model>.json(or pass--vram-reserve-mib 1100to the engine). If it still stalls, please attach the log.@Niko1221 commented on GitHub (Sep 30, 2026):
0.1.28 fixes the VRAM cause (#199) and the stale stage label (the verify-window part of the prompt now has its own). Closing; please reopen with the log if the first request still stalls after updating.
@qianchong666 commented on GitHub (Sep 30, 2026):
Update on this box: raising the reserve until 1668 MiB of VRAM are free does not stop the stall, the single live thread sits inside
nvcuda64.dll, and the GPU spins at 100% utilisation with ~0% memory bandwidth.Thanks for the replies. Taking your correction first: the stall is in the verify window that reads the last few prompt tokens, not in the batched part — my logs agree (
verify window: 4 tokens at position 211, host at layer step 1; the GPU rang 1; flags: served 0, plan (A) 0, copies (B) 0), and I am treating the stage label as the stale one.Because the fix rationale is the paging stall of #199, here is what this machine does with the reserve already raised, and what the minidumps and the GPUs show.
Environment: Windows 10 19045, i5-14600K (no AVX-512, so the i-quant rows run on the AVX-2 path), 2 × RTX 3090 — one driving the display with a 256 MiB BAR1, one headless with a 32 GiB BAR1 — 128 GB RAM, driver 610.62, engine 0.1.27, IQ3_XXS native (IQ) pack from the official
ISTA-DASLabGGUF,--prefill auto→ 8192,--spec 4.1. It is not the reserve. I had already run these before your second reply:
strata servereports--vram-reserve-mib 2048expert cache auto: 17.42 GiB free, 2048 MiB reserved -> 7108 slots)--prefill 512 --vram-reserve-mib 15361536 MiB reserved -> 7338 slots)--prefill 1024,--expert-cache 8192,--kv-resident 8192, layer split removedAll of them print a byte-identical stall report (60/61 s, same window, same position 211). Since 1100 MiB is less reserve than the 1536/2048 MiB runs above, the reserve remedy is covered a fortiori on this box.
2. The signature is stable (dual card, single card, with and without the layer split):
3. Where the threads actually are. The engine writes
strata-stall-*.dmpminidumps; I parsed the 30 of them from today (08:00–18:09) across every configuration I tried:ntdll.dll— no engine kernel, no pool worker, nothing of mine is running;nvcuda64.dll: dominant offset+0x39b713(13+ dumps), also+0x2ed8fb,+0x39b75d,+0x2ed640/+0x2ed7ac/+0x2ed8cd,+0x2ee060/+0x2ee093,+0x344e90/+0x344f07,+0xd6ac9. Never insidestrata.exe.That is the place your #31 analysis pointed at (host stuck in a driver call inside
nvcuda64), one phase earlier — and withcopies (B) 0, i.e. the copies that would raise the flags were never issued. Attribution from the driver's export table is useless at these offsets (nearest export iscuProfilerStop+ 0xf2243), so a symbolized stack from your side would nail the exact engine-side caller.4. What the GPUs do during the stall (
nvidia-smi, sampled every 4 s):This is your #31 wording almost verbatim ("the GPU spins on the flags those copies raise … while the host is stuck in the driver"), one phase earlier.
5. It is not TDR either. Windows' TDR was set to a non-default 60 s on this box; I restored it to the system default (no
Tdr*values underGraphicsDrivers) and re-ran the exact single-request scenario: same window, same position 211, same exit code 3221226505, and zero 4101/4102 (TDR recovery) events. The driver never judges the GPU unresponsive, because the spinning kernel keeps the card at full clock — so the timeout path is not the lever here.6. Corroboration in the display-driver log.
nvlddmkmevent ID 153 (\Device\Video36,Error occurred on GPUID: 200) appears 73 times over the two days I have been testing, roughly 90 s apart (about one per engine cycle). Its timestamp lands within a second of the engine being killed and its CUDA context torn down — 18:09:09 event vs 18:09:10 request failure — not during the spin. Reading: a record of a context destroyed with an unfinished kernel, i.e. a symptom of this stall rather than a driver fault of its own.7. Nothing in the prompt path can be switched off to isolate it. A native (IQ) pack refuses to start without speculation —
— and there is no runnable engine version on this PC: 0.1.23 and 0.1.24 both load this pack and stall at the same verify window, while 0.1.25+ reject it for an unrelated reason (
native dense: incompatible matrix blk.1.ple_key.weight).8. What I am doing next. Updating this box to 0.1.28 now and will report the log either way. If the verify-window path itself changed in 0.1.28 beyond the cache sizing, tell me and I will run exactly that scenario. Available on request: the 30 minidumps, the minidump thread-stack parser, the per-config engine logs and
nvidia-smitraces, and the TDR before/after registry record.@qianchong666 commented on GitHub (Sep 30, 2026):
0.1.28 still stalls on this box — same window, same exit code, and the reserve is not the cause. Log you asked for below.
I updated this same tree to the official 0.1.28 Windows build (
BUILD.json: version 0.1.28, cuda 13.0) and re-ran the identical single-request scenario: official config, no extra flags, TDR at the Windows default, one engine instance.The load side is fixed.
session is upafter 18 s (0.1.27: 210 s from cold cache).The first request still stalls, identically:
HTTP side:
the engine stopped unexpectedly (exit code 3221226505)after 67.4 s. Free VRAM with everything loaded: 394 MiB; the engine itself logsverify: window up to 6 tokens, 69.6 MiB of device buffers.So the stall is unchanged while the reserve goes from 394 MiB (above) to 1668 MiB (
--vram-reserve-mib 2048, previous comment) — same window, same flags, same code.New minidump, 0.1.28 (
strata-stall-35296.dmp, written at the kill): 34 threads, all 34 parked in ntdll wait primitives —ntdll.dll+0xa0fd4×22,+0xa1034×3,+0x9d624×3,+0x9e0f4×2,+0x9d664,+0x9f3f4(NtWaitForSingleObject family), none inside strata.exe.For comparison, the 0.1.27 dumps from the same scenario: 31 in ntdll + 1 with RIP inside
nvcuda64.dll(+0x2ed8fb; earlier runs+0x39b713). Either way no host thread is doing engine work — the host is parked and the card spins.GPU during the whole 61 s: 100% utilisation, 0% memory-busy, 1935 MHz, 143.9 W (second card idle: 210 MHz, 42 W). A kernel burning cycles on a flag without moving a byte.
Driver log: one more nvlddmkm event ID 153 (
\Device\Video36, GPUID 200) exactly when the engine was killed and its CUDA context torn down; still no 4101/4102 — the driver never treated the card as unresponsive, because it never timed out: it is at full clock, just not producing.What would help from your side:
the GPU rang 1whileserved 0, plan (A) 0, copies (B) 0, which reads like the window never got planned, or its completion never arrived, and the host (34 threads) is parked waiting for it.The box is fully reproducible and much faster to iterate on now: ~18 s to load, ~70 s to the stall. I am happy to run any instrumented build, a debug dump with symbols, or a specific probe you want — just say which build and which knob, and I will run it here and post the raw log.
Thanks for the load-side fix, it is a real improvement here.
@qianchong666 commented on GitHub (Sep 30, 2026):
Small addendum: I cannot reopen this issue myself (no triage rights on this repo). Could you reopen it, or tell me where you would like this tracked? The 0.1.28 reproduction above re-runs on demand here.