-
Notifications
You must be signed in to change notification settings - Fork 229
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
Returning Tuple of Sparse Matrices is Broken #2570
Comments
For a sparse matrix |
@amontoison: Of course you are correct, but that's not the issue here. Recall that the In summary, the conversion of COO -> CuSparseCSR leaves the user with an incorrectly sized |
Sorry, I missed the call to |
Ok, I isolated the issue: A = SparseMatrixCSC(CuSparseMatrixCSR{Float32}(sparse([], [], Array{Float32}([]))))
ERROR: ArgumentError: 1 == colptr[1] != 1 |
@rbassett3 The issue is in the CUDA routines, if we have an empty sparse matrix with one-based indexing, we need I fixed the issue in #2575 but we should open a ticket on NVIDIA's website. |
@amontoison You are the expert. I've been trying to wrap my head around this issue since i submitted it but am not having any luck. Here are some more examples I've constructed feeling out the corner cases.
The really strange thing to me is that all the examples above work when the second argument (the CuArray) is removed. I.e. both
|
I tested your corner cases and it works with my local branch (#2575). julia> CuSparseMatrixCSR{Float32}(sparse([], [], Array{Float32}([]), 0, 1)), CuArray{Float32}([1.0, 1.0, 1.0])
(sparse(Int32[], Int32[], Float32[], 0, 1), Float32[1.0, 1.0, 1.0])
julia>
julia> CuSparseMatrixCSR{Float32}(sparse([], [], Array{Float32}([]), 1, 0)), CuArray{Float32}([1.0, 1.0, 1.0])
(sparse(Int32[], Int32[], Float32[], 1, 0), Float32[1.0, 1.0, 1.0])
julia> CuSparseMatrixCSR{Float32}(sparse([], [], Array{Float32}([]), 1, 1)), CuArray{Float32}([1.0, 1.0, 1.0])
(sparse(Int32[], Int32[], Float32[], 1, 1), Float32[1.0, 1.0, 1.0])
julia> CuSparseMatrixCSC{Float32}(sparse([], [], Array{Float32}([]), 0, 0)), CuArray{Float32}([1.0, 1.0, 1.0])
(sparse(Int32[], Int32[], Float32[], 0, 0), Float32[1.0, 1.0, 1.0]) We convert back to I think you are right and |
Describe the bug
I've been experiencing a subtle bug in CUDA.jl related to tuples of sparse matrices which have 0 in one of their dimensions. I was finally able to condense it down to the MWE below.
To reproduce
The Minimal Working Example (MWE) for this bug:
Expected behavior
Using SparseArrays, we get:
Using AMDGPU, we get:
This seems like the correct behavior, and is what I was expecting.
Version info
Details on Julia:
Details on CUDA:
The text was updated successfully, but these errors were encountered: