From 8ac56980ebccfa85888dd72b7ca71d37852b29b2 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 12 Oct 2026 21:29:35 +0200 Subject: [PATCH 1/4] Fix the import conflicts warned about when precompiling on Julia 1.10 `using .POCL` brought in POCL's `@device_code_*` macros, which clash with KernelAbstractions' own, and POCL's `using LLVM.IR` clashed with its `context`. Import only the names that are used. --- src/KernelAbstractions.jl | 2 +- src/pocl/pocl.jl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/KernelAbstractions.jl b/src/KernelAbstractions.jl index b7cb5c36d..40f0a8f24 100644 --- a/src/KernelAbstractions.jl +++ b/src/KernelAbstractions.jl @@ -750,7 +750,7 @@ end # CPU backend include("pocl/pocl.jl") -using .POCL +using .POCL: POCL, POCLBackend export POCLBackend """ diff --git a/src/pocl/pocl.jl b/src/pocl/pocl.jl index 37c3e3b82..ecfe621b4 100644 --- a/src/pocl/pocl.jl +++ b/src/pocl/pocl.jl @@ -96,7 +96,10 @@ function queue() end using GPUCompiler -using LLVM, LLVM.IR, LLVM.Build, LLVM.Interop +using LLVM, LLVM.Build, LLVM.Interop +# not all of LLVM.IR, whose `context` would clash with ours +using LLVM.IR: BasicBlock, ConstantArray, ConstantInt, DILocation, GlobalVariable, LLVMType, + MDNode, MD_invariant_load, MD_tbaa, MemoryEffects, StringAttribute, Value using SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll using Adapt From 7dec994f19165cf0c120eb4af6add6d8f6f16639 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 12 Oct 2026 21:29:35 +0200 Subject: [PATCH 2/4] Reword the 0.10 release notes on KernelInterface sub-groups KernelInterface 0.3 already had the sub-group ids, `sub_group_barrier` and `shfl_down`; say what 0.4 adds, and that the layout guarantee moved behind `supports_linear_subgroups`. Also fix the `cpu=` option's deprecation version, which said 0.11, and a few typos. --- docs/src/index.md | 20 +++++++++++++------- src/KernelAbstractions.jl | 6 +++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 4a117e1b3..79ccb47d1 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -157,8 +157,10 @@ end the CPU backend became an OpenCL backend meant every backend. Use `KernelAbstractions.@device_code_llvm` and `KernelAbstractions.@device_code_typed` instead, which report on the code a backend actually generates; see [Reflection](@ref). -- `KernelAbstractions.GPU` is deprecated: and backends should now subtype `KernelAbstractions.Backend` directly. `GPU` is now an alias of `Backend` and will be removed in a future release. Code dispatching on `::GPU` should dispatch on `::Backend`, on concrete - backend types, or on a capability such as `KernelAbstractions.supports_float64`. +- `KernelAbstractions.GPU` is deprecated, and backends should subtype + `KernelAbstractions.Backend` directly. `GPU` is now an alias of `Backend` and will be + removed in a future release. Code dispatching on `::GPU` should dispatch on `::Backend`, on + concrete backend types, or on a capability such as `KernelAbstractions.supports_float64`. - An exception thrown in a kernel on the `CPU` backend is reported as a `KernelAbstractions.POCL.KernelException` when the kernel has completed, like on GPU backends, and no longer as the original exception (e.g., a `BoundsError`). Depending on @@ -203,11 +205,15 @@ end than with 0.9. - `foreach_index(f, A)` runs `f` once per index of the array `A` without writing a kernel out, and `foreach_index(f, backend, indices)` once per index in a range or `CartesianIndices`. -- KernelInterface 0.4 adds sub-groups: ids, shuffles, votes, reductions and scans, also +- KernelInterface 0.4 extends its sub-groups beyond the ids, `sub_group_barrier` and + `shfl_down` of 0.3: `shfl`, `shfl_up` and `shfl_xor` of any `isbits` value, the votes + `sub_group_any`, `sub_group_all` and `sub_group_ballot`, and reductions and scans, also within segments of a sub-group. They are the low-level API for backends, for kernels - written against KernelInterface and for kernel languages built on it; capability queries - say how a backend forms its sub-groups, whether they may diverge, and which types it can - shuffle. See [Sub-groups](@ref ki_subgroups). + written against KernelInterface and for kernel languages built on it. KernelInterface no + longer promises how work-items form sub-groups: `supports_linear_subgroups` says whether + they are consecutive work-items, and `supports_independent_subgroups` and + `supports_partitionable_subgroups` whether sub-groups and their segments may diverge. See + [Sub-groups](@ref ki_subgroups). - [`@groupreduce`](@ref) and [`@groupscan`](@ref) reduce and scan a value over the workgroup, on every backend. `@groupreduce` uses sub-groups internally where the backend can shuffle the values. See [Reductions and scans](@ref group_collectives). @@ -218,7 +224,7 @@ end 1. The kernels are automatically bounds-checked against either the dynamic or statically provided `ndrange`. -2. Kernels implictly return `nothing` +2. Kernels implicitly return `nothing` ## Contributing Please file any bug reports through Github issues or fixes through a pull diff --git a/src/KernelAbstractions.jl b/src/KernelAbstractions.jl index 40f0a8f24..1548b6509 100644 --- a/src/KernelAbstractions.jl +++ b/src/KernelAbstractions.jl @@ -19,8 +19,8 @@ using KernelInterface: KernelInterface, Backend, get_backend, functional, synchr import KernelInterface as KI export KernelInterface -# `GPU` is deprecated in 0.10: and backends ends now subtype `Backend` directly. Keep the name working for code written -# against 0.9, both `x::GPU` and `struct MyBackend <: GPU`. +# `GPU` is deprecated in 0.10, and backends now subtype `Backend` directly. Keep the name +# working for code written against 0.9, both `x::GPU` and `struct MyBackend <: GPU`. Base.@deprecate_binding GPU Backend """ @@ -85,7 +85,7 @@ end This allows for the following configurations: -1. `cpu={true, false}`: **Deprecated** in KernelAbstractions 0.11; this option is ignored. +1. `cpu={true, false}`: **Deprecated** in KernelAbstractions 0.10; this option is ignored. 2. `inbounds={false, true}`: Enables a forced `@inbounds` macro around the function definition in the case the user is using too many `@inbounds` already in their kernel. Note that this can lead to incorrect results, crashes, etc and is fundamentally unsafe. Be careful! 3. `unsafe_indices={false, true}`: Disables the implicit validation of indices, users must avoid `@index(Global)`. 4. `generated={false, true}`: Turns the kernel into a [generated function](https://docs.julialang.org/en/v1/manual/metaprogramming/#Generated-functions), see *Generated* below. From 6c0e7f7e433d62e2214c111783b18c744f7f619d Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 12 Oct 2026 21:29:35 +0200 Subject: [PATCH 3/4] Raise the GPUToolbox floor, and tag KernelInterface releases GPUToolbox 3.3.2 requires LLVM 9 or earlier, so with LLVM 10 the effective lower bound was already 3.3.3. TagBot only tagged the root package; add a job for lib/KernelInterface, whose 0.2 and 0.3 releases went untagged. --- .github/workflows/TagBot.yml | 9 +++++++++ Project.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index f49313b66..38aa9223e 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -13,3 +13,12 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} ssh: ${{ secrets.DOCUMENTER_KEY }} + TagBot-KernelInterface: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} + subdir: lib/KernelInterface diff --git a/Project.toml b/Project.toml index 674ae8d82..ae8d6eef7 100644 --- a/Project.toml +++ b/Project.toml @@ -43,7 +43,7 @@ StaticArraysExt = "StaticArrays" Adapt = "0.4, 1.0, 2.0, 3.0, 4" Atomix = "1.5" GPUCompiler = "2.13" -GPUToolbox = "3.3.2" +GPUToolbox = "3.3.3" KernelInterface = "0.4" LLVM = "10" LinearAlgebra = "1.6" From ff62f40dda1c2c27bd5cdea26f787c4bd9c30259 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 12 Oct 2026 21:29:35 +0200 Subject: [PATCH 4/4] CI: test the back ends' main branches The back ends' KernelInterface 0.4 support is merged into their default branches, so stop testing the sub-group branches (added temporarily in #831) and the ka-0.10 branches before them. --- .buildkite/pipeline.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ac6a29b58..ab115d5cc 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -26,7 +26,7 @@ steps: Pkg.develop([PackageSpec(; name="KernelAbstractions", path=pwd()), PackageSpec(; name="KernelInterface", path=joinpath(pwd(), "lib", "KernelInterface"))])' || exit 3 echo "--- :julia: Developing CUDA" - julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/CUDA.jl vc/ki-subgroup-ops \ + julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/CUDA.jl main \ CUDACore CUDATools lib/cusolver lib/curand lib/cublas lib/cufft lib/cusparse lib/cupti lib/nvml lib/custatevec lib/cudnn lib/cutensor lib/cutensornet || exit 3 julia -e 'println("+++ :julia: Running tests") @@ -64,7 +64,7 @@ steps: Pkg.develop([PackageSpec(; name="KernelAbstractions", path=pwd()), PackageSpec(; name="KernelInterface", path=joinpath(pwd(), "lib", "KernelInterface"))])' || exit 3 echo "--- :julia: Developing Metal" - julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/Metal.jl vc/ki-subgroup-ops || exit 3 + julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/Metal.jl main || exit 3 julia -e 'println("+++ :julia: Running tests") using Pkg check = joinpath(pwd(), ".buildkite", "check_sources.jl") @@ -102,7 +102,7 @@ steps: julia -e 'println("--- :julia: Developing oneAPI") using Pkg Pkg.add(url="https://github.com/JuliaGPU/AcceleratedKernels.jl", rev="main")' || exit 3 - julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/oneAPI.jl tb/ki-subgroup-ops || exit 3 + julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/oneAPI.jl main || exit 3 julia -e 'println("+++ :julia: Running tests") using Pkg @@ -142,7 +142,7 @@ steps: julia -e 'println("--- :julia: Developing AMDGPU") using Pkg Pkg.add(url="https://github.com/JuliaGPU/AcceleratedKernels.jl", rev="main")' || exit 3 - julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/AMDGPU.jl vc/ki-subgroup-ops || exit 3 + julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/AMDGPU.jl main || exit 3 julia -e 'println("+++ :julia: Running tests") using Pkg @@ -180,7 +180,7 @@ steps: Pkg.develop([PackageSpec(; name="KernelAbstractions", path=pwd()), PackageSpec(; name="KernelInterface", path=joinpath(pwd(), "lib", "KernelInterface"))])' || exit 3 echo "--- :julia: Developing OpenCL" - julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/OpenCL.jl tb/ki-subgroup-ops lib/intrinsics || exit 3 + julia .buildkite/develop_backend.jl https://github.com/JuliaGPU/OpenCL.jl main lib/intrinsics || exit 3 julia -e 'println("+++ :julia: Running tests") using Pkg