-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CUDA.jl kernel errors with Julia 1.9.0-rc3 #746
Labels
Comments
Yeah I think we need the code that produces this. |
Minimal reproducer below. This is on Julia 1.9.0-rc3, Enzyme main (4a0cb2b), CUDA 4.2.0 and StaticArrays 1.5.24. It does not error on Julia 1.8.5 and also if you replace using Enzyme, CUDA, StaticArrays, LinearAlgebra
function force(coord_i, coord_j)
ab = coord_j - coord_i
c = norm(ab) - 1.0
f = c * normalize(ab)
return f
end
function kernel!(fs, coords, is, js)
inter_i = (blockIdx().x - 1) * blockDim().x + threadIdx().x
@inbounds if inter_i <= length(is)
i, j = is[inter_i], js[inter_i]
f = force(coords[i], coords[j])
fs[1, i] += f[1]
end
return nothing
end
function grad_kernel!(fs, d_fs, coords, d_coords, is, js)
autodiff_deferred(
Reverse,
kernel!,
Const,
Duplicated(fs, d_fs),
Duplicated(coords, d_coords),
Const(is),
Const(js),
)
return nothing
end
T = Float32
coords = CuArray(rand(SVector{3, T}, 10))
fs = CuArray(zeros(3, 10))
is = CuArray([Int32(i) for i in 1:9])
js = CuArray([Int32(i) for i in 2:10])
d_coords = zero(coords)
d_fs = zero(fs)
CUDA.@sync @cuda threads=10 blocks=1 grad_kernel!(fs, d_fs, coords, d_coords, is, js) Error in error.txt. |
jgreener64
changed the title
CUDA.jl kernel errors with Julia 1.9.0-rc2
CUDA.jl kernel errors with Julia 1.9.0-rc3
May 2, 2023
@wsmoses tells me this might be fixed by EnzymeAD/Enzyme#1233 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am on main (4c30ed8) and CUDA 4.1.4. I have a GPU kernel where gradients work on Julia 1.8.5 and error on Julia 1.9.0-rc2.
The error is attached as error.txt due to the size limit. If required I can minimise but it depends on other packages so maybe there is a quicker fix.
The text was updated successfully, but these errors were encountered: