mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5426] [Engine] decode stall: the CPU lane waits for a request the mailbox has already overwritten (seq - next == kRing) #3247
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#3247
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 @dingyiyuan on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5426
Problem
Long decode sessions in the DeepSeek-V4.1 engine stall permanently: throughput falls from
15-22 tok/s to 0.15 tok/s and never recovers, with no error line and no crash.
The thread states during a stall: 60 threads in
futex_do_wait, one thread spinning, CPU 97%idle, 0 MiB/s disk reads, VRAM unchanged. The engine is waiting for something that will never
be set.
Environment
sycl/src/dsv41/ds4_model.dp.cpp), not the CUDA path insrc/dsv41/--vram-experts 0.75and1.0;--dsparkbothonandoffReproduce
Deterministic with a slow CPU lane plus replaying a long session without restarting:
Without
--cpu-threads 1it is intermittent, roughly one stall every 4-8 long sessions of15-25 requests each.
Expected
Every request is answered; decode keeps running.
Actual
The lane reports waiting for a request number that the mailbox slot no longer holds:
70 - 6 = 64 = kRing. The device has published exactly one full ring past the lane's readposition and overwritten the slot the lane has not read yet. Request 6 is never published again,
so the lane waits forever,
cpu-lane waitclimbs to 1034-2185 ms/token, the experts' GEMM stallsdown+postat 101 ms/layer, andswapsfreezes.Evidence
cpu-lane waitdown+postswapsper requestWith a bounded-wait fix applied (publish N only after the lane answered N - kRing, 60 s
timeout), the same
--cpu-threads 1load completes:swapsgrows 297 -> 1306 and every requestfinishes instead of stalling. A 60-request soak then showed zero stalls with
down+postpinnedat 0.33 ms/layer.
Reproduction status
Reproduced locally on the SYCL port. Stalled 3 separate times across different sessions and
--vram-expertssettings.Why this is filed as a question, not a patch
I read
src/dsv41/ds4_model.cuat v0.2.11 for comparison. The structures look the same as theport's:
std::atomic<int> layer_of[kRing](line 1309),reqs/respssized bykRing(3739-3752)serve_lane()(9390) readsreqs[next % kRing], waits forr.seq != next, and has nocheck that the device has not advanced more than
kRingpastnextSo the consumption side has no backpressure on either version. What I cannot establish is
whether the CUDA device side bounds its publishing: I have no NVIDIA hardware here and did not
run it, so I am not claiming the CUDA path stalls. The question is whether the publishing side
of the NVIDIA engine can overlap a slot the lane has not consumed, or whether something upstream
of
serve_lanealready prevents it.If it can, the symptom would land on NVIDIA cards too and would look exactly like this: a lane
that never gets its request, everything else idle.