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
reverse(::JLArray) errors with GPUArrays 12.1.1 and JLArrays 0.4.2 (JLArrays release missing) #817
Since GPUArrays 12.1.1, reverse of a JLArray vector throws with the latest registered JLArrays (0.4.2):
julia>using JLArrays # JLArrays v0.4.2, GPUArrays v12.1.1, AcceleratedKernels v0.5.6, KernelAbstractions v0.9.45
julia>reverse(JLArray(Float32[1, 2, 3, 4, 5]))
ERROR: This kernel is unavailable for backend CPU
julia>reverse(JLArray(Float32[1, 2, 3, 4, 5]), 2, 4)
ERROR: This kernel is unavailable for backend CPU
Both calls work with GPUArrays 12.1.0. They also work with GPUArrays 12.1.1 if JLArrays is installed from main:
I tested this with Julia 1.10.12, 1.11 and 1.13 (macOS aarch64). It also happens on Ubuntu x64 and x86 in CI.
Cause
#815 changed reverse(v::AnyGPUVector, start, stop) to call AK.reverse (or to reverse into a new array with AK.reverse!). AcceleratedKernels' kernels are not available on the JLArrays back-end. The same PR added a ranged Base.reverse(v::AnyJLVector, start, stop) method to lib/JLArrays/src/sorting.jl to avoid that path, but no JLArrays version with that method has been released. lib/JLArrays/Project.toml on main still says 0.4.2, and the registered 0.4.2 does not include the method. In 0.4.2, reverse(v::AnyJLVector) calls invoke(reverse, Tuple{AbstractVector}, v), which goes on to the ranged method from GPUArrays and so reaches AK.reverse.
Suggested fix
Release JLArrays 0.4.3 with the version bump. It may also be worth checking that GPUArrays releases that rely on new JLArrays methods are only released together with a matching JLArrays release.
Activity
Mark JLArray `reverse` tests broken with JLArrays 0.4.2 and GPUArrays…
Mark JLArray `reverse` tests broken with JLArrays 0.4.2 and GPUArrays…