mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2319] [CLOSED] SYCL verify: batch windows keep the doorbell nodes under the lean window ("parallel" crashed on a B70) #3979
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#3979
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?
📋 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)
e491587SYCL 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 2on 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": 2crashes 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 insycl/src/core/verify.cpp: batch windows keep their doorbells, solo windows stay lean.What changed
sycl/src/core/verify.cpp: add&& !batch_rec_to theleancondition inrecord_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:It reproduced 6 times out of 6, with
--spec 4,--spec 2and--batch-mtp. A single slot was fine, and so was"parallel": 2with 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 samerecord_window()withbatch_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=00on 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-devimage: oneAPI DPC++ 2026.1.0, compute-runtime 26.35.39758.10, Level Zero 1.32.0, AOTbmg-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 defaultsSTRATA_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).a0116b27), same flagslayer 0 never rang (graph finished), exit 139Two 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, andtools/batch_test.py --batch 2 --n 2 --max-new 64 --extra "--pcie-frac 0 --adapt-every 1000000" --dumpis byte-identical to the stock build withSTRATA_VERIFY_LEAN=00, with and without--batch-mtp.--batch-mtpruns: 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: 226–57 s, mean 38 s (5 runs);parallel: 2+--batch-mtp33–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 withSTRATA_VERIFY_LEAN=00.Side note: the launcher drops
STRATA_VERIFY_LEAN=0.sycl/serve/strata-sycl.shtreats a value of exactly0as "not set" and doesn't pass it into the container.STRATA_VERIFY_LEANis on by default and turned off by a leading0, so0never reaches the engine; I had to use00to 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.