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
Describe the bug
Given A and B are two matrices, where A is of type CuSparseMatrixCSC and B is a regular CuArray (for simplicity assume both are square)
A * B works
transpose(A) * B works
A * transpose(B) does not work
transpose(A) * transpose(B) does not work
The implementations of mul! are there on line 20 and line 22 of CuArrays/src/sparse/interfaces.jl, but instead of them being called properly, both of the failing multiplications throw a scalar getindex is disallowed, suggesting it may be defaulting to a generic method?
To Reproduce
The Minimal Working Example (MWE) for this bug:
using CuArrays
using SparseArrays
using LinearAlgebra
CuArrays.allowscalar(false)
randsparse_cpu =SparseMatrixCSC{Float32, Int32}(sprand(3000, 3000, 0.0008))
sparsecscmatrix = CUSPARSE.CuSparseMatrixCSC(randsparse)
densematrix =cu(rand(Float32, 3000, 3000))
sparsecscmatrix * densematrix
transpose(sparsecscmatrix) * densematrix
sparsecscmatrix *transpose(densematrix) # throws scalar getindex is disallowed, should throw different errortranspose(sparsecscmatrix) *transpose(densematrix) # throws scalar getindex is disallowed, should throw no error
Expected behavior
three of the multiplications should complete correctly, while sparsecscmatrix * transpose(densematrix) should throw a CUSPARSE error (CUSPARSE does not support 'N', 'T' multiplications for CSC matrices)
Build log
# post the output of Pkg.build()
# make sure the error still reproduces after that.
Building TimeZones → `~/.julia/packages/TimeZones/OjMoF/deps/build.log`
Building HDF5 ─────→ `~/.julia/packages/HDF5/pAi1D/deps/build.log`
Building CodecZlib → `~/.julia/packages/CodecZlib/5t9zO/deps/build.log`
Building NNlib ────→ `~/.julia/packages/NNlib/FAI3o/deps/build.log`
Building Conda ────→ `~/.julia/packages/Conda/3rPhK/deps/build.log`
Building PyCall ───→ `~/.julia/packages/PyCall/zqDXB/deps/build.log`
Building WebIO ────→ `~/.julia/packages/WebIO/nTMDV/deps/build.log`
error still reproduces
Environment details (please complete this section)
Details on Julia:
# please post the output of:
versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, haswell)
Environment:
JULIA_NUM_THREADS = 4
Julia packages:
CuArrays.jl:
CUDAnative.jl:
SparseArrays
LinearAlgebra
CUDA: toolkit and driver version
10.2, 440.64
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
@whichmul!(similar(densematrix, Float32, (size(sparsecscmatrix,1), size(densematrix,2))), sparsecscmatrix, densematrix)
# mul!(C::CuArray{T,2,P} where P, #A::Union{CuArrays.CUSPARSE.CuSparseMatrixBSR{T}, CuArrays.CUSPARSE.CuSparseMatrixCSC{T}, CuArrays.CUSPARSE.CuSparseMatrixCSR{T}, CuArrays.CUSPARSE.CuSparseMatrixHYB{T}}, B::CuArray{T,2,P} where P) where T at CuArrays/l0gXB/src/sparse/interfaces.jl:19
densematrix_T =transpose(densematrix)
@whichmul!(similar(densematrix_T, Float32, (size(sparsecscmatrix,1), size(densematrix_T,2))), sparsecscmatrix, densematrix_T)
# mul!(C, A, B) at stdlib/v1.4/LinearAlgebra/src/matmul.jl:208
not quite sure why the latter isn't picking the appropriate method and falling back to the generic
Describe the bug
Given A and B are two matrices, where A is of type CuSparseMatrixCSC and B is a regular CuArray (for simplicity assume both are square)
A * B works
transpose(A) * B works
A * transpose(B) does not work
transpose(A) * transpose(B) does not work
The implementations of mul! are there on line 20 and line 22 of CuArrays/src/sparse/interfaces.jl, but instead of them being called properly, both of the failing multiplications throw a
scalar getindex is disallowed
, suggesting it may be defaulting to a generic method?To Reproduce
The Minimal Working Example (MWE) for this bug:
Expected behavior
three of the multiplications should complete correctly, while
sparsecscmatrix * transpose(densematrix)
should throw a CUSPARSE error (CUSPARSE does not support 'N', 'T' multiplications for CSC matrices)Build log
Environment details (please complete this section)
Details on Julia:
Julia packages:
CUDA: toolkit and driver version
10.2, 440.64
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: