[PR #1713] [CLOSED] sycl/Arc: stepped verify window (opt-in STRATA_VERIFY_STEPPED) - CPU experts served between graph segments #3627

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1713
Author: @aslater3
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: a770/pr-stepped


📝 Commits (9)

  • 8f69d94 sycl: publish the doorbell with the uncached write hint
  • 33064c3 sycl: chunk the expert mirror and raise memlock in the wrapper
  • 039992e sycl: keep Alchemist's prompt path on its own buffers
  • c756d4b sycl: add the doorbell payload checksum
  • aa71188 sycl: stage oneMKL GEMM operands that lie more than 4 GiB into their allocation
  • b40f69f sycl: build Alchemist kernels for allocations past 4 GiB
  • ebe06f9 sycl: setup picks the Intel card by PCI id and configures Alchemist
  • 712bbc9 sycl: fix the GEMM staging scratch lifetime and unregister freed allocations
  • 4327029 sycl: stepped verify window - CPU experts served between graph segments, cached host buffers and plain payload stores

📊 Changes

18 files changed (+804 additions, -174 deletions)

View changed files

📝 docs/INTEL.md (+9 -0)
📝 include/strata/kernels/elementwise.hpp (+18 -0)
📝 sycl/CMakeLists.txt (+8 -1)
📝 sycl/include/strata/core/gguf_expert_source.hpp (+7 -4)
📝 sycl/include/strata/core/verify.hpp (+13 -0)
📝 sycl/include/strata/sycl_doorbell.hpp (+30 -0)
📝 sycl/include/strata/sycl_queue.hpp (+45 -1)
➕ sycl/probe/doorbell_store.cpp (+43 -0)
📝 sycl/serve/strata-sycl.sh (+1 -0)
📝 sycl/setup_intel.py (+51 -16)
📝 sycl/src/core/expert_cache.cpp (+6 -0)
📝 sycl/src/core/gguf_expert_source.cpp (+72 -38)
📝 sycl/src/core/layer.cpp (+2 -2)
📝 sycl/src/core/session.cpp (+8 -0)
📝 sycl/src/core/verify.cpp (+262 -8)
📝 sycl/src/kernels/cuda/elementwise.dp.cpp (+142 -102)
📝 sycl/src/prefill/gemm.dp.cpp (+58 -0)
📝 sycl/src/program/generate.cpp (+29 -2)

📄 Description

Stacked on #1602 (Alchemist setup + staging-scratch fix). The first new commit here is the last one.

What it does

STRATA_VERIFY_STEPPED=1 is opt-in and off by default, so other GPUs are unaffected. It changes how the doorbell verify window serves CPU experts on Arc A-series.

Today the window is one graph. GPU kernels spin on host flags while the CPU pool serves the off-GPU experts inside it. On an A770 that spinning costs about 100–170 ms of GPU wait per window.

With STRATA_VERIFY_STEPPED=1:

  • Segmented capture. The window is captured as graph segments, each ending at a layer's doorbell publish.
  • CPU experts between segments. The host serves the CPU experts between segments, then raises the flag before it submits the segment that consumes them.
  • Pipelined helper. Plan copy and VRAM groups run on a helper thread pinned to the host thread's SMT sibling. STRATA_VERIFY_PIPE=0 and STRATA_PIPE_HELPER_SIBLING=0 turn the pipelining and the pinning off.
  • Cached host buffers and plain payload stores. In this mode no kernel reads a host store while it runs, and the host reads a segment's rings and payload only after that segment has drained. So the window's mapped buffers come from ordinary malloc_host instead of host_malloc_polled, and the doorbell publishes use plain payload stores instead of sys_store_mapped. The payload checksum still guards every host read.
    • STRATA_VERIFY_HOST_UNCACHED=1 keeps both uncached.
    • With STRATA_VERIFY_STEPPED unset, every buffer and store is as on main.

Measured

Setup:

  • Hardware: Arc A770 16 GB (xe driver, oneAPI 2025.3, Linux 7.0), Ryzen 9 3900X, 32 GB DDR4.
  • Model: Qwen3-Coder IQ1_M, learned24 expert profile, --resident-experts --spec 4 --mtp, greedy decoding, 256 new tokens.
  • Prompt: code, 7,987 tokens.
  • The runs are not interleaved. RAM headroom differs where noted, because resident experts are mlocked and the box has 32 GB.
Build Decode tok/s GPU wait for the CPU per window
#1602 head (712bbc9) 12.3 170 ms
this PR, STRATA_VERIFY_STEPPED=0 12.6–13.1 134 ms
this PR, stepped, everything uncached (= STRATA_VERIFY_HOST_UNCACHED=1, measured on the dev branch) 21.3–25.0 70–72 ms
this PR, stepped (dev branch, same commit) 31.8–32.5 (4 runs) 42.7–43.0 ms
this PR, stepped, 32K-token prompt (dev branch) 27.2 41.9 ms

The dev branch is this commit on top of an A770 rebase. Its resident set was 17.9 GiB, against 13.7 GiB for this branch with STRATA_RESIDENT_HEADROOM_GIB=6. On this PR branch alone, with the smaller resident set, stepped decode was 19.9 tok/s. It was memory-bound because part of the expert set was not resident.

Output check (greedy): this PR stepped, this PR stepped-off, and #1602 agree for the first 80 tokens. Run-to-run, #1602 itself agrees for 76–79 tokens on this prompt, so that is the existing nondeterminism, not a change.

Not tested

  • Arc A750/i915, B-series, and multi-GPU.
  • The CUDA and HIP builds. The only shared-header change is one new SYCL-only declaration, doorbell_plain_payload, in include/strata/kernels/elementwise.hpp; its definition is in sycl/.

On exit, #1602 and this branch both sometimes segfault after the stats are printed (rc 139). It also happens without this commit.


🔄 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/1713 **Author:** [@aslater3](https://github.com/aslater3) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `a770/pr-stepped` --- ### 📝 Commits (9) - [`8f69d94`](https://github.com/Niko1221/Strata/commit/8f69d94b74310aab13d3e9444e5f47e3d56c3068) sycl: publish the doorbell with the uncached write hint - [`33064c3`](https://github.com/Niko1221/Strata/commit/33064c3500e659c4667d7afc9109320689ef6223) sycl: chunk the expert mirror and raise memlock in the wrapper - [`039992e`](https://github.com/Niko1221/Strata/commit/039992e4f997a8accd74da382abe84e48db8071c) sycl: keep Alchemist's prompt path on its own buffers - [`c756d4b`](https://github.com/Niko1221/Strata/commit/c756d4bf2bddf3b085e29410e95d4dce23f5706d) sycl: add the doorbell payload checksum - [`aa71188`](https://github.com/Niko1221/Strata/commit/aa71188b5b90a60edf3e90e5c15490fa075ee83a) sycl: stage oneMKL GEMM operands that lie more than 4 GiB into their allocation - [`b40f69f`](https://github.com/Niko1221/Strata/commit/b40f69f642418336adb75f425822ff82b716b0c5) sycl: build Alchemist kernels for allocations past 4 GiB - [`ebe06f9`](https://github.com/Niko1221/Strata/commit/ebe06f9fffeac9942897a7610647567ef37c5c5a) sycl: setup picks the Intel card by PCI id and configures Alchemist - [`712bbc9`](https://github.com/Niko1221/Strata/commit/712bbc9701a663b9528559bb3e15020d10741001) sycl: fix the GEMM staging scratch lifetime and unregister freed allocations - [`4327029`](https://github.com/Niko1221/Strata/commit/432702961faba67ae5325444a328ebc6fcde9f26) sycl: stepped verify window - CPU experts served between graph segments, cached host buffers and plain payload stores ### 📊 Changes **18 files changed** (+804 additions, -174 deletions) <details> <summary>View changed files</summary> 📝 `docs/INTEL.md` (+9 -0) 📝 `include/strata/kernels/elementwise.hpp` (+18 -0) 📝 `sycl/CMakeLists.txt` (+8 -1) 📝 `sycl/include/strata/core/gguf_expert_source.hpp` (+7 -4) 📝 `sycl/include/strata/core/verify.hpp` (+13 -0) 📝 `sycl/include/strata/sycl_doorbell.hpp` (+30 -0) 📝 `sycl/include/strata/sycl_queue.hpp` (+45 -1) ➕ `sycl/probe/doorbell_store.cpp` (+43 -0) 📝 `sycl/serve/strata-sycl.sh` (+1 -0) 📝 `sycl/setup_intel.py` (+51 -16) 📝 `sycl/src/core/expert_cache.cpp` (+6 -0) 📝 `sycl/src/core/gguf_expert_source.cpp` (+72 -38) 📝 `sycl/src/core/layer.cpp` (+2 -2) 📝 `sycl/src/core/session.cpp` (+8 -0) 📝 `sycl/src/core/verify.cpp` (+262 -8) 📝 `sycl/src/kernels/cuda/elementwise.dp.cpp` (+142 -102) 📝 `sycl/src/prefill/gemm.dp.cpp` (+58 -0) 📝 `sycl/src/program/generate.cpp` (+29 -2) </details> ### 📄 Description Stacked on #1602 (Alchemist setup + staging-scratch fix). The first new commit here is the last one. ## What it does `STRATA_VERIFY_STEPPED=1` is opt-in and off by default, so other GPUs are unaffected. It changes how the doorbell verify window serves CPU experts on Arc A-series. Today the window is one graph. GPU kernels spin on host flags while the CPU pool serves the off-GPU experts inside it. On an A770 that spinning costs about 100–170 ms of GPU wait per window. With `STRATA_VERIFY_STEPPED=1`: - **Segmented capture.** The window is captured as graph segments, each ending at a layer's doorbell publish. - **CPU experts between segments.** The host serves the CPU experts between segments, then raises the flag before it submits the segment that consumes them. - **Pipelined helper.** Plan copy and VRAM groups run on a helper thread pinned to the host thread's SMT sibling. `STRATA_VERIFY_PIPE=0` and `STRATA_PIPE_HELPER_SIBLING=0` turn the pipelining and the pinning off. - **Cached host buffers and plain payload stores.** In this mode no kernel reads a host store while it runs, and the host reads a segment's rings and payload only after that segment has drained. So the window's mapped buffers come from ordinary `malloc_host` instead of `host_malloc_polled`, and the doorbell publishes use plain payload stores instead of `sys_store_mapped`. The payload checksum still guards every host read. - `STRATA_VERIFY_HOST_UNCACHED=1` keeps both uncached. - With `STRATA_VERIFY_STEPPED` unset, every buffer and store is as on `main`. ## Measured Setup: - Hardware: Arc A770 16 GB (xe driver, oneAPI 2025.3, Linux 7.0), Ryzen 9 3900X, 32 GB DDR4. - Model: Qwen3-Coder IQ1_M, learned24 expert profile, `--resident-experts --spec 4 --mtp`, greedy decoding, 256 new tokens. - Prompt: code, 7,987 tokens. - The runs are not interleaved. RAM headroom differs where noted, because resident experts are mlocked and the box has 32 GB. | Build | Decode tok/s | GPU wait for the CPU per window | |---|---|---| | #1602 head (`712bbc9`) | 12.3 | 170 ms | | this PR, `STRATA_VERIFY_STEPPED=0` | 12.6–13.1 | 134 ms | | this PR, stepped, everything uncached (= `STRATA_VERIFY_HOST_UNCACHED=1`, measured on the dev branch) | 21.3–25.0 | 70–72 ms | | this PR, stepped (dev branch, same commit) | **31.8–32.5** (4 runs) | 42.7–43.0 ms | | this PR, stepped, 32K-token prompt (dev branch) | 27.2 | 41.9 ms | The dev branch is this commit on top of an A770 rebase. Its resident set was 17.9 GiB, against 13.7 GiB for this branch with `STRATA_RESIDENT_HEADROOM_GIB=6`. On this PR branch alone, with the smaller resident set, stepped decode was 19.9 tok/s. It was memory-bound because part of the expert set was not resident. Output check (greedy): this PR stepped, this PR stepped-off, and #1602 agree for the first 80 tokens. Run-to-run, #1602 itself agrees for 76–79 tokens on this prompt, so that is the existing nondeterminism, not a change. ## Not tested - Arc A750/i915, B-series, and multi-GPU. - The CUDA and HIP builds. The only shared-header change is one new SYCL-only declaration, `doorbell_plain_payload`, in `include/strata/kernels/elementwise.hpp`; its definition is in `sycl/`. On exit, #1602 and this branch both sometimes segfault after the stats are printed (rc 139). It also happens without this commit. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:39 +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#3627
No description provided.