-
Notifications
You must be signed in to change notification settings - Fork 227
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
Broadcast of sparse vectors #2209
Comments
Your MWE does not work (no definitions for N, W; W_sparse unused) and performs scalar iteration (slicing A). Looking at the backtrace though, it looks like you're trying to: julia> x = CuSparseVector(sprand(1, 1.0))
1-element CuSparseVector{Float64, Int32} with 1 stored entry:
[1] = 0.753707
julia> false .* x
ERROR: broadcast with sparse arrays is currently only implemented for CSR and CSC matrices Is this what you need? In any case, this isn't a bug, but just a missing feature. I'm also not sure it's worth the effort, seeing how you're doing scalar iteration first? In that case, it's probably much better to just copy to the CPU first. |
Yeah that seems to be the a simpler version of the same issue. It's mixing broadcast of sparse matrices or views/slices with scalars. |
You'll have to be more specific then. Is it scalar .* CuSparseVector you need? Does it involve multiple sparse vectors? Or also involve sparse matrices? If so, which format, and how exactly? Since there isn't a way (I know of) to implement this generically, we need specialized kernels to handle exactly what you need. |
Yes, specifically it's just trying to zero a sparse vector. julia> fill!(W_d_sparse[1,:],false)
ERROR: CanonicalIndexError: setindex! not defined for CUDA.CUSPARSE.CuSparseVector{Float32, Int32}
Stacktrace:
[1] error_if_canonical_setindex(::IndexCartesian, A::CUDA.CUSPARSE.CuSparseVector{Float32, Int32}, ::Int64)
@ Base .\abstractarray.jl:1403
[2] setindex!
@ Base .\abstractarray.jl:1392 [inlined]
[3] fill!(A::CUDA.CUSPARSE.CuSparseVector{Float32, Int32}, x::Bool)
@ Base .\multidimensional.jl:1114
[4] top-level scope
@ REPL[2]:1 |
Describe the bug
Some cases of appropriate sparse matrix broadcasts error on CUDA sparse matrices
To reproduce
The Minimal Working Example (MWE) for this bug:
The text was updated successfully, but these errors were encountered: