Crescent Island (cri) support for the XPU/SYCL build - #734
Open
jiqing-feng wants to merge 10 commits into
Open
Conversation
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
ocloc 25.35 rejects the 'cri' device (Failed to parse target: cri - invalid device), which breaks the pvc,bmg,cri fat-binary link. Bump compute-runtime to 26.22.38646.4 (IGC v2.36.3, gmmlib 22.10.0) whose ocloc recognises cri.
The v0.9.1 tag predates the Crescent Island (cri) reverse-kernel support; pin to the upstream commit that landed it (sycl-tla d54352d, 'Upstream CRI code #833') so the Nix build can compile the cri AOT images. Revert to a released tag once one containing cri is available.
Build one .so with three AOT images. fp16/bf16 kernels compile for intel_gpu_pvc,intel_gpu_bmg_g21,spir64_gen; MXFP kernels are gated behind __SYCL_TARGET_INTEL_GPU_CRI__ and compile spir64_gen-only, AOT-lowered to cri via -device cri. Emit one -Xspirv-translator=<alias> per offload target so the custom -spirv-ext reaches every image (translator replaces, not merges).
jiqing-feng
marked this pull request as draft
July 29, 2026 07:15
The tri-target AOT-only build dropped the spir64 image, so sycl-tla kernels only loaded on pvc/bmg/cri. Re-add spir64 alongside the AOT targets to restore JIT coverage for other Intel GPUs. MXFP is absent from the JIT image, which is harmless since its dispatch is gated on device IP version >= 35 at runtime. Also align the sycl-tla revision across both paths. The non-nix FetchContent fallback pinned v0.9.1, which carries cri only as a placeholder constant and none of the Xe35 block-scaled kernels. nix-builder already pinned d54352d; v0.9.2 is exactly that commit, so both now use the tag and the source hash is unchanged.
…2026.0 The previous cri work passed -Xsycl-target-backend=spir64_gen only, which reaches the generic image alone, so the intel_gpu_pvc and intel_gpu_bmg_g21 alias images silently lost their backend options. Emitting one option per target then hit CMake's link-option deduplication, which dropped every repeated -options and made ocloc parse the next flag as its value, so use SHELL: to keep each pair intact. cri has no intel_gpu_* alias and is only reachable as a -device of the generic image. Only a kernel with an Xe35-only TU needs alias targets to keep MXFP code away from pvc/bmg; every other kernel can lower one generic image to all three devices, halving the device compilations per TU. Also gate the AOT device list on DPCPP 2026.0, since cri needs sycl-tla v0.9.2 and ocloc 26.22, and fail the build when the SPIR-V extension probe fails instead of silently dropping the compiler's default extensions.
jiqing-feng
marked this pull request as ready for review
August 5, 2026 08:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Intel Crescent Island (
cri) as an AOT target for SYCL kernels.Why it isn't just one more device in the list
crineeds a newer toolchain:ocloc25.35 doesn't know the device, andsycl-tla 0.9.1 has no cri kernels. Both are bumped (ocloc → 26.22.38646.4,
sycl-tla → 0.9.2), and AOT for cri is gated on DPC++ 2026.0.
The bigger problem is that a kernel compiled with
__SYCL_TARGET_INTEL_GPU_CRI__contains Xe35-only MXFP code that
oclocrefuses to lower for pvc or bmg. Sosuch a translation unit can't share one AOT image across devices. The build now
detects that flag and picks the layout:
spir64_genimage servespvc,bmg-g21,cri, which keepsthe number of device compilations per TU down;
cri, and pvc/bmg get separateintel_gpu_*alias targets.Either way the
.soalso carries aspir64JIT fallback, so a GPU that isn'tin the AOT list still runs.
Why the flag handling was rewritten
The SYCL flags used to be two hardcoded strings that dependencies patched with
string(REPLACE ...). That stops working once the target list is dynamic, andit hid three failure modes that all produce a binary that builds fine and then
misbehaves:
identical
-optionsstrings, silently dropping every target but the first —SHELL:prevents this;-spirv-extonly reaches the image whose triple matches the exact-fsycl-targetsalias, so it has to be emitted once per target;driver defaults are now probed with
icpx -###and sycl-tla's extras appended.A failed probe is a hard error rather than a silent fallback.
Flags are now built from a few variables through a
xpu_compose_sycl_flags()macro, so a dependency changes a variable and recomposes.
Validation
Built
flash-attn2andmegablocksfromkernels-communityagainst thisbranch (
torch213-cxx11-xpu20260-x86_64-linux) and checked numerics on bothBMG hardware and the CRI TBX simulator. Each case runs only the kernel on XPU;
data generation, the fp32 reference, MXFP4/MXFP8 dequantization and error
statistics stay on CPU.
max abs error 5.4e-04 (fp16) / 4.0e-03 (bf16).
relative error 2.6e-03.