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

Reduce memory use of / solver #23

Closed
wants to merge 1 commit into from
Closed

Conversation

rafaqz
Copy link
Collaborator

@rafaqz rafaqz commented Dec 2, 2024

The is currently a large allocation from calling Matrix on the rhs array before /

This PR reduces memory use of solve by running the problem column-by-column using solve! more directly.

It also allows passing in Z and lu objects for re-use. This is less useful than it sounds currently, as they will usually change size tile-by-tile when we are running it multiple times. Likely we need to move to requiring julia 1.11 where we can reuse array memory more easily. I'm not sure how easy that is.

There is another possible operation following from this one that recognizes that the column vector passed to solve! is always "one-hot" vector as the sparse array is essentially a diagonal of ones. Rewriting the suitesparse solver in julia to take advantage of this should be at least a 2x speedup, but maybe more, as there is a lot of looping over reading the whole B vector (in the suitesparse C) when we can just assign 1 once.

@rafaqz
Copy link
Collaborator Author

rafaqz commented Dec 13, 2024

This will be done in the other PR

@rafaqz rafaqz closed this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant