Skip to content
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

Fix sparse-dense matmul, with transposed dense #180

Merged
merged 2 commits into from
May 27, 2020
Merged

Conversation

irhum
Copy link
Contributor

@irhum irhum commented May 27, 2020

Continuation of the pull request in JuliaGPU/CuArrays.jl#728

As previously mentioned, the patch makes sure the correct method is dispatched

# before the patch
densematrix_T = transpose(densematrix)
@which mul!(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

# after the proposed patch
@which mul!(similar(densematrix_T, Float32, (size(sparsecscmatrix,1), size(densematrix_T,2))), sparsecscmatrix, densematrix_T)
# 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}}, transB::Transpose{#s243,#s242} where #s242<:(CuArray{T,2,P} where P) where #s243) where T at CuArrays/l0gXB/src/sparse/interfaces.jl:20

and tests have been added for the sparse-transpose(dense) case as well

irhum added 2 commits May 27, 2020 19:04
use correct method defined in lib/cusparse/interfaces.jl sparse-dense, when dense is transposed
@maleadt
Copy link
Member

maleadt commented May 27, 2020

Ah yes, I really shouldn't have added that typevar. Let's test:
bors r+

@maleadt maleadt added bugfix This gets something working again. cuda array Stuff about CuArray. labels May 27, 2020
@bors
Copy link
Contributor

bors bot commented May 27, 2020

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This gets something working again. cuda array Stuff about CuArray.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants