mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1602] [CLOSED] sycl: make the Intel Arc A-series (Alchemist) work — prompt handshake, mirror, and the >4 GiB kernel-address bug #3558
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#3558
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/1602
Author: @duncanmcqueen
Created: 10/8/2026
Status: ❌ Closed
Base:
main← Head:intel-sycl-handshake📝 Commits (8)
8f69d94sycl: publish the doorbell with the uncached write hint33064c3sycl: chunk the expert mirror and raise memlock in the wrapper039992esycl: keep Alchemist's prompt path on its own buffersc756d4bsycl: add the doorbell payload checksumaa71188sycl: stage oneMKL GEMM operands that lie more than 4 GiB into their allocationb40f69fsycl: build Alchemist kernels for allocations past 4 GiBebe06f9sycl: setup picks the Intel card by PCI id and configures Alchemist712bbc9sycl: fix the GEMM staging scratch lifetime and unregister freed allocations📊 Changes
17 files changed (+523 additions, -160 deletions)
View changed files
📝
docs/INTEL.md(+9 -0)📝
include/strata/kernels/elementwise.hpp(+15 -0)📝
sycl/CMakeLists.txt(+8 -1)📝
sycl/include/strata/core/gguf_expert_source.hpp(+7 -4)📝
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(+16 -0)📝
sycl/src/kernels/cuda/elementwise.dp.cpp(+123 -96)📝
sycl/src/prefill/gemm.dp.cpp(+58 -0)📝
sycl/src/program/generate.cpp(+29 -2)📄 Description
Title
sycl: make the Intel Arc A-series (Alchemist) work — prompt handshake, mirror, and the >4 GiB kernel-address bug
Issue: Resolves # (none)
Summary
The SYCL base engine on an Intel Arc A770 answered short prompts but produced garbage (
"!!!!!!!!!!!!!!!!")for prompts longer than a few dozen tokens. This series fixes the A-series path end to end: the doorbell the host
polls, the expert mirror on Alchemist, the prompt path's own buffers, and — the actual cause of the garbage — a JIT
kernel-address bug where IGC turned a kernel's pointer arguments into 32-bit offsets from the allocation's base, so
kernels misread any bytes more than 4 GiB into an allocation while a memcpy of the same bytes was right.
Measured on an Arc A770 (16 GB,
xe, PCI56a0), Qwen3.8-Flash-Next Coder IQ1_M,--stream-expertswith a 4.46 GiBVRAM expert cache: before, a 542-token prompt generated 16 tokens of
!(every prompt answered token 0); after,prompts of 73-542 tokens have 0 non-finite values (
STRATA_DBG_NAN=1) and the 542-token prompt answers right(
17 + 24 = 41). Short prompts were correct throughout.What changed
Commits (oldest first):
8f69d94sycl: publish the doorbell with the uncached write hint — a plain atomic store to host USM reaches thehost only when the kernel ends on
xe; the doorbell now stores throughwrite_hint<cache_mode::uncached>so thehost sees the sequence number mid-kernel (probe: 230 ms vs 2038 ms). Adds
sycl/probe/doorbell_store.cpp.33064c3sycl: chunk the expert mirror and raise memlock in the wrapper — Alchemist refuses a singlesycl::malloc_hostpast ~3 GiB; the mirror is built in chunks so a 17.6 GiB mirror loads on the A770.039992esycl: keep Alchemist's prompt path on its own buffers — the prompt path no longer carves its buffersfrom borrowed expert-cache slots on A-series; this removes a prefill crash (
routed id out of range, exit 139).c756d4bsycl: add the doorbell payload checksum — the publish kernels write a ring tag and a checksum of thepayload next to the sequence word; the host waits for the whole payload before the CPU pool reads it. Robustness
for the CPU-expert mode (not the A770 cure).
aa71188sycl: stage oneMKL GEMM operands that lie more than 4 GiB into their allocation — oneMKL's ownprecompiled GEMM reads the last partial tile of an operand wrongly past 4 GiB (its kernels do not get the build
option below). A small allocation registry (
device_offset_end) plus staging inGemm::bf16/f16;STRATA_SYCL_GEMM_NO_STAGE=1is the negative control.b40f69fsycl: build Alchemist kernels for allocations past 4 GiB — the fix. The JIT (non-AOT) build nowpasses
-ze-opt-greater-than-4GB-buffer-requiredto thespir64backend (in the same argument as thedivide/sqrt option; CMake drops a repeated
-Xsycl-target-backend=spir64). AOT build unchanged.ebe06f9sycl: setup picks the Intel card by PCI id and configures Alchemist —setup_intel.pycarries thePCI device id through so an A-series on
xeis told from a Battlemage; every Alchemist id gets the driver's FP64emulation. On
i915the experts still load into a CPU-computed RAM arena; onxethe A-series takes the ordinarystreamed path (mirror chunked + the build option above).
Files:
sycl/CMakeLists.txt,sycl/include/strata/sycl_doorbell.hpp,sycl/include/strata/sycl_queue.hpp,sycl/src/core/{expert_cache,layer,session,verify}.cpp,sycl/src/prefill/gemm.dp.cpp,sycl/src/kernels/cuda/elementwise.dp.cpp,sycl/src/program/generate.cpp,include/strata/kernels/elementwise.hpp,sycl/setup_intel.py,docs/INTEL.md.Extra Notes
aa71188) did not fix the A770 garbage by itself: instrumentation showed no operand everlies >4 GiB into its allocation in the reproducing config. It is kept as a defensive fix for the case the build
option cannot cover (oneMKL's precompiled kernels), matching what the CUDA/HIP shims do. The
b40f69fbuild optionis the actual cure.
64-bit addresses, and the doorbell/mirror/setup changes are gated by driver or device id.
tools/test_setup_sycl.pypasses (14 tests). Speed cost of the build option is not measured.docker run ... strata-sycl-dev "bash sycl/tools/build.sh strata"(JIT). No AOT change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.