mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2049] Deterministic deadlock at the completion handshake after the last block: host at layer step 48 with the GPU already rang - 5/5 stalls identical, on 0.1.41 and 0.1.43 (RTX 4080 / Windows / IQ3_XXS native pack / 256K) #818
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#818
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 @gaoyonghui123 on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2049
Summary
The
STRATA_WATCHDOG_Swatchdog (#29) fires every time, because the request makes no host-side progress for the full 60 s. But the stall is not slow I/O, not memory pressure and not a version regression. All five occurrences freeze at exactly the same point - the handshake after the model's last block:This model has 48 blocks (
blk.0..blk.47in the pack'sindex.txt), solayer step 48is one past the last layer. At that moment:served 48, plan (A) 48, copies (B) 48)epoch == batch epoch)parked/sleepingThe whole forward pass has completed on the device and the host simply never gets past step 48.
Not a 0.1.43 regression
Identical signature in all five, across two releases. Downgrading does not help - 0.1.41 shows it three times.
On Windows the manifestation is Application Error 1000 on
strata.exe, exception0xc0000409(the report code forabort()/__fastfail), same faulting offset0x52f519in both 0.1.43 occurrences.Ruled out
no step finished for %d s, but the file tier is still being readbranch never fired -grep -c "no step finished"is 0 across the whole log, soSTRATA_WATCHDOG_IO_Sis not involved.committedis 56,158-57,912 MiB against a 63.2 GiB guard with 16,150-19,527 MiB still available;residentactually fell from 30.3 GiB (occurrence 4) to 16.8 GiB (occurrence 5).non-finite logitsnever appears in the log.Environment
No non-default value the watchdog could be sensitive to; this is the documented 256K configuration.
Reproducibility
Every occurrence needs a long session. Short A/B segments (a few minutes each) never hit it. On 0.1.43 the first appeared ~25 min into a session and the second 8 min after the automatic restart. The trigger therefore looks tied to long sessions at large context positions (88K-183K) rather than to any single request shape.
Related
stage "decode -1"). Ours freezes atstage "request -1", and the new information here is that the site is deterministic and identical across versions.strata-stall-<pid>.dmpfiles, and one text file with all five stall reports.Attachments
E:\AI\Strata\strata-stall-13600.dmp(359,712 B)E:\AI\Strata\strata-stall-22336.dmp(355,289 B)E:\AI\Strata\strata-stall-23088.dmp(355,289 B)E:\AI\Strata\strata-stall-27724.dmp(357,605 B)E:\AI\Strata\strata-stall-30728.dmp(362,028 B)_issue_strata_stall_excerpt.txt- all five stall reports in one filestrata-stall-13600.dmp
strata-stall-22336.dmp
strata-stall-23088.dmp
strata-stall-27724.dmp
strata-stall-30728.dmp
_issue_strata_stall_excerpt.txt
@tangdaibin commented on GitHub (Oct 12, 2026):
Same signature, but on AMD/ROCm — and it takes the whole host down
Adding a data point from a different vendor, since every other occurrence in #2049 and
#2065 that I could find is NVIDIA. Here the stall is reproduced on gfx1100 (RX 7900
XTX) / ROCm 10.0 / HIP 7.15, and the consequence is worse: the machine hard-freezes.
My stall report is structurally identical to the ones in #2049:
36 of 36 jobs claimed, 36 donewith11 workers parkedandhost at layer step 48is the same shape as the
18 of 18 jobs claimed, 18 done/5 workers parkedcasehere. Same "the forward pass finished on the device and the host never gets past the
last block" reading. The model here is Qwen3.8-Flash-Next IQ3_S, engine 0.1.41.
Three things that differ from the reports above
1. It is not specific to NVIDIA. ROCm 10.0, HIP 7.15, gfx1100, same stall, same
layer step 48completion handshake. If the fix lands in the host/driver interaction,it should cover this path too — which is also a useful test that the fix is in the right
place.
2. The host then hard-freezes; it does not recover. After the watchdog aborts the
engine, the server auto-restarts it (
ensure_loaded()), which issues a large amount ofGPU work against a device that never came back. The kernel then loses the SMU:
amdgpu's reset path cannot recover it and the machine needs a power cycle — no SSH, no
console. This happened twice on this box. I have now armed a hardware watchdog
(
sp5100_tco, 60 s) so it resets itself, but that only limits the damage, it does notstop the failure.
The engine's automatic restart looks like an aggravator here: it keeps driving a dead
device. Would it be reasonable for the stall path to probe whether the GPU is still
responsive before letting the server restart the engine onto it? On Linux that could be
a small
hipMemcpy/rocm-smipoll. Failing that, at least not auto-restarting after ahost-side stall would keep the failure at "engine unavailable" instead of "machine
gone".
3. It triggers at a lower context position. Your five occurrences are at 88K-183K.
Mine fired at position 64,173, and roughly 1 in 15 requests in the 60K-70K band hit
it; requests below ~30K never have on this machine. So on this card/vend combination it
is both easier to reach and more frequent than the NVIDIA reports suggest.
VRAM headroom
For what it is worth, this lands very close to the ~500 MiB threshold in #2065. My startup
left
592 MiB of VRAM free with everything loaded(this was before I fixed a bug in myown wrapper that had been silently dropping
--vram-reserve-mib; it is confirmed in thecommand line now). I have not captured per-window VRAM lines during the stall itself, so
I cannot say whether it was declining the way yours did.
Config
Not ruling anything out on my side beyond the obvious:
0 of 37threads in D state,0 MiB in swap, 64 GB RAM available, no disk stall. Reproduced twice, on two differentdays, both times after a long session.
Happy to collect a thread dump or extra counters if that would help — I can run
strataundergdbif needed.@Niko1221 commented on GitHub (Oct 12, 2026):
Thank you for the five dumps and the table: they made this readable. The short version: it is not a deadlock after layer 48, and the cause is on the host side, in the memory the engine parks between conversations.
What the report line really says.
verify window (last window, not the current stage): ... host at layer step 48; the GPU rang 48is the previous request's last window, which finished normally (48 is just its end state). The stage that stalled isrequest -1, so nothing was waiting for a GPU handshake. I read your dumps against the v0.1.41 and v0.1.43 release strata.exe (same instruction in all five): the main thread is inside a host memcpy, called from the copy of the parked conversation's running checkpoints (conversation_snapshot_save, run when a request switches conversation). The expert pool and the GPU are idle because nothing is asking them for anything.Why it takes more than 60 s. Your reports show 8-30 GB resident against 56-58 GB committed, and about 190 page faults a second between the two samples. Those checkpoints were written tens of minutes earlier; with 64 GB,
--resident-budget-gib 40, mmap-experts and an 8 GiB conversation cache, Windows has trimmed them out of the working set, and copying them back is one pagefile read per 4 KiB page, under 1 MB/s. The I/O allowance of the watchdog (#1407) missed it because it counted page faults / 64 (3 a second here, it needs 16). That is whyno step finishednever printed and why 0.1.41 and 0.1.43 behave the same. I could not reproduce the paging itself (no Windows box with that pressure), but I could reproduce the watchdog part on Linux: with the parked copy made slow, the old code stops the engine at the limit withrequest -1and the same report, and the fixed code finishes the park.What changed on the fix branch (not released yet): the park is named in the stage (
request: parking the previous conversation), its copies tell the watchdog they are moving, and on Windows page faults count 8x more as file-tier activity. So a slow park finishes instead of being aborted. The park itself is still as slow as your pagefile, so the real cure is memory: could you try a smaller--resident-budget-gib(30 instead of 40) and/or--conversation-cache-mib 4096, and check that the pagefile is on an SSD? It would help to see theconversation cache: parked N tokens in X mslines of a run (from the log), and the pagefile size/location. If the park lines say several minutes, that confirms it.@hejm2000 commented on GitHub (Oct 13, 2026):
Same signature on our side — single-GPU Linux/Docker, and the host-side conversation-snapshot mechanism fits our setup unusually well. Data point:
Environment
--max-context 131072 --kv int8, spec/MTP on (live/metrics:spec=6, spec_min_p=0.50, mtp_max=4), expert-cache auto. No--pipeline-windows(single card, so presumably the serial reader path — i.e. this is #1341's symptom without #1341's mechanism).serving: 1), so requests switch between conversations frequently, and the deep ones carry ~100k-token histories.Symptom
Three engine aborts on 2026-10-12 at 14:30:43 / 16:50:04 / 17:06:19 CST (UTC+8), each logged client-side as
the engine stopped unexpectedly (exit code -6)— consistent with the #29 watchdog self-stop. Each time the server reloaded the model (~1.5–2 min), the KV/prefix cache was gone, so the next request re-read the same large prompt entirely from cold and stalled again — the 16:50 and 17:06 aborts are that cascade, 16 minutes apart.Prompt-depth correlation
prompt = 97,403tokens; a request that day carriedprompt = 102,714Host-side pressure (points at your
conversation_snapshot_savereading)vram_free_mib = 405right now — under the ~500 MiB floor from #2065 as wellQuestions
--max-contextthe practical way to bound it?We can run a controlled reproduction (fixed multi-conversation pattern driving prompt depth through the 90k–105k band) and attach whatever captures you want.
@beastrobin commented on GitHub (Oct 13, 2026):
Same watchdog family on an RTX PRO 6000 Blackwell — but every hang here sat in the prompt-read stage, and none recurred after 0.1.41. Attaching what we still have (log text only, see caveat at the end).
Machine / build: Windows 11 build 26200 · RTX PRO 6000 Blackwell Workstation Edition 96 GB (sm_120) · Flash-Next IQ3_S native pack, all experts VRAM-resident (
expert_slots 24576, hit 100%, zero-doorbell graph) · engine flags of the era:--max-context 262144 --kv int8 --spec 4 --mtp rt --lookup-chain 4 --batch-mtp --pool-workers 15 --batch 2.The retained server log covers 2026-10-07 → 2026-10-13 (the upgrades through it): 36 stall reports, all emitted by engine 0.1.40. Every one is identical in shape and differs from this issue's signature:
reading the prompt (batched), done up to token Nfor 60 s — i.e. mid-prefill, right after a linestrata verify: captured the batch window over slots 0;epoch 0: 0 of 0 jobs claimed, 0 done; 15 of 15 workers sleeping;host at layer step 1; the GPU rang 1), never the step-48 value of your decode-handshake signature.no progress for 60 s ... - stopping the engine so the server starts it again (issue #29)→ engine restart, next request re-reads the prompt.Verbatim first cluster (line ~1984):
Regression observation from this box: after upgrading past 0.1.40 (now 0.1.43.1), zero stall reports — across Oct 8 → today, including ~10 restarts and several full
strata_bench --longsuites today plus concurrent multi-slot use. So if this is one bug family, something between .40 and .41 may already have closed this variant on Blackwell; the decode-handshake variant you document on the 4080 still reproduces there on 0.1.43, per your report. Happy to run a targeted repro (fixed seed prompt >50k tokens,--batch-mtp, batched prefill with parallel slot activity) against whatever build you want probed next.Caveat on attachments: the engine did write
D:\AI\Strata\strata-stall-<pid>.dmpfor each event at the time, but those files were deleted during later disk cleanup before I saw this issue — nothing left to attach. If thread-stack dumps are strictly needed I can try to reproduce on 0.1.40 binaries kept here (engine/archives), though they may not be installed anymore.@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks @hejm2000, that fits the park reading, and you are on 0.1.41. The fix for this path is in 0.1.43.1 (released 2026-10-12). Parking a conversation names its stage ("request: parking the previous conversation"), its copies report progress to the watchdog, and the stall report says how little VRAM is free. So a slow park finishes instead of being stopped at 60 s.
Your questions:
--conversation-cache-mib(fewer parked bytes; 0 turns parking off, and a switch then reads the prompt again),--conversation-cache-min-free-mib(it stops parking below that much free RAM; default 2560), and--prompt-cache N(fewer checkpoints per conversation). With RAM at 96% the first two matter most.strata-<model>.log, inside the container). Mounting that folder out of the container is enough. The thread-stack dump is a Windows-only extra.Please retry on 0.1.43.1 (or 0.1.44) with the same multi-conversation pattern. If it still stops, the stall report's stage line will now say whether it is the park.
@gaoyonghui123 commented on GitHub (Oct 14, 2026):
Thanks @hejm2000 — and thanks @Niko1221 for the park explanation. We are the original five-dump report at the top of this thread; here is what our raw logs add to the two answers already given.
1. On "a 100K conversation costs about 5x a 20K one" — on snapshot bytes we measure about 2.3x, and the worst park is not the largest conversation.
We have 416
parked N tokens in X msrecords across all our runs:Two readings:
Pearson r between tokens and park time is only +0.360 (n=416) — size explains ~13% of the variance. On
snapshot_bytes(n=292) a linear fit gives ≈654 MiB + 15.9 KiB × tokens (median residual 74 MiB, worst 691 MiB), i.e. 2.1 GiB at 100K vs 0.94 GiB at 20K — about 2.3x, because of a large fixed floor. That matches the paging reading: the cost is whether those pages are still resident, not how many bytes the snapshot holds.2. Two checkpoint knobs the reply did not list (from
--helpon 0.1.43.1; both left at default on our box):@hejm2000: the default
6is visible in our request tail as the recurring..., 6 checkpoints, so if you want to cut park volume,--prompt-cacheis a second lever next to--conversation-cache-mib. Note ours are unset — this is a reading of the defaults, not an A/B.3. Worth separating from this issue: the prefix-cache miss is a different problem. With several live sessions multiplexed onto one engine, switching away and back changes the prompt shape, so the prefix misses and the whole history is re-read cold — we measured
cached_tokensdropping from 101,877 / 102,132 (99.8%) to 17,408 / 107,101 (16.3%) across one switch, i.e. 89,693 tokens re-read in 51.4 s. In our case that was the client re-injecting a context block at the front ofmessages[1]. The #2049 park path is what 0.1.43.1 fixed; this one is not the same thing.4. Status on our side: we went 0.1.41 → 0.1.43.1 → 0.1.44.1 (today). On 0.1.43.1 the engine log shows 2,690 lines / 3 sessions / 5 conversation switches with zero stall reports, versus 5 stalls (0.1.41 ×3, 0.1.43 ×2) before, and the worst park dropped from 14,216 ms to 1,437 ms in that window. We are not calling that "park got faster" — as you said, the park itself is still as slow as the pagefile — we are calling it "it no longer gets killed at 60 s". A longer soak is still pending on our side.
Happy to paste the raw
parked ... in ... mslines if useful.