-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
BUG: sparse.linalg: Update SuperLU
to fix unfilterable output for singular matrices
#21172
Conversation
SuperLU
to fix unfilterable output for singular matrices
Using the second latest commit from SuperLU also results in another compilation failure 🙈 :
Guess we have to bite the bullet and get this fixed upstream then. |
Locally things are working now, just need to properly recreate the patch file, messed that one up badly. |
SuperLU
to fix unfilterable output for singular matricesSuperLU
to fix unfilterable output for singular matrices
SuperLU
to fix unfilterable output for singular matricesSuperLU
to fix unfilterable output for singular matrices
CC @nickodell would you have time to review? |
Hi, I've verified two things.
What other things should I check? |
Thanks! What I am not quite sure about are the patches I added on top of SuperLU: https://github.com/scipy/scipy/blob/629e358b943818cbeac9fd26b0e79f0bd8655020/scipy/sparse/linalg/_dsolve/SuperLU/scipychanges.patch Most of them are for singular matrix handling and our tests pass though. |
Note that if this gets merged and backported to 1.14.1, it also comes with the SuperLU license fix, so we would not need to double backport. |
It would probably be useful to make a difference here between what we were already patching, and the new patches you added. Perhaps comment on each of those and why they need to be kept as SciPy patches rather than upstreamed? |
Many of these changes to the patch file seem unrelated to what's being fixed. Can you explain why the patch file is changing at all? We're updating the file being patched - we shouldn't need to change the patch file, right? It might help if you explained the process here for how the SuperLU update is being done. I'm guessing you're diffing our modified SuperLU against the old upstream unmodified SuperLU to generate the patch, then applying the patch to the upstream updated SuperLU to generate a modified version. Is that right? |
-#define HAVE_METIS TRUE | ||
+/*#define HAVE_METIS FALSE */ |
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.
Commenting this out is necessary. Otherwise, at runtime we get errors about missing METIS symbols.
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 change seems fine. Enabling this unconditionally is probably not a good thing to do upstream (that's what build system checks are for), but let's not worry about it too much for now since the patch is harmless.
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 thought the same. Unfortunately, setting it to FALSE is also not enough. Commented upstream here: xiaoyeli/superlu@6f7ea89#r145014670
The patch is against the used SuperLU source files. The only new patch is commenting out METIS stuff, see my last comment here. As for the other patches, I tried to stay faithful to what we had before but had to juggle with more |
One more thing that came to mind is that we should probably better document which commit of SuperLU we used when the code was copied. Looking through PR comments can be tedious. So far we probably only ever used releases, so this was not an issue. |
Thanks @dschmitz89. Adding the exact commit we're pointing at sounds good. I suggest adding a |
This is ready to merge from my side, CI failures are unrelated. |
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.
LGTM. I'm not sure I understand this code well enough to spot potential problems, but I don't see any issues.
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.
The file mc64ad.c
was incorrectly added. Can you please remove it again, squash the history so it is really gone from all commits, and add to README.scipy
the procedure for keeping it out?
That file isn't license-compatible. See gh-12243 for a previous discussion on this.
e57b133
to
d3acac0
Compare
The CI failures are because an unintentional update of the |
Argh, will try to fix after work. I wish there was a pre commit that warns for submodule changes. |
Submodule update reverted. Commits should still be squashed as they are not clean. |
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.
LGTM now, thanks a lot @dschmitz89! Time to give this a go:) And thanks for the review @nickodell
@tylerjereddy I'll leave the backport label for you to decide. It seems okay to do if it cherry-picks cleanly, but it's a large diff and the bug this fixes isn't super critical, so leaving it out would also be reasonable I think. |
…ingular matrices (scipy#21172) [ci skip]
The cherry-pick was clean and passed tests locally on ARM mac so I've tentatively added it to the backport PR, thanks |
…ingular matrices (scipy#21172)
Reference issue
Closes gh-20993
What does this implement/fix?
Updates SuperLU to the head of their master branch. A recent commit should avoid printing to stdout for singular matrices.
Additional information
Locally, on WSL using Ubuntu and conda compilers, compilation fails due to a recent SuperLU update regarding complex numbers.
Edit: compilation also fails in CI. After some feedback, I will open an issue upstream.