-
Notifications
You must be signed in to change notification settings - Fork 104
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
Implement destructive in-place rewrites for Cholesky and Solve Ops #577
Conversation
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.
Great! I think we made our lives easier going forward
Can the Numba Cholesky make use of overwrite? |
I think so? I added a check to copy the input matrix or not. I need to test it more carefully to make sure it does what I want it to do. |
Numba seems to be computing in integer? Anyway I guess this PR now depends on #578? |
I had removed a |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #577 +/- ##
==========================================
- Coverage 81.73% 81.73% -0.01%
==========================================
Files 183 183
Lines 47734 47814 +80
Branches 11611 11635 +24
==========================================
+ Hits 39016 39080 +64
- Misses 6523 6532 +9
- Partials 2195 2202 +7
|
You marked that, but the commits seem "dirty". Do you mind if I squash merge? |
I don't mind at all, but I'd rather you explained it to me so I can do it right next time. I read the link, but it suggested I write War and Peace in each commit message. |
Fair enough. The biggest point is each commit should be a self-contained logical change, so that you could in theory revert or checkout any of them and the codebase would still make sense as is. Usually stuff like fix typo, run-pre commit, add suggestions from review, intermediate changes that were ultimately not needed, disappear after "cleaning" |
OK let me take a stab at cleaning it up |
Advice: backup the branch before you try :) |
6d93813
to
ff364f1
Compare
I just did an interactive rebase and squashed things together. Is that all I needed to do? |
ff364f1
to
470ea60
Compare
sorry for the delay, ya'll are fast! Taking a look now |
Works great for me (running the test you wrote)! Are you planning on doing all of them in this PR? the solves, eig's, etc? |
eed127f
to
bb90822
Compare
cdb78f6
to
8dc2a26
Compare
e448896
to
259d3f3
Compare
9f7db08
to
48721f4
Compare
119f2e0
to
0a37de5
Compare
Co-authored-by: Ricardo Vieira <28983449+ricardov94@users.noreply.github.com>
0a37de5
to
cb0ec82
Compare
Description
All scipy.linalg functions offer an
overwrite_a
and/oroverwrite_b
argument that can enhance performance by re-using the input memory for the outputs. This PR implements re-writes that will set these flags to True at compile time.These rewrites are also a nice example for the in-place docs here, so I'll update them with an example as a later commit to this PR.
We added a general inplace functionality to Blockwise, that automatically makes the core_op inplace. This will translate to the core_op if the Blockwise is later removed due to being useless (no batch dims actually exist).
Related Issue
Op
#572Checklist
Type of change