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

Allow SparseArrays to catch lu(::WrappedSparseMatrix) #51161

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

dkarrasch
Copy link
Member

Over the AbstractMatrix relaxation in v1.9, we missed a potential indirection for wrapped sparse matrices. Instead, by default, a similar copy is created (hence a sparse matrix) and then lu! with a pivot argument is called. Such a method, however, does not exist in SparseArrays.jl, which means that the generic_lufact! method gets called, which is probably really bad performance-wise, due to heavy reading and writing into the sparse matrix. This PR introduces one more level at which SparseArrays.jl (and perhaps other external packages) may interfere and redirect to their own implementations, in-place or out-of-place.

@dkarrasch dkarrasch added the linear algebra Linear algebra label Sep 2, 2023
@dkarrasch
Copy link
Member Author

Ping @vtjnash.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Sep 5, 2023

I haven't the slightest idea how this is designed currently, but I assume this is similar to your work on mul! dispatch & friends? Anyways, LGTM

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Sep 5, 2023
@oscardssmith oscardssmith merged commit 354c367 into master Sep 5, 2023
3 checks passed
@oscardssmith oscardssmith deleted the dk/lusparse branch September 5, 2023 15:39
@oscardssmith oscardssmith removed the merge me PR is reviewed. Merge when all tests are passing label Sep 5, 2023
ViralBShah pushed a commit that referenced this pull request Sep 7, 2023
This is a follow-up to #51161. It introduces one level in the promotion
pipeline which allows to call out-of-place versions of `cholesky` and
`qr` for arguments whose `similar` copy yields a `SparseMatrixCSC`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants