Closed hsseung closed 1 year ago
MWE is just broadcast!(-, U, U, grads)
or U .= grads
. My guess is that broadcasting from a sparse matrix into a dense one is not supported by CUDA.jl. @maleadt does that sound right to you?
Yes U .-= grads
throws an error, but U -= grads
is fine.
After the error, attempts to access grads
lead to ERROR: CUDA error: unspecified launch failure (code 719, ERROR_LAUNCH_FAILED)
and this is unrecoverable.
We do actually support sparse broadcast of CSC/CSR matrices involving dense inputs. The problem I think is the in-place version; I only implemented the out-of-place version: https://github.com/JuliaGPU/CUDA.jl/blob/4a29605cbd66c61fbf3ad0727681663a3489f47c/lib/cusparse/broadcast.jl#L462-L600
Thanks for the info. Guess I'll wait for CUDA.jl to support this.
It would be good to open an issue in CUDA.jl to track this
I'd like my gradient to be a sparse matrix, while my parameters are a dense matrix. This works on CPU, but yields an error on GPU.
Julia 1.8.5, CUDA 12.0, GTX 1080 Ti