8fced2e turned on -ze-intel-enable-auto-large-GRF-mode for all of libxe2, which gave the flash
attention kernels the 256 registers their grf_size<256> asks for (AOT never honours the property:
sycl-post-link records it on the image, and only the runtime's JIT reads it). The auto mode also
moved ~25 SIMT kernels that never spilled at 128 to 256 and half their threads: gdn_conv_prep
434 -> 687 us a call at a 2k prefill.
The attention source is now its own shared library, xe2_grf256, linked with
-ze-opt-large-register-file, and the rest of libxe2 is back on the default it was tuned under.
libxe2 needs it from kernels/libxe2.d ($ORIGIN rpath; beside the plugins, not among them, where
the loader would take it for one); both installs carry it. refuse() is exported from libxe2 so the
helper's refusals still reach last_refusal().
rad-kbench replay (libxe2, libref, spechub) 1410/1410, attn --all-rows 227/227, and from an
installed tree. qwen3.8-27b-w4a16 (mtp4fc), fresh prompts, against the auto mode: prefill ~2.1k
tokens 1381 -> 1407 tok/s, ~6.9k 1326 -> 1347; decode 24 corpus prompts 90.4 -> 90.6; greedy 8/8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No kernel's grf_size<256> property reached the card: sycl-post-link records it on the device image
(sycl-grf-size=256 in the image's properties), but only the runtime's JIT path reads that and adds
the large-register option, and this build compiles AOT at link time with the -options string alone.
Every kernel ran with 128 registers; prefill attention spilled 4 KiB a thread and spent 66% of its
stall samples on the scoreboard. -ze-intel-enable-auto-large-GRF-mode gives a kernel the large file
when it needs it: the flash attention kernels get 256 with no spill, the w4 GEMMs keep 128.
Probe fa.cpp (24/4 heads, head_dim 256): 2048 tokens 7.3 -> 13.5 TFLOPS, 8192 tokens 8.3 -> 17.8,
output identical. rad-kbench replay (libxe2, libref, spechub): 1410/1410. qwen3.8-27b-w4a16
(mtp4fc), fresh prompts: prefill ~2.1k tokens 1346 -> 1376 tok/s, ~6.9k tokens 1177 -> 1301; decode
over 24 corpus prompts 90.2 -> 90.4; greedy 8/8 identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The vector compiler that builds ESIMD kernels forms a mad from a multiply and an add unless its
own API option says strict, whatever the front end's -ffp-contract: probe fmac.cpp's
t = (s * a) * b; c += t came back fused in 14062 of 65536 lanes, 0 with the option, and the SIMT
kernels are unaffected either way. An ESIMD epilogue that copies libref's chain (the w2a8 head's
group terms) was therefore exact only where no fusion happened to change a rounding.
ctest -L sycl on the B65: 3/3 (device_test_sycl, kbench, kbench_moe).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oneMKL's SYCL GEMM (part of oneAPI; libxe2 links it when CMake finds it, RAD_XE2_MKL=OFF or
XE2_NO_MKL=1 keep the hand-written kernels) runs the fp16 prefill GEMMs at 85-91 TFLOPS on random
data at the 27B's shapes, deterministic run to run, against ~23-30 for the hand-tiled XMX kernel:
xmx_f16_scaled (the m2xfp4 prefill) and xmx_f16_batched (the rotation's) go to its gemm and
gemm_batch, and bf16 gemm_nt at M >= 17 to its bf16 GEMM (N = 96 had fallen to the exact kernel,
5 ms a call). The m2xfp4 weight decode to fp16 now takes a (column, 32-group) a work-item. fp16 or
bf16 products with f32 accumulation, as before: the 27B's cases 133/133 (rel_l2 <= 1.42e-3), the
fixture 1410/1410. Prefill GEMMs over a 1882-token prompt 4.06 -> 1.66 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
SPV_INTEL_subgroup_matrix_multiply_accumulate gives DPAS on operands in registers (dpas_f16 in
xe2_common.h; libxe2's link enables the extension). Its B operand is a lane's column as dwords of
fp16 pairs, which is what a lane decodes from its codes, so the 2 <= M <= 16 m2xfp4 GEMM no longer
writes the decoded weights to local memory and reads them back as a joint_matrix tile; the
activation is transposed once so a lane's A column is one 16-byte load. 15-20% a call at M = 8
(N=34816 K=5120 518 -> 463 us, N=5120 K=17408 312 -> 249 us). Same products: rel_l2 at most
1.46e-3 as before (185/185 model cases). XE2_M2_JM=1 keeps the local-memory form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
One work-group a row; a quantisation group a sub-group. The arithmetic is libref's step for step,
and two things made it so on the card:
- Device code is generated at link time (AOT), so the flags that shape it now go to the link as
well as the compile: -ffp-contract=off, -ffp-model=precise, and -foffload-fp32-prec-div/-sqrt.
Without correctly rounded division a group's scale amax * (1/448) came out one ulp off, and
bf16 inputs sit exactly on E4M3 rounding ties often enough that 1780 of 524288 codes moved
(a standalone host/device comparison showed it; with the flags, none).
- The sum of squares is libref's ascending f32 sum, by one work-item. A tree reduction moved
normed values across bf16 ties on MiniCPM5-2B's real weights and failed rmsnorm_quant_fp8 at
M=1 (rel 7.7e-3 against its 4e-3 tolerance).
rad-kbench against libref: the fixture 228/228 and MiniCPM5-2B's container 140/140, worst rel_l2
1e-7, inside guarded allocations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
libxe2 is a kernel plugin like any other, built by rad_add_plugin from the icpx sub-build into the
build tree's $RADIANCE_HOME. It declares no schemas (every op it serves is libref's vocabulary), only
device rows, written with designated initialisers. xe2_common.h holds what every kernel needs: the
launch's queue (rad_sycl.h), row views over padded operands, refusals that name the geometry, and
libref's own dtype conversions so results round where the reference's do.
add passes rad-kbench against libref at tolerance zero, on the recorded fixture (30 cases) and on
MiniCPM5-2B's container (20 cases), inside guarded allocations. In a SYCL build the kbench replays
run libxe2 on the card, so they are labelled sycl there, as they are gpu in a HIP build.
scripts/sycl/notify.sh posts to the Discord webhook when the port needs the user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1