From d2a6c8bda2b9aabd0513aa7e706c80cf3fa2051c Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Thu, 22 Oct 2026 06:58:54 +0000 Subject: [PATCH 1/2] Gate XPU AOT compilation on a minimum DPC++ version The AOT gate in dep-sycl-tla.cmake matched DPCPP_VERSION against an explicit list that stops at 2026.0. DPC++ 2026.1 -- used by every current XPU build variant, including torch214-xpu20261 -- falls through to the else branch and ships JIT-only device code with none of the sycl-tla SPIR-V extensions, which is several times slower on Intel GPUs. Both lists were already contiguous ranges, so compare versions instead. A missing entry does not fail the build, it silently degrades performance, so new DPC++ releases should have to opt out of AOT rather than opt in. --- .../src/pyproject/templates/xpu/dep-sycl-tla.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake b/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake index deca5ee5..00efdb77 100644 --- a/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake +++ b/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake @@ -70,8 +70,10 @@ if(SYCL_TLA_REVISION MATCHES "^v3\\.9") endif() # Fat binary: AOT images for SYCL_AOT_DEVICES plus a spir64 JIT fallback. -# cri needs sycl-tla v0.9.2 and ocloc >= 26.22, so only 2026.0 gets AOT images. -if(DPCPP_VERSION STREQUAL "2026.0") +# cri needs sycl-tla v0.9.2 and ocloc >= 26.22, first shipped in DPC++ 2026.0. +# Gate on a minimum: an unlisted version silently falls back to slow JIT-only. +set(DPCPP_AOT_MIN_VERSION "2026.0") +if(DPCPP_VERSION VERSION_GREATER_EQUAL DPCPP_AOT_MIN_VERSION) set(SYCL_AOT_DEVICES "{{ sycl_aot_devices }}") set(SYCL_OFFLOAD_TARGETS "{{ sycl_offload_targets }}") else() @@ -81,8 +83,10 @@ endif() # sycl-tla needs extra extensions (split-barrier always; block-IO and # matrix-multiply on newer DPCPP). Since the translator replaces the whole # -spirv-ext list, we query the driver's defaults and append the extras. +# Gate on a minimum: an unlisted version silently loses block-IO and DPAS. +set(DPCPP_BLOCK_IO_MIN_VERSION "2025.2") set(_sycl_tla_extra_ext "+SPV_INTEL_split_barrier") -if(DPCPP_VERSION STREQUAL "2025.2" OR DPCPP_VERSION STREQUAL "2025.3" OR DPCPP_VERSION STREQUAL "2026.0" OR SYCL_TLA_REVISION STREQUAL "v0.5") +if(DPCPP_VERSION VERSION_GREATER_EQUAL DPCPP_BLOCK_IO_MIN_VERSION OR SYCL_TLA_REVISION STREQUAL "v0.5") string(APPEND _sycl_tla_extra_ext ",+SPV_INTEL_2d_block_io,+SPV_INTEL_subgroup_matrix_multiply_accumulate") endif() From 2278b15c980024f01d7b92e6f0ee822fb754ae47 Mon Sep 17 00:00:00 2001 From: jiqing-feng Date: Fri, 23 Oct 2026 05:35:48 +0000 Subject: [PATCH 2/2] Bump sycl-tla to v0.9.3 for DPC++ 2026.x sycl-tla v0.9.2 rewrote the flash-attention v2 forward mainloop and introduced a performance regression on Intel GPUs. On an Arc Pro B60 (BMG) the forward kernel is up to 8x slower than with v0.8, and the gap grows with sequence length. v0.9.3 fixes it. Measured with an otherwise identical flash-attn2 build (same sources, same compiler, same flags, same card, cold cache); only the sycl-tla include path was swapped. Times are fp16, causal, head_dim 64: B x S x H x D v0.8 v0.9.2 v0.9.3 4x512x8x64 0.091 ms 0.145 ms 0.100 ms 4x1024x8x64 0.217 ms 0.509 ms 0.143 ms 4x2048x8x64 0.391 ms 3.291 ms 0.432 ms 4x2048x16x64 0.729 ms 6.891 ms 0.817 ms 8x1024x8x64 0.219 ms 1.134 ms 0.244 ms v0.9.3 restores v0.8 performance and improves on it at 1024. The v0.9.2 numbers match what the published kernels-community/flash-attn2 torch214-xpu20261 build does today (3.347 ms at 4x2048x8x64), so this regression is what users currently get from the Hub. cri kernel support is retained; v0.9.3 was verified to compile for the pvc, bmg-g21 and cri AOT targets. --- .../src/pyproject/templates/xpu/dep-sycl-tla.cmake | 5 +++-- nix-builder/pkgs/xpu-packages/sycl-tla.nix | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake b/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake index 00efdb77..53864850 100644 --- a/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake +++ b/kernel-builder/src/pyproject/templates/xpu/dep-sycl-tla.cmake @@ -5,8 +5,9 @@ find_package(SyclTla) if(DPCPP_VERSION STREQUAL "2025.3") set(SYCL_TLA_REVISION "v0.8" CACHE STRING "sycl-tla revision to use") elseif(DPCPP_VERSION STREQUAL "2026.0" OR DPCPP_VERSION STREQUAL "2026.1") - # v0.9.2 == the rev pinned in nix-builder; v0.9.1 has no cri kernel support. - set(SYCL_TLA_REVISION "v0.9.2" CACHE STRING "sycl-tla revision to use") + # v0.9.1 has no cri kernel support. v0.9.2 has a flash-attention forward + # regression (up to 8x slower than v0.8 on BMG) that is fixed in v0.9.3. + set(SYCL_TLA_REVISION "v0.9.3" CACHE STRING "sycl-tla revision to use") else() message(FATAL_ERROR "Unknown DPCPP_VERSION: ${DPCPP_VERSION}") endif() diff --git a/nix-builder/pkgs/xpu-packages/sycl-tla.nix b/nix-builder/pkgs/xpu-packages/sycl-tla.nix index 33a91b9e..7bc20924 100644 --- a/nix-builder/pkgs/xpu-packages/sycl-tla.nix +++ b/nix-builder/pkgs/xpu-packages/sycl-tla.nix @@ -19,12 +19,12 @@ let hash = "sha256-xXAxIDBesjDDOIa6/YsGznyW+5+NpaO1L96lBuqRzrk="; }; "2026.0" = { - version = "0.9.2"; - hash = "sha256-Hn51Ah1wEscOnrt9O/aXBW7IC6Mcl4gUWynAmDeAOlM="; + version = "0.9.3"; + hash = "sha256-HOUvysPiTdsJaP2gxfq0MTVOyJF4wmZ7wHDUrIfzlSE="; }; "2026.1" = { - version = "0.9.2"; - hash = "sha256-Hn51Ah1wEscOnrt9O/aXBW7IC6Mcl4gUWynAmDeAOlM="; + version = "0.9.3"; + hash = "sha256-HOUvysPiTdsJaP2gxfq0MTVOyJF4wmZ7wHDUrIfzlSE="; }; }; syclTlaVersion =