CPU backend: `Base.checked_mul` in a kernel fails to build (`__spirv_SMulExtended` missing in PoCL)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- julia
- Domain
- backend, testing-qa
Research direction
Start by reproducing the provided kernel on CPU() with KernelAbstractions 0.10.1 and inspect how Base.checked_mul is lowered through GPUCompiler and SPIR-V for the PoCL backend. The report identifies no repository files or test entry points, so first locate existing CPU kernel compilation tests and add a focused regression case for Int32 and Int64. Done when the kernel builds and the checked multiplication behavior is covered by a passing test on PoCL.
Written by the indexing model from the issue text.
Description
AI agent:
On KernelAbstractions 0.10.1, a kernel on CPU() that calls Base.checked_mul fails to build: PoCL's kernel library has no __spirv_SMulExtended. It fails for Int64 and Int32 alike. Arithmetic on Rational{Int} multiplies with overflow checks, so it fails too. That is how we found it, in NNlib's upsample_bilinear, whose Rational{Int} test passes on KernelAbstractions 0.9.
using KernelAbstractions
@kernel function mul!(y, @Const(x))
i = @index(Global)
@inbounds y[i] = Base.checked_mul(x[i], x[i])
end
x = collect(1:4)
mul!(CPU())(similar(x), x; ndrange=4)
Failed to compile program
Build log:
Error(s) while linking:
Cannot find symbol _Z20__spirv_SMulExtendedll in kernel library
Device cpu-skylake-avx512-AMD Ryzen Threadripper PRO 9955WX 16-Cores failed to build the program
followed by CLError(-11). Presumably llvm.smul.with.overflow becomes OpSMulExtended in SPIR-V, which PoCL doesn't implement.
Julia 1.13.2, KernelAbstractions 0.10.1, GPUCompiler 2.16.0, SPIRVIntrinsics 1.5.0, SPIRV_LLVM_Backend_jll 23.1.1+8, pocl_standalone_jll 7.2.2+12.
- Dominant language
- Julia
- Stars
- 533
- Forks
- 90
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGPU/KernelAbstractions.jl
-
good first issue runtime
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
JuliaGPU/KernelAbstractions.jl#691 · 2 comments ·
Maintainers usually reply within 1 day
-
Enzyme reverse mode: `prod(ndrange)` fails for kernels with a construction-time ndrangePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 52/100
JuliaGPU/KernelAbstractions.jl#924 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
JuliaGPU/KernelAbstractions.jl#921 ·
Maintainers usually reply within 1 day
-
kernels pocl upstream
Difficulty 5/5 Over a week Newbie friendliness 12/100
JuliaGPU/KernelAbstractions.jl#894 ·
Maintainers usually reply within 1 day
-
kernels performance pocl upstream
Difficulty 5/5 Over a week Newbie friendliness 12/100
JuliaGPU/KernelAbstractions.jl#893 ·
Maintainers usually reply within 1 day
All issues in JuliaGPU/KernelAbstractions.jl
Similar issues
-
`SplitRungeKutta` time steppers never call `update_lagrangian_particle_state!`, so particle `tracked_fields` are never updatedPossibly taken @ali-ramadhan claimed this today. Openbug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
CliMA/Oceananigans.jl#6381 ·
Maintainers usually reply within 1 day
-
ci system:windows test
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)Open
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
NumericalEarth/Breeze.jl#1143 ·
Maintainers usually reply within 1 day
-
format-check (Runic) is red on master: formatter drift on ~200 filesPossibly taken @ChrisRackauckas-Claude claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SciML/ModelingToolkit.jl#5337 · 1 comment ·
Maintainers usually reply within 3 days
-
bug parsers
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lanl-ansi/GasModels.jl#366 ·