Repository navigation
[JLArrays] Support KA 0.10 - #826
Open
christiangnrd wants to merge 6 commits into
Open
christiangnrd wants to merge 6 commits into
christiangnrd wants to merge 6 commits into
Conversation
christiangnrd
force-pushed
the
jlka0.10
branch
from
October 20, 2026 14:31
6c081b4 to
cbe82c2
Compare
Member
Author
|
I bumped CI timeout to 90 minutes since the POCL backend of KA 0.10 increases testsuite runtime and the macOS runners with only 1 job were right on the edge (either side) I cancelled the latest Buildkite run since the GHA timeout increase was the only change since the last successful run. |
christiangnrd
force-pushed
the
jlka0.10
branch
from
October 22, 2026 14:34
7dd9c6b to
0266f3c
Compare
With KernelAbstractions 0.10, JLArray kernels run on its POCL back-end. Drop the KA 0.9 code paths, including JLDeviceArray, and convert JLArrays to POCL device arrays. Leave `Ref`s to POCL's conversion after converting their contents, so that `Ref`s of types, as passed by `convert.(T, A)`, are handled too. POCL's SPIR-V back-end cannot lower 128-bit integers, so stop testing Int128 with JLArrays.
Make JLBackend a KernelInterface back-end, like the GPU back-ends that moved to KernelAbstractions 0.10: it converts arguments to POCL's and forwards compilation, launches and device queries to the POCL back-end. Run the KernelAbstractions and KernelInterface testsuites on it, skipping the dense-to-sparse test, which JLArrays don't support, and the tests that only exercise KernelAbstractions' own CPU back-end. KA 0.10's CPU back-end has no static scheduling anymore, so this removes the `static` option of JLBackend.
KernelAbstractions narrows `@index` computations to Int32 on every back-end but POCL, because on POCL the narrowing keeps LLVM from vectorizing the loops over work-items. JLArray kernels run on POCL, but JLBackend isn't a POCLBackend, so they got Int32 indices. Using Int speeds up a 2048x2048 element-wise kernel by about 7%.
A JLArray was converted to a POCL device array by wrapping its memory in an Array and adapting that with a fresh KernelAdaptor, allocating both on every conversion, which happens several times per argument per launch. Construct the device array from the JLArray's pointer instead. This reduces the allocations of `c .= a .+ b` from 1344 to 480 bytes. Keep rejecting isbits-union element types, which the wrapping used to reject: POCL's device arrays read their type tags after the data, where JLArrays don't store any.
This was referenced Oct 27, 2026
Open
This branch has not been deployed
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.
JLArrays, the CPU reference back-end used to test GPUArrays and downstream packages without a GPU, still targets KernelAbstractions 0.9. The vendor back-ends (CUDA, AMDGPU, Metal, oneAPI, OpenCL) have moved to KernelAbstractions 0.10, which builds on KernelInterface, so a test environment using JLArrays can't move along with them.
This ports JLArrays to KernelAbstractions 0.10 and drops 0.9.
JLBackendbecomes a KernelInterface back-end in the same shape as the vendor ports: it converts arguments to POCL device arrays and forwards compilation, launches and device queries to KernelAbstractions' POCL back-end, which is what runs KA 0.10 kernels on the CPU. The KernelAbstractions and KernelInterface testsuites now run on JLArrays, skipping the same POCL-only tests the vendor back-ends skip.Along the way:
convert.(T, ::JLArray)failed to compile, because JLArrays wrappedRefs before POCL could recognize aRefof a type. JLArrays now converts only what theRefholds.Intlike POCL's own, instead of theInt32KernelAbstractions uses on GPUs, which keeps LLVM from vectorizing over work-items (~7% on a 2048×2048 element-wise kernel).c .= a .+ bgoes from 1344 to 480 bytes).This is breaking, hence JLArrays 0.5:
JLBackend(; static)is gone, since KA 0.10's CPU back-end has no static scheduling, and so isJLDeviceArray(JLArrays are POCLCLDeviceArrays in kernels). POCL's SPIR-V back-end cannot lower 128-bit integers, soInt128is no longer tested with JLArrays.The two testsuites add a few minutes to CI, and the macOS runners, which run tests one at a time, were already close to the 60-minute job limit, so the limit is raised to 90 minutes.
Stacked on #829.