libxe2: m2xfp4 verify GEMM on register DPAS -- no local-memory round trip

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
This commit is contained in:
pascallinxweilerandClaude Opus 5.5 committed 2026-10-24 13:56:02 +02:00
1 parent 84732432c0
commit b0e34c6324
3 files changed
+114 -5

No files matched your search

+4 -1
View File
@@ -29,8 +29,11 @@ rad_add_plugin(libxe2 kernels SOURCES ${XE2_SRC})
# codes that sit exactly on an E4M3 rounding tie, which bf16 inputs hit often.
# Device code is generated at link time (AOT), so every flag that shapes it goes to the link too;
# on the compile line alone it changes nothing on the card.
# SPV_INTEL_subgroup_matrix_multiply_accumulate: DPAS on operands in registers (xe2_common.h's
# dpas_f16), for kernels that decode a weight straight into the B operand.
set(_xe2_sycl -fsycl "-fsycl-targets=${RAD_SYCL_TARGETS}" -ffp-model=precise -ffp-contract=off
-Wno-overriding-option -foffload-fp32-prec-div -foffload-fp32-prec-sqrt)
-Wno-overriding-option -foffload-fp32-prec-div -foffload-fp32-prec-sqrt
"SHELL:-Xspirv-translator -spirv-ext=+SPV_INTEL_subgroup_matrix_multiply_accumulate")
target_compile_options(libxe2 PRIVATE ${_xe2_sycl} -fvisibility=hidden)
get_filename_component(_xe2_icpx_bin "${CMAKE_CXX_COMPILER}" DIRECTORY)
get_filename_component(_xe2_oneapi_lib "${_xe2_icpx_bin}/../lib" ABSOLUTE)