[PR #2319] [CLOSED] SYCL verify: batch windows keep the doorbell nodes under the lean window ("parallel" crashed on a B70) #3979

Closed
opened 2026-11-07 15:32:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2319
Author: @aangelinsf
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: sycl-batch-lean-doorbells


📝 Commits (1)

  • e491587 SYCL verify: batch windows keep the doorbell nodes under the lean window

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 sycl/src/core/verify.cpp (+4 -1)

📄 Description

Title

Issue: none filed. I searched open and closed issues and PRs (about 20 queries, including the control query "Arc Pro B70") and found no report of this crash. Nearest: #1762 (--batch 2 on a B65: non-finite residuals and a stall, not a segfault), #1721, #776 / #845 (the all-resident counterpart in the batch path), #1118.

Summary

On the SYCL port, "parallel": 2 crashes the engine the first time two requests share a decode window, on v0.1.43.1 (a0116b27) and on main / v0.1.44 (ed4773eb). The 0.1.43 "lean verify window" (46a77907) drops the doorbell nodes from batch windows, and the host batch path still waits for them. The fix is one condition in sycl/src/core/verify.cpp: batch windows keep their doorbells, solo windows stay lean.

What changed

sycl/src/core/verify.cpp: add && !batch_rec_ to the lean condition in record_window(), plus a comment saying why. That is the whole diff.

I kept it conservative: batch windows keep their doorbells even on an all-resident stage, where lean would be harmless, because a captured batch graph is reused across windows. A narrower condition is your call.

Extra Notes

The crash. One Arc Pro B70, "parallel": 2, first time two requests share a window:

strata verify: captured the batch window over slots 0,1
terminate called after throwing an instance of 'sycl::_V1::exception'
  what():  level_zero backend failed with error: 37 (UR_RESULT_ERROR_UNINITIALIZED)
[strata] the engine stopped unexpectedly (exit code 139) ... verify batch: layer 0 never rang (graph finished)

It reproduced 6 times out of 6, with --spec 4, --spec 2 and --batch-mtp. A single slot was fine, and so was "parallel": 2 with requests sent one after another.

Cause. The lean window drops the doorbell publish, the flag waits and the plan copy, because no host answers them. capture_batch() records batch windows through the same record_window() with batch_rec_ set, so batch graphs were recorded lean too. The host batch path (run_slot_rows / batch_poll) still waits for each layer's doorbell unless the stage is all-resident. On a stage with mirrored experts the graph finishes with the ring silent. STRATA_VERIFY_LEAN=00 on the stock build makes the crash go away, which confirms this.

Setup. Arc Pro B70 32 GB (8086:e223), xe driver, Ubuntu 26.04, kernel 7.0. strata-sycl-dev image: oneAPI DPC++ 2026.1.0, compute-runtime 26.35.39758.10, Level Zero 1.32.0, AOT bmg-g31. Qwen3.8-Flash-Next GSQ-RCO IQ2_XS native pack on one GPU, 17,234 of 24,576 expert slots in VRAM and the rest mirrored. Engine args: --stream-experts --spec 4 --spec-min-p 0.5 --mtp ... --kv int8 --kv-resident 32768 --max-context 110000 --prefill 4096 --vram-reserve-mib 2048. Launcher defaults STRATA_VERIFY_NO_HOST=1 STRATA_VERIFY_DEVICE_PLAN=1.

Control and soak (new). A long run of two real coding agents did not help here: their requests rarely decode at the same time, so the batch-window path went unexercised. So I wrote a small harness (stdlib Python, about 250 lines) that forces the overlap: two streaming requests started together, 5 scenarios cycled (two overlapping 400-token decodes; two concurrent ~13k-token prompts; staggered starts; one client hanging up mid-stream; a long prompt against a short one). It fails a run if the engine dies, restarts or logs a crash line, and also if the two-sequence path never ran, which it detects as interleaved BT <slot> <token> lines from both slots (the one-time "captured the batch window" line rotates out of the log).

Build Run Result
Stock v0.1.43.1 (a0116b27), same flags first overlapped pair engine died within 2 s: layer 0 never rang (graph finished), exit 139
This patch 10 rounds 10/10, 1,909 slot-interleave transitions, 0 crash lines
This patch 20-minute soak 72/72, 13,954 slot-interleave transitions, 0 crash lines, no restart
This patch, after swapping back from the stock build 10 rounds 10/10, 1,934 interleave transitions, 0 crash lines

Two concurrent 400-token decodes finish in about 13 s; two concurrent ~13k-token prompts in 20 s and 34 s. I can attach the harness if it is useful.

Equivalence. On main (v0.1.44): stock still crashes with "parallel": 2; with this patch there is no crash, and tools/batch_test.py --batch 2 --n 2 --max-new 64 --extra "--pcie-frac 0 --adapt-every 1000000" --dump is byte-identical to the stock build with STRATA_VERIFY_LEAN=00, with and without --batch-mtp. --batch-mtp runs: two slot drafters load, and two streams decode at 63–65 tok/s there.

Solo vs batch parity (pre-existing, not changed by this PR). On this card batch tokens still differ from solo at the same positions: slot 0 at token 6 and slot 1 at token 38, and they differ in exactly the same way on the stock build with STRATA_VERIFY_LEAN=00, like the B65 report in #1721. The text stays coherent. In my own overlap harness, batched text was also about 10% shorter than solo for three prompts (first differing character at 64, 88 and 165). I did not measure those prompts on stock with lean off, so I can't say whether that length difference is the same pre-existing behavior.

Speed (v0.1.43.1 with the same one-line change). One stream decodes ~73 tok/s; two batched streams decode 66 tok/s from the first batch token, or 82 tok/s with --batch-mtp. Two real coding agents at once, wall time per run: single slot 52–57 s (4 runs); parallel: 2 26–57 s, mean 38 s (5 runs); parallel: 2 + --batch-mtp 33–55 s, mean 38 s (5 runs). Most of the gain comes from each slot keeping its own conversation cache instead of re-reading ~12k tokens on every switch. Single-slot behavior is unchanged: solo windows are still lean, and ran ~4% faster than with STRATA_VERIFY_LEAN=00.

Side note: the launcher drops STRATA_VERIFY_LEAN=0. sycl/serve/strata-sycl.sh treats a value of exactly 0 as "not set" and doesn't pass it into the container. STRATA_VERIFY_LEAN is on by default and turned off by a leading 0, so 0 never reaches the engine; I had to use 00 to A/B. It's not needed after this fix, but it's worth documenting or special-casing for switches that default on.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2319 **Author:** [@aangelinsf](https://github.com/aangelinsf) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `sycl-batch-lean-doorbells` --- ### 📝 Commits (1) - [`e491587`](https://github.com/Niko1221/Strata/commit/e491587ef5b9c7c012d8bfbfccc7477ef395e91d) SYCL verify: batch windows keep the doorbell nodes under the lean window ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `sycl/src/core/verify.cpp` (+4 -1) </details> ### 📄 Description ## Title Issue: none filed. I searched open and closed issues and PRs (about 20 queries, including the control query "Arc Pro B70") and found no report of this crash. Nearest: #1762 (`--batch 2` on a B65: non-finite residuals and a stall, not a segfault), #1721, #776 / #845 (the all-resident counterpart in the batch path), #1118. ## Summary On the SYCL port, `"parallel": 2` crashes the engine the first time two requests share a decode window, on v0.1.43.1 (`a0116b27`) and on main / v0.1.44 (`ed4773eb`). The 0.1.43 "lean verify window" (`46a77907`) drops the doorbell nodes from batch windows, and the host batch path still waits for them. The fix is one condition in `sycl/src/core/verify.cpp`: batch windows keep their doorbells, solo windows stay lean. ## What changed `sycl/src/core/verify.cpp`: add `&& !batch_rec_` to the `lean` condition in `record_window()`, plus a comment saying why. That is the whole diff. I kept it conservative: batch windows keep their doorbells even on an all-resident stage, where lean would be harmless, because a captured batch graph is reused across windows. A narrower condition is your call. ## Extra Notes **The crash.** One Arc Pro B70, `"parallel": 2`, first time two requests share a window: strata verify: captured the batch window over slots 0,1 terminate called after throwing an instance of 'sycl::_V1::exception' what(): level_zero backend failed with error: 37 (UR_RESULT_ERROR_UNINITIALIZED) [strata] the engine stopped unexpectedly (exit code 139) ... verify batch: layer 0 never rang (graph finished) It reproduced 6 times out of 6, with `--spec 4`, `--spec 2` and `--batch-mtp`. A single slot was fine, and so was `"parallel": 2` with requests sent one after another. **Cause.** The lean window drops the doorbell publish, the flag waits and the plan copy, because no host answers them. `capture_batch()` records batch windows through the same `record_window()` with `batch_rec_` set, so batch graphs were recorded lean too. The host batch path (`run_slot_rows` / `batch_poll`) still waits for each layer's doorbell unless the stage is all-resident. On a stage with mirrored experts the graph finishes with the ring silent. `STRATA_VERIFY_LEAN=00` on the stock build makes the crash go away, which confirms this. **Setup.** Arc Pro B70 32 GB (8086:e223), xe driver, Ubuntu 26.04, kernel 7.0. `strata-sycl-dev` image: oneAPI DPC++ 2026.1.0, compute-runtime 26.35.39758.10, Level Zero 1.32.0, AOT `bmg-g31`. Qwen3.8-Flash-Next GSQ-RCO IQ2_XS native pack on one GPU, 17,234 of 24,576 expert slots in VRAM and the rest mirrored. Engine args: `--stream-experts --spec 4 --spec-min-p 0.5 --mtp ... --kv int8 --kv-resident 32768 --max-context 110000 --prefill 4096 --vram-reserve-mib 2048`. Launcher defaults `STRATA_VERIFY_NO_HOST=1 STRATA_VERIFY_DEVICE_PLAN=1`. **Control and soak (new).** A long run of two real coding agents did not help here: their requests rarely decode at the same time, so the batch-window path went unexercised. So I wrote a small harness (stdlib Python, about 250 lines) that forces the overlap: two streaming requests started together, 5 scenarios cycled (two overlapping 400-token decodes; two concurrent ~13k-token prompts; staggered starts; one client hanging up mid-stream; a long prompt against a short one). It fails a run if the engine dies, restarts or logs a crash line, and also if the two-sequence path never ran, which it detects as interleaved `BT <slot> <token>` lines from both slots (the one-time "captured the batch window" line rotates out of the log). | Build | Run | Result | |---|---|---| | Stock v0.1.43.1 (`a0116b27`), same flags | first overlapped pair | engine died within 2 s: `layer 0 never rang (graph finished)`, exit 139 | | This patch | 10 rounds | 10/10, 1,909 slot-interleave transitions, 0 crash lines | | This patch | 20-minute soak | 72/72, 13,954 slot-interleave transitions, 0 crash lines, no restart | | This patch, after swapping back from the stock build | 10 rounds | 10/10, 1,934 interleave transitions, 0 crash lines | Two concurrent 400-token decodes finish in about 13 s; two concurrent ~13k-token prompts in 20 s and 34 s. I can attach the harness if it is useful. **Equivalence.** On main (v0.1.44): stock still crashes with `"parallel": 2`; with this patch there is no crash, and `tools/batch_test.py --batch 2 --n 2 --max-new 64 --extra "--pcie-frac 0 --adapt-every 1000000" --dump` is **byte-identical** to the stock build with `STRATA_VERIFY_LEAN=00`, with and without `--batch-mtp`. `--batch-mtp` runs: two slot drafters load, and two streams decode at 63–65 tok/s there. **Solo vs batch parity (pre-existing, not changed by this PR).** On this card batch tokens still differ from solo at the same positions: slot 0 at token 6 and slot 1 at token 38, and they differ in exactly the same way on the stock build with `STRATA_VERIFY_LEAN=00`, like the B65 report in #1721. The text stays coherent. In my own overlap harness, batched text was also about 10% shorter than solo for three prompts (first differing character at 64, 88 and 165). I did **not** measure those prompts on stock with lean off, so I can't say whether that length difference is the same pre-existing behavior. **Speed (v0.1.43.1 with the same one-line change).** One stream decodes ~73 tok/s; two batched streams decode 66 tok/s from the first batch token, or 82 tok/s with `--batch-mtp`. Two real coding agents at once, wall time per run: single slot 52–57 s (4 runs); `parallel: 2` 26–57 s, mean 38 s (5 runs); `parallel: 2` + `--batch-mtp` 33–55 s, mean 38 s (5 runs). Most of the gain comes from each slot keeping its own conversation cache instead of re-reading ~12k tokens on every switch. Single-slot behavior is unchanged: solo windows are still lean, and ran ~4% faster than with `STRATA_VERIFY_LEAN=00`. **Side note: the launcher drops `STRATA_VERIFY_LEAN=0`.** `sycl/serve/strata-sycl.sh` treats a value of exactly `0` as "not set" and doesn't pass it into the container. `STRATA_VERIFY_LEAN` is on by default and turned off by a leading `0`, so `0` never reaches the engine; I had to use `00` to A/B. It's not needed after this fix, but it's worth documenting or special-casing for switches that default on. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:11 +07:00
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#3979
No description provided.