mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1711] [CLOSED] sycl: opt-in grouped XMX expert GEMM for the prompt path (STRATA_PF_XMX), with a parity test #3625
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#3625
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/1711
Author: @aslater3
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:a770/pr-xmx-group📝 Commits (3)
a67eaa5sycl/A770 prefill: grouped XMX expert GEMM (opt-in STRATA_PF_XMX=1/2)aedec6csycl: grouped XMX passes the decoder thread that writes [o, o+8) for the run-of-8 IQ decoders8f4ddb1sycl: grouped XMX GEMMs build and run on Xe2 (16x16x16, sub-group 16), 8x8x16 kept for DG2📊 Changes
8 files changed (+694 additions, -14 deletions)
View changed files
📝
include/strata/kernels/iq_kernels.hpp(+8 -0)➕
include/strata/prefill/xmx_moe.hpp(+20 -0)📝
sycl/CMakeLists.txt(+10 -1)➕
sycl/include/strata/xmx_tile.hpp(+39 -0)📝
sycl/src/kernels/cuda/iq_kernels.dp.cpp(+171 -0)➕
sycl/src/kernels/xmx_group_parity.cpp(+112 -0)📝
sycl/src/prefill/prefill.cpp(+150 -13)➕
sycl/src/prefill/xmx_moe.dp.cpp(+184 -0)📄 Description
Adds an opt-in grouped XMX GEMM for the prompt path's routed experts on Intel Arc. With
STRATA_PF_XMXunset, the default path does not change.What it changes
STRATA_PF_XMX=1: dequantizes a group of up to 16 routed experts to FP16, then runs onejoint_matrixlaunch per product. A standalone measurement against oneMKL on uneven routing: down 1.75–6x faster, gate/up 0.8–3x. AboveSTRATA_PF_XMX_GU_MAX=250tokens per expert, gate/up stays on oneMKL.STRATA_PF_XMX=2: the same GEMM, but the kernel decodes the IQ3_XXS / IQ3_S / IQ2_S / IQ4_XS gate/up rows and the IQ4_NL / Q2_0 down rows itself, so there is no FP16 staging pass.xmx_group_paritytest (built withSTRATA_SYCL_PARITY=ON): checks every supported type against dequant+oneMKL.The third commit (
8f4ddb1) makes both kernels build and run on Xe2 (Battlemage). There they use 16×16×16 tiles with sub-group 16, following @maxious's retile; DG2 keeps 8×8×16 with sub-group 8. A JIT build picks per device, and an AOT build carries only the 16×16 kernel (sycl/include/strata/xmx_tile.hpp).The second commit fixes the in-kernel decode after rebasing onto current
main.mainnow has the IQ2/IQ3/IQ4_NL/IQ1_M decoders write values[8·tid, 8·tid+8)in coalesced runs. The grouped kernel was still passing the oldsub*8 + o32/32thread index, so four of the six types decoded garbage (relative error ≈10). It now passestid = o >> 3for every type except IQ4_XS, which keeps its own layout.Measured
On an Arc A770 16 GB (xe driver, oneAPI 2025.3, Linux 7.0),
xmx_group_parityon this branch:Without the second commit, types 18, 21, 22 and 20 fail with relative error ≈10.
End to end, on the Coder IQ1_M model with an 8K prompt:
STRATA_PF_XMX=2, and 8K/32K prompts 2–5% faster. These were not repeated on this branch.main+ #1602 on the A770: a same-day 8K run did not show a gain.So it stays opt-in.
On the same A770 with this branch: 2,058-token code prompt, greedy decoding, 128 new tokens.
STRATA_PF_XMX=0gave 847.8 and 832.6 tok/s prompt,=2gave 847.3 and 825.3,=1gave 835.7, all with identical output. On an Arc Pro B60, @maxious measured the fused path at about 2.9x slower than the default (505.5 vs 177.3 tok/s prompt). It stays opt-in and off by default.Not tested
bmg-g21links on this branch, but I have no Battlemage card. @maxious ran the 16×16 kernels on a B60.sycl/), plus one declaration ininclude/strata/kernels/iq_kernels.hppand a newinclude/strata/prefill/xmx_moe.hpp, neither of which the CUDA/HIP sources include.STRATA_PF_XMX=2. The parity test covers the kernel only.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.