You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BFloat16 kernels fail with InvalidIRError, and Int128 kernels segfault the SPIR-V translator #783
System: Intel Data Center GPU Max 1550 (8 devices), system compute runtime 25.18 (see #777), Julia 1.13.4, oneAPI.jl 2.10.0, GPUCompiler 2.24.1, KernelAbstractions 0.10.9, BFloat16s 0.6.5.
The kernel, run once with T = BFloat16 and once with T = Int128:
using oneAPI, KernelAbstractions, BFloat16s
@kernelfunctionk!(y, @Const(x))
i =@index(Global)
@inbounds y[i] = x[i] * x[i] + x[i]
end
T = BFloat16 # or Int128
x =oneArray(T.(1:32)); y =similar(x)
k!(oneAPIBackend(), 32)(y, x; ndrange=32)
BFloat16: compilation fails with InvalidIRError: … Reason: unsupported use of bfloat value. Allocating the oneArray works, because _device_supports_bfloat16 returns true for this device, so arrays are accepted but no arithmetic on them compiles. If BFloat16 arithmetic isn't meant to be supported, an error when the array is created, or a note in the docs, would make this clearer. If it is meant to be supported, I suppose the arithmetic could be done in Float32 and the result converted back to BFloat16.
Int128 / UInt128: compilation crashes the process with a segfault in the SPIR-V translator, which can't be caught:
signal 11: Segmentation fault
SPIRV::LLVMToSPIRVBase::transValueWithoutDecoration(...) at .../artifacts/c72cc4dc.../lib/libllvm_spirv.so
SPIR-V has no 128-bit integers, so this can't work, but it should fail with an error. Rejecting 128-bit integers in the IR validation (like the bfloat check) or in oneArray, the way Metal.jl does ("Metal does not support Int128 values, try using Int64 instead"), would avoid the crash.
Found while adding element-type detection to GPUSelect.jl. On the other backends, the same kernel works for BFloat16 and Int128 on CUDA.jl 6.5.1 and AMDGPU.jl 2.13.1. Metal.jl rejects Int128 with an error.
Int128: SPIR-V has no 128-bit integers, and unlike the LLVM SPIR-V back-end, the Khronos translator used with ONEAPI_LTS=1 runs in-process and crashes on them (even on an unused Int128 kernel argument). GPUCompiler 2.26 now rejects them during IR validation, like it does for Metal, so the kernel fails with a catchable InvalidIRError (JuliaGPU/GPUCompiler.jl#1144).
BFloat16 on LTS: this is expected with ONEAPI_LTS=1. The LTS SPIR-V stack can't handle the bfloat type at all, not even loads and stores, so computing in Float32 wouldn't help there. It's documented in the LTS and troubleshooting pages of the docs. Arrays are still allowed because copies and oneMKL routines don't need kernels that compute on the elements.
BFloat16 on the regular stack: while looking into this I found that the kernel compiles but returns wrong results: IGC rounded BFloat16 +, - and * towards zero, and abs(Float32(x)) of a BFloat16 x came out negative. Both are fixed in IGC 2.43, and backported to our libigc build in JuliaPackaging/Yggdrasil#15905; updating your packages will pick that up. Regression tests are in #794.
Activity
maleadt commentedon Dec 3, 2026
Thanks for the report.
Int128: SPIR-V has no 128-bit integers, and unlike the LLVM SPIR-V back-end, the Khronos translator used with
ONEAPI_LTS=1runs in-process and crashes on them (even on an unusedInt128kernel argument). GPUCompiler 2.26 now rejects them during IR validation, like it does for Metal, so the kernel fails with a catchableInvalidIRError(JuliaGPU/GPUCompiler.jl#1144).BFloat16 on LTS: this is expected with
ONEAPI_LTS=1. The LTS SPIR-V stack can't handle thebfloattype at all, not even loads and stores, so computing in Float32 wouldn't help there. It's documented in the LTS and troubleshooting pages of the docs. Arrays are still allowed because copies and oneMKL routines don't need kernels that compute on the elements.BFloat16 on the regular stack: while looking into this I found that the kernel compiles but returns wrong results: IGC rounded BFloat16
+,-and*towards zero, andabs(Float32(x))of a BFloat16xcame out negative. Both are fixed in IGC 2.43, and backported to our libigc build in JuliaPackaging/Yggdrasil#15905; updating your packages will pick that up. Regression tests are in #794.