-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Determine symmetric linear op fro CG from abstract output dtype #23486
base: main
Are you sure you want to change the base?
Conversation
@jakevdp want to review this? |
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.
Sorry, I lost track of this while I was out of office.
Thanks for putting this together – a couple comments below
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.
Made the change
Lint is failing due to an unused import |
The CI failures look to be related to this change |
jax/_src/scipy/sparse/linalg.py
Outdated
return not issubclass(x.dtype.type, np.complexfloating) | ||
if callable(A) and x0 is not None: | ||
# we use output dtype as the proxy for dtype. | ||
symmetric = all(map(real_valued, tree_leaves(jax.eval_shape(A, x0)))) |
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 problematic: it assumes that all tree leaves are arrays, which is not always the case.
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.
Approval to allow running test
There's some issue with github actions currently, so for some reason I can't trigger the tests. I'd suggest running them locally via |
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.
Looks good, thanks!
Can you please squash the changes into a single commit? See https://jax.readthedocs.io/en/latest/contributing.html#single-change-commits-and-pull-requests
Thanks!
I don't see an easy way to squash since I've already created the PR. @jakevdp |
I squashed on another PR. https://github.com/Joshuaalbert/jax/tree/update-cg |
You can squash the commits and force-push to the branch this PR was made from, and it will update here. Please let me know if you'd like me to walk you through it – thanks! |
@jakevdp figured it out. There was some issue with it dropping my branch after interactive rebase, which made force push fail, but found that |
Thanks - but it looks like there are now conflicts with respect to the main branch. Can you rebase against the updated main branch, and then make sure your branch only contains one commit on top of main? Thanks! |
@jakevdp There you go |
Something went wrong here: you now have almost 100 commits on your branch. It looks like you probably merged an updated Can you please rebase against the most recent |
Probably because I forked and then modified the |
…rator is symmetric. * Added SciPy API extension to bicgstab, so user can specify if linear operator is symmetric (cherry picked from commit 618e777)
Mess resolved? |
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.
Looks good! The last thing we'll need here is tests for the new keywords. We can probably modify existing cases in lax_scipy_sparse_test.py
.
Address #23403