[GH-ISSUE #5426] [Engine] decode stall: the CPU lane waits for a request the mailbox has already overwritten (seq - next == kRing) #3247

Open
opened 2026-11-07 14:39:08 +07:00 by bsakaguchi · 0 comments
Owner

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 port of this tree (sycl/src/dsv41/ds4_model.dp.cpp), not the CUDA path in src/dsv41/
  • Intel Arc Pro B70 32 GB, xe driver, oneAPI 2026.2
  • DeepSeek-V4.1 IQ2_XXS pack, 40 layers, 384 experts/layer, top-6
  • --vram-experts 0.75 and 1.0; --dspark both on and off
  • Linux 6.x, 188 GB RAM

Reproduce

Deterministic with a slow CPU lane plus replaying a long session without restarting:

--cpu-threads 1        # a slow lane makes it certain; 1-2 requests

Without --cpu-threads 1 it is intermittent, roughly one stall every 4-8 long sessions of
15-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:

lane_tlog: waiting 200 ms for request 6 in slot 6 (slot says 70)

70 - 6 = 64 = kRing. The device has published exactly one full ring past the lane's read
position and overwritten the slot the lane has not read yet. Request 6 is never published again,
so the lane waits forever, cpu-lane wait climbs to 1034-2185 ms/token, the experts' GEMM stalls
down+post at 101 ms/layer, and swaps freezes.

Evidence

signal healthy stalled
cpu-lane wait 10-20 ms/token 1034-2185 ms/token
down+post 0.14-0.33 ms/layer 101 ms/layer
swaps per request 224-445, growing frozen
disk reads 0-60 MiB 0 MiB
VRAM 24-30 GB unchanged

With a bounded-wait fix applied (publish N only after the lane answered N - kRing, 60 s
timeout), the same --cpu-threads 1 load completes: swaps grows 297 -> 1306 and every request
finishes instead of stalling. A 60-request soak then showed zero stalls with down+post pinned
at 0.33 ms/layer.

Reproduction status

Reproduced locally on the SYCL port. Stalled 3 separate times across different sessions and
--vram-experts settings.

Why this is filed as a question, not a patch

I read src/dsv41/ds4_model.cu at v0.2.11 for comparison. The structures look the same as the
port's:

  • std::atomic<int> layer_of[kRing] (line 1309), reqs/resps sized by kRing (3739-3752)
  • serve_lane() (9390) reads reqs[next % kRing], waits for r.seq != next, and has no
    check that the device has not advanced more than kRing past next

So 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_lane already 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.

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 port** of this tree (`sycl/src/dsv41/ds4_model.dp.cpp`), not the CUDA path in `src/dsv41/` - Intel Arc Pro B70 32 GB, xe driver, oneAPI 2026.2 - DeepSeek-V4.1 IQ2_XXS pack, 40 layers, 384 experts/layer, top-6 - `--vram-experts 0.75` and `1.0`; `--dspark` both `on` and `off` - Linux 6.x, 188 GB RAM ## Reproduce Deterministic with a slow CPU lane plus replaying a long session without restarting: ``` --cpu-threads 1 # a slow lane makes it certain; 1-2 requests ``` Without `--cpu-threads 1` it is intermittent, roughly one stall every 4-8 long sessions of 15-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: ``` lane_tlog: waiting 200 ms for request 6 in slot 6 (slot says 70) ``` **`70 - 6 = 64 = kRing`.** The device has published exactly one full ring past the lane's read position and overwritten the slot the lane has not read yet. Request 6 is never published again, so the lane waits forever, `cpu-lane wait` climbs to 1034-2185 ms/token, the experts' GEMM stalls `down+post` at 101 ms/layer, and `swaps` freezes. ## Evidence | signal | healthy | stalled | |---|---|---| | `cpu-lane wait` | 10-20 ms/token | **1034-2185 ms/token** | | `down+post` | 0.14-0.33 ms/layer | **101 ms/layer** | | `swaps` per request | 224-445, growing | **frozen** | | disk reads | 0-60 MiB | **0 MiB** | | VRAM | 24-30 GB | unchanged | With a bounded-wait fix applied (publish N only after the lane answered N - kRing, 60 s timeout), the same `--cpu-threads 1` load completes: `swaps` grows 297 -> 1306 and every request finishes instead of stalling. A 60-request soak then showed zero stalls with `down+post` pinned at 0.33 ms/layer. ## Reproduction status **Reproduced locally** on the SYCL port. Stalled 3 separate times across different sessions and `--vram-experts` settings. ## Why this is filed as a question, not a patch I read `src/dsv41/ds4_model.cu` at v0.2.11 for comparison. The structures look the same as the port's: - `std::atomic<int> layer_of[kRing]` (line 1309), `reqs`/`resps` sized by `kRing` (3739-3752) - `serve_lane()` (9390) reads `reqs[next % kRing]`, waits for `r.seq != next`, and **has no check that the device has not advanced more than `kRing` past `next`** So 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_lane` already 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3247
No description provided.