[PR #1472] [CLOSED] Intel Arc A770 (DG2, 16 GB) support in the SYCL port #3478

Closed
opened 2026-11-07 14:41:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1472
Author: @samsonnguyen
Created: 10/8/2026
Status: ❌ Closed

Base: main ← Head: a770-upstream-pr


📝 Commits (10+)

  • 4e4d8e9 sycl: STRATA_SYCL_NO_XMX option for GPUs without a working joint_matrix path
  • b7c8407 sycl: read free VRAM from Level Zero Sysman when the SYCL aspect is missing
  • 4ac1d7b sycl: allocate the pinned expert mirror in chunks
  • 748e949 sycl: STRATA_SYCL_LARGE_BUFFERS: compile for buffers over 4 GiB
  • 8069c20 sycl: publish a GGUF ring slot only after its read has finished
  • cd42647 sycl: mirror the resident experts too when adaptive swaps are on
  • 454d799 sycl: expert cache laid out in reverse; prompt loans capped under 4 GiB
  • 07bbd61 sycl: a device wait that gives up is an error, and says which flag
  • 54300f7 sycl: count the routed experts on the GPU so the adaptive tier runs in GPU-only mode
  • 44c53aa sycl: serve Q6_K from blocks padded to 224 bytes: GPU-only decode 9.77 -> 10.37 tok/s

📊 Changes

35 files changed (+1453 additions, -197 deletions)

View changed files

📝 docs/INTEL.md (+6 -0)
➕ docs/INTEL_A770.md (+276 -0)
➕ docs/INTEL_A770_ISSUES.md (+126 -0)
📝 include/strata/core/expert_cache.hpp (+24 -3)
➕ include/strata/core/expert_cache_layout.hpp (+51 -0)
📝 sycl/CMakeLists.txt (+14 -1)
📝 sycl/include/dpct/device.hpp (+29 -2)
📝 sycl/include/strata/core/gguf_expert_source.hpp (+3 -3)
📝 sycl/include/strata/core/session.hpp (+2 -1)
📝 sycl/include/strata/core/verify.hpp (+1 -0)
➕ sycl/include/strata/kernels/cache_hit.hpp (+18 -0)
📝 sycl/include/strata/kernels/native_mmvq.hpp (+6 -0)
📝 sycl/include/strata/kernels/resident_plan_mirror.hpp (+6 -0)
📝 sycl/include/strata/sycl_queue.hpp (+7 -2)
➕ sycl/include/strata/sycl_wait_timeouts.hpp (+24 -0)
➕ sycl/include/strata/wait_timeout_registry.hpp (+46 -0)
📝 sycl/src/core/expert_cache.cpp (+41 -5)
📝 sycl/src/core/expert_source.cpp (+4 -2)
📝 sycl/src/core/gguf_expert_source.cpp (+61 -38)
📝 sycl/src/core/native_dense.cpp (+14 -4)

...and 15 more files

📄 Description

Title

Intel Arc A770 (DG2, 16 GB) support in the SYCL port
Issue: Resolves #692

The Alchemist cards on xe drivers have some weird bugs, which unfortunately need to be worked around. I've tried to ensure that these flags don't affect builds for other cards, and documented the issues i ran into.

Summary

The SYCL port was written for the Arc Pro B70. This makes it build and run correctly on an Arc A770 (Alchemist, xe driver, 16 GB) with the Qwen3.8-Flash-Next IQ3_XXS model, plus a few engine fixes the A770 exposed. Everything is additive or gated to the cases that need it (a build option, an env switch, or a memory size above 4 GiB).

Measured on an A770 (xe driver, forced probe), Xeon E5 v4 host (PCIe 3.0 x16, AVX2 only), Ubuntu 26.04, kernel 7.0, oneAPI 2026.1, engine 0.1.40.3, Qwen3.8-Flash-Next IQ3_XXS, --stream-experts --expert-cache 5000 --vram-reserve-mib 1280 --kv int8 --spec 4 --mtp, STRATA_VERIFY_DEVICE_PLAN=1 STRATA_VERIFY_NO_HOST=1, greedy, 128 new tokens:

tok/s
decode, 19-token prompt 17.5
8,191-token prompt, prefill 491
8,191-token prompt, decode 13.7 (2.0 tokens per round; per-round time unchanged)

Not measured here: the B70 or any other card, the parity tests (built with STRATA_SYCL_PARITY=OFF), models other than IQ3_XXS (and, earlier, the Coder IQ1_M).

What changed

  • -DSTRATA_SYCL_NO_XMX=ON: compiles the joint_matrix kernels out. IGC for dg2 dies with a floating point exception on them.
  • Free VRAM: dpct::get_memory_info asks Level Zero Sysman when the SYCL aspect is missing (xe reports nothing, so --expert-cache auto saw 0 bytes).
  • Pinned expert mirror is allocated in chunks of at most 3 GiB (a single host allocation is capped near 4 GiB), and a GGUF ring slot is published only after its read has finished.
  • -DSTRATA_SYCL_LARGE_BUFFERS=ON (-ze-opt-greater-than-4GB-buffer-required): without it, a kernel reading an expert more than 4 GiB into the cache read garbage.
  • Reversed expert cache (STRATA_CACHE_REVERSE, automatic when the arena is over 4 GiB): oneMKL's bf16/f16 GEMM returns zeros when an input matrix starts 4 GiB or more into an allocation, so a prompt of about 1.5k tokens or more decoded to token 0 when the prompt path borrowed cache slots. The coldest slots now sit at the lowest addresses, the loan is the tail of the cache and capped at 3.9 GiB, and the kernels reading slots take per-slot device offsets. Reproducer: sycl/tests/repro/mkl_gemm_4gib.cpp; host test: sycl/tests/expert_cache_reverse_test.cpp.
  • A device wait that gives up is an error: each wait kernel counts timeouts per flag; the verifier refuses the window and names the flag (STRATA_WAIT_TIMEOUT=warn only reports, STRATA_SPIN_MAX sets the bound). Before, the window went on with data the host had not written and the recurrent state kept the garbage.
  • Adaptive tier in GPU-only mode: resident_plan counts routed experts on the device, so the adaptive swaps run with STRATA_VERIFY_NO_HOST (hit rate 33% to 87% on the Coder IQ1_M), and a swap victim is only taken if it can be re-read from a pinned mirror.
  • Q6_K padded to 224 bytes (STRATA_Q6K_REPACK=1, off by default): aligned weight loads in the decode mmvq kernel. +6% GPU-only decode on the Coder IQ1_M (9.77 to 10.37 tok/s); no measurable change on IQ3_XXS (17.5 against 17.2). mmvq_bench --selftest checks it against the GGUF layout.
  • Polled host memory stays plain when STRATA_VERIFY_NO_HOST is set: nothing waits on a host store in that mode, and the uncached allocation cost 42 ms per decode window on the A770 (13.1 against 17.5 tok/s). Uncached allocation is unchanged in every other mode, and STRATA_HOST_UNCACHED=0 still turns it off.
  • Docs: docs/INTEL_A770.md (bring-up, what differs from the B70, measurements) and docs/INTEL_A770_ISSUES.md (the driver, runtime and compiler problems found, with workarounds), and a pointer in docs/INTEL.md.

Extra Notes

  • The A770 needs IGC_EnableDPEmulation=1 OverrideDefaultFP64Settings=1 at build time (no fp64 in hardware; the engine uses double on purpose) and UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS=1 ZES_ENABLE_SYSMAN=1 at run time. Details are in docs/INTEL_A770.md.
  • I built with -DSTRATA_SYCL_SPIN_MAX=20000; the default for a non-B-series AOT build (2,000,000 polls) is what a plain build gets.
  • The commits are in dependency order and can be reviewed one by one.

🤖 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/1472 **Author:** [@samsonnguyen](https://github.com/samsonnguyen) **Created:** 10/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `a770-upstream-pr` --- ### 📝 Commits (10+) - [`4e4d8e9`](https://github.com/Niko1221/Strata/commit/4e4d8e994ee996ac3f94703f549b3f1b5f42151b) sycl: STRATA_SYCL_NO_XMX option for GPUs without a working joint_matrix path - [`b7c8407`](https://github.com/Niko1221/Strata/commit/b7c84077cab76fd792e796633555617c47e0d32a) sycl: read free VRAM from Level Zero Sysman when the SYCL aspect is missing - [`4ac1d7b`](https://github.com/Niko1221/Strata/commit/4ac1d7bd719a6777be56862904464230dd195c77) sycl: allocate the pinned expert mirror in chunks - [`748e949`](https://github.com/Niko1221/Strata/commit/748e949108f61c6e7f054f296afe74787c030e70) sycl: STRATA_SYCL_LARGE_BUFFERS: compile for buffers over 4 GiB - [`8069c20`](https://github.com/Niko1221/Strata/commit/8069c20dc2139aff47bf7577e56b04c20567757f) sycl: publish a GGUF ring slot only after its read has finished - [`cd42647`](https://github.com/Niko1221/Strata/commit/cd42647bb19ab9d17e8a8f4dd63f1b60427a71a2) sycl: mirror the resident experts too when adaptive swaps are on - [`454d799`](https://github.com/Niko1221/Strata/commit/454d7998bb21cfc1ad764b004c96f8d7d5bc8525) sycl: expert cache laid out in reverse; prompt loans capped under 4 GiB - [`07bbd61`](https://github.com/Niko1221/Strata/commit/07bbd610b104049078e0e3fbc39d4f98f00e95b3) sycl: a device wait that gives up is an error, and says which flag - [`54300f7`](https://github.com/Niko1221/Strata/commit/54300f7569ad3a1e00bb04a30466c321a37b6772) sycl: count the routed experts on the GPU so the adaptive tier runs in GPU-only mode - [`44c53aa`](https://github.com/Niko1221/Strata/commit/44c53aa931d98e3e45544be6ccc9b65e5c5e635f) sycl: serve Q6_K from blocks padded to 224 bytes: GPU-only decode 9.77 -> 10.37 tok/s ### 📊 Changes **35 files changed** (+1453 additions, -197 deletions) <details> <summary>View changed files</summary> 📝 `docs/INTEL.md` (+6 -0) ➕ `docs/INTEL_A770.md` (+276 -0) ➕ `docs/INTEL_A770_ISSUES.md` (+126 -0) 📝 `include/strata/core/expert_cache.hpp` (+24 -3) ➕ `include/strata/core/expert_cache_layout.hpp` (+51 -0) 📝 `sycl/CMakeLists.txt` (+14 -1) 📝 `sycl/include/dpct/device.hpp` (+29 -2) 📝 `sycl/include/strata/core/gguf_expert_source.hpp` (+3 -3) 📝 `sycl/include/strata/core/session.hpp` (+2 -1) 📝 `sycl/include/strata/core/verify.hpp` (+1 -0) ➕ `sycl/include/strata/kernels/cache_hit.hpp` (+18 -0) 📝 `sycl/include/strata/kernels/native_mmvq.hpp` (+6 -0) 📝 `sycl/include/strata/kernels/resident_plan_mirror.hpp` (+6 -0) 📝 `sycl/include/strata/sycl_queue.hpp` (+7 -2) ➕ `sycl/include/strata/sycl_wait_timeouts.hpp` (+24 -0) ➕ `sycl/include/strata/wait_timeout_registry.hpp` (+46 -0) 📝 `sycl/src/core/expert_cache.cpp` (+41 -5) 📝 `sycl/src/core/expert_source.cpp` (+4 -2) 📝 `sycl/src/core/gguf_expert_source.cpp` (+61 -38) 📝 `sycl/src/core/native_dense.cpp` (+14 -4) _...and 15 more files_ </details> ### 📄 Description ## Title Intel Arc A770 (DG2, 16 GB) support in the SYCL port Issue: Resolves #692 The Alchemist cards on `xe` drivers have some weird bugs, which unfortunately need to be worked around. I've tried to ensure that these flags don't affect builds for other cards, and documented the issues i ran into. ## Summary The SYCL port was written for the Arc Pro B70. This makes it build and run correctly on an Arc A770 (Alchemist, `xe` driver, 16 GB) with the Qwen3.8-Flash-Next IQ3_XXS model, plus a few engine fixes the A770 exposed. Everything is additive or gated to the cases that need it (a build option, an env switch, or a memory size above 4 GiB). Measured on an A770 (xe driver, forced probe), Xeon E5 v4 host (PCIe 3.0 x16, AVX2 only), Ubuntu 26.04, kernel 7.0, oneAPI 2026.1, engine 0.1.40.3, Qwen3.8-Flash-Next IQ3_XXS, `--stream-experts --expert-cache 5000 --vram-reserve-mib 1280 --kv int8 --spec 4 --mtp`, `STRATA_VERIFY_DEVICE_PLAN=1 STRATA_VERIFY_NO_HOST=1`, greedy, 128 new tokens: | | tok/s | |---|---| | decode, 19-token prompt | 17.5 | | 8,191-token prompt, prefill | 491 | | 8,191-token prompt, decode | 13.7 (2.0 tokens per round; per-round time unchanged) | Not measured here: the B70 or any other card, the parity tests (built with `STRATA_SYCL_PARITY=OFF`), models other than IQ3_XXS (and, earlier, the Coder IQ1_M). ## What changed - **`-DSTRATA_SYCL_NO_XMX=ON`**: compiles the `joint_matrix` kernels out. IGC for dg2 dies with a floating point exception on them. - **Free VRAM**: `dpct::get_memory_info` asks Level Zero Sysman when the SYCL aspect is missing (xe reports nothing, so `--expert-cache auto` saw 0 bytes). - **Pinned expert mirror** is allocated in chunks of at most 3 GiB (a single host allocation is capped near 4 GiB), and a GGUF ring slot is published only after its read has finished. - **`-DSTRATA_SYCL_LARGE_BUFFERS=ON`** (`-ze-opt-greater-than-4GB-buffer-required`): without it, a kernel reading an expert more than 4 GiB into the cache read garbage. - **Reversed expert cache** (`STRATA_CACHE_REVERSE`, automatic when the arena is over 4 GiB): oneMKL's bf16/f16 GEMM returns zeros when an input matrix starts 4 GiB or more into an allocation, so a prompt of about 1.5k tokens or more decoded to token 0 when the prompt path borrowed cache slots. The coldest slots now sit at the lowest addresses, the loan is the tail of the cache and capped at 3.9 GiB, and the kernels reading slots take per-slot device offsets. Reproducer: `sycl/tests/repro/mkl_gemm_4gib.cpp`; host test: `sycl/tests/expert_cache_reverse_test.cpp`. - **A device wait that gives up is an error**: each wait kernel counts timeouts per flag; the verifier refuses the window and names the flag (`STRATA_WAIT_TIMEOUT=warn` only reports, `STRATA_SPIN_MAX` sets the bound). Before, the window went on with data the host had not written and the recurrent state kept the garbage. - **Adaptive tier in GPU-only mode**: `resident_plan` counts routed experts on the device, so the adaptive swaps run with `STRATA_VERIFY_NO_HOST` (hit rate 33% to 87% on the Coder IQ1_M), and a swap victim is only taken if it can be re-read from a pinned mirror. - **Q6_K padded to 224 bytes** (`STRATA_Q6K_REPACK=1`, off by default): aligned weight loads in the decode mmvq kernel. +6% GPU-only decode on the Coder IQ1_M (9.77 to 10.37 tok/s); no measurable change on IQ3_XXS (17.5 against 17.2). `mmvq_bench --selftest` checks it against the GGUF layout. - **Polled host memory stays plain when `STRATA_VERIFY_NO_HOST` is set**: nothing waits on a host store in that mode, and the uncached allocation cost 42 ms per decode window on the A770 (13.1 against 17.5 tok/s). Uncached allocation is unchanged in every other mode, and `STRATA_HOST_UNCACHED=0` still turns it off. - **Docs**: `docs/INTEL_A770.md` (bring-up, what differs from the B70, measurements) and `docs/INTEL_A770_ISSUES.md` (the driver, runtime and compiler problems found, with workarounds), and a pointer in `docs/INTEL.md`. ## Extra Notes - The A770 needs `IGC_EnableDPEmulation=1 OverrideDefaultFP64Settings=1` at build time (no fp64 in hardware; the engine uses double on purpose) and `UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS=1 ZES_ENABLE_SYSMAN=1` at run time. Details are in `docs/INTEL_A770.md`. - I built with `-DSTRATA_SYCL_SPIN_MAX=20000`; the default for a non-B-series AOT build (2,000,000 polls) is what a plain build gets. - The commits are in dependency order and can be reviewed one by one. 🤖 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 14:41:45 +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#3478
No description provided.