-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 #28369, transpose of SparseMatrixCSC is not recursive #28376
Conversation
stdlib/SparseArrays/test/sparse.jl
Outdated
@test Array(transpose(S)) == copy(transpose(M)) | ||
@test permutedims(S) == SP | ||
@test permutedims(S, (2,1)) == SP | ||
@test permutedims(M, (1,2)) == S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you perhaps mean to test permutedims(S, (1,2)) == M
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
permutedims(M, (1,2)) == S
doesn't test the new code. permutedims(S, (1,2)) == M
is definitely better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this and rebased and pushed the PR again.
(a, b) == (1, 2) && return copy(A) | ||
throw(ArgumentError("no valid permutation of dimensions")) | ||
end | ||
Base.permutedims(A::SparseMatrixCSC) = permutedims(A, (2,1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is redundant. It is covered by the permutedims(A::AbstractMatrix) = permutedims(A, (2,1)
in permuteddimsarray.jl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this and rebased and pushed the PR again
84bc31c
to
56b504a
Compare
A nanosoldier run might've been in order, to make certain that the replacement of the function passed to |
Another time please just go ahead and trigger a run. @nanosoldier |
Is this something I can do locally ? |
Yes, you can run the same tests locally. See https://github.com/JuliaCI/BaseBenchmarks.jl. Though, it might be easier to ask a collaborator to trigger a nanosoldier run. |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
There appear to be statistically significant regressions (+ 30-40%) in some sparse benchmarks. I'll look at this. |
I'm not convinced that any of these are genuine but it would be great if you could take a closer look anyway |
I misread the results. Time increases of about %30 are precisely on those with about %30 tolerance. But, there is an oversight in the PR. julia/stdlib/SparseArrays/src/sparsematrix.jl Lines 858 to 859 in b0bf91e
|
The collection of sparse-dense and dense-sparse matrix multiplication regressions look potentially legitimate; that they occur as a block makes the likelihood that those represent a real change reasonable. Perhaps check those locally? |
EDIT: Please see the comment below. It looks like doing this correctly will take a bit more work. As someone mentioned, the sparsematrix.jl code relies in a few places on the elements being scalars. Suppose One problem is unnecessary allocation. julia/stdlib/SparseArrays/src/sparsematrix.jl Lines 861 to 865 in 883c8a3
Eventually, This PR neglected to fix julia/stdlib/SparseArrays/src/sparsematrix.jl Line 858 in 883c8a3
the same additional allocation will happen. But, I haven't done or tested anything yet because |
No description provided.