Repository navigation
Prepare the GPUArrays 12 release - #804
Merged
Merged
Conversation
Adapt 4.7.2 adapts Base.Fix1/Fix2 field-wise. Before, a closure capturing one did not infer when adapted in device code, which is what KernelAbstractions' @const does, so findfirst/findlast with a Fix2 predicate failed to compile in AcceleratedKernels' reduction kernel on real GPUs. AcceleratedKernels 0.5 already needs KernelAbstractions 0.9.43.
The stub only existed so back-ends extending it kept loading; they need a new release for GPUArrays 12 anyway.
Composing affine maps is exact and catches swapped operands, including where block aggregates are combined, as in CUDA.jl#3339 for CUDA's own scan.
0.4.0 was never registered, so the release that requires GPUArrays 12 can take that number.
Add a NEWS.md listing what back-ends have to change and may delete, describe what a back-end needs for dense arrays, drop the outdated sortperm requirement for findnz, and fix the links to CUDA.jl's and AMDGPU.jl's array types.
Developing the back-end package was outside the try block, so a back-end whose main branch did not resolve failed the job instead of soft-failing it. Also annotate the GitHub Actions run when OpenCL.jl is skipped, since that job reports success.
Base throws a BoundsError there (from size(A, dims)), AcceleratedKernels an ArgumentError. Found by AMDGPU.jl's tests, which expect Base's error; the testsuite now compares against Base for out-of-range dims.
This was referenced Oct 7, 2026
findfirst/findlast reduce with a closure capturing the predicate, which KernelAbstractions' @const adapts in device code. Adapt failed to infer that for captured Fix2 and ComposedFunction predicates (fixed in Adapt 4.7.2 and JuliaGPU/Adapt.jl#124), which JLArrays can't detect but GPU back-ends running the testsuite can.
Iris Xe and other devices without Float64 can't run it; a Float32 init tests the same rule.
LinearAlgebra defines Base.mapreducedim! for Adjoint and Transpose sources with specific operators, which was ambiguous with GPUArrays' method for a GPU destination (#521). The extra methods send those calls to AcceleratedKernels like any other source.
Adapt 4.7.3 also adapts closures capturing a ComposedFunction (e.g. a !f predicate, as in cholesky(::Diagonal)) inferably, and on Julia 1.10 closures capturing closures.
Base's error there is incidental and differs between versions (a BoundsError from size(A, 0), or an ErrorException from arraysize), so matching it is not worth an extra check; an ArgumentError is what out-of-range dims give everywhere else (sortperm, dims > ndims). Test only those consistent cases.
Merged
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.
Preparation for tagging GPUArrays 12.0.0 (after #790), and for the back-end ports that have to follow it.
findfirst(>(0.5f0), ::CuArray)andfindlastfailed to compile on real GPUs: they reduce aBroadcastedover a closure capturing aBase.Fix2, and Adapt's closure rule made that uninferable when KernelAbstractions'@Constadapts it in device code (AcceleratedKernels' reduction kernel takes@Const(src)). Adapt Fix1 and Fix2 with their own rules Adapt.jl#123 fixed that and is released as 4.7.2. KernelAbstractions is raised to 0.9.43, which AK 0.5 already needs.src/deprecated.jlis removed: the old RNG constructors and theGPUArrays.default_rngstub, which only existed so back-ends extending it kept loading. They need a new release for 12 anyway.initanddims. CUDA.jl's own scan got this wrong (accumulategives wrong results for non-commutative operators CUDA.jl#3339). AK's scan is correct on CUDA; this makes every back-end check it.sortpermrequirement forfindnz, and links to CUDA.jl's moved sources.dimsin sorting.Base.mapreducedim!into a GPU array from anAdjoint/Transposematrix was ambiguous with LinearAlgebra's methods. Fixes Problem withBase.mapreducedim!#521.findfirst/findlasttests with predicates that have fields (!isnan,Fix2(>, x) ∘ abs, a closure capturing a value). They catch Adapt bugs that JLArrays can't; the remaining ones are fixed in Adapt 4.7.3, which this now requires.try, so a back-end whosemaindoesn't resolve soft-fails instead of failing the build. The OpenCL job on GitHub Actions still passes when OpenCL.jl can't be installed, but now adds a warning to the run.JLArrays testsuite passes on Julia 1.13. The back-end jobs here will keep soft-failing until the back-end ports land; these are JuliaGPU/CUDA.jl#3356, JuliaGPU/AMDGPU.jl#1145, JuliaGPU/oneAPI.jl#665 and JuliaGPU/OpenCL.jl#541 (Metal.jl to follow), all tested against this branch.