Skip to content

Handle lower flag more carefully in Solve to CholeskySolve rewrite #1492

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jessegrabowski
Copy link
Member

@jessegrabowski jessegrabowski commented Jun 21, 2025

Description

There was some discussion in #1467 about whether the reuse_decomposition_multiple_solves rewrite was doing the right thing with the lower flags, especially in the corner case where a user is being really clever and only storing half the symmetric matrix.

This PR handles the case more carefully, and checks on a matrix with NaN values that we don't look at the wrong triangles after rewriting.

It also forwards the check_finite argument in the Cholesky Op, which was not being respected previously. I think this is also being fixed in #1487 , so there's some undesirable overlap between these PRs.

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pytensor--1492.org.readthedocs.build/en/1492/

@jessegrabowski jessegrabowski added bug Something isn't working graph rewriting linalg Linear algebra labels Jun 21, 2025
@jessegrabowski jessegrabowski force-pushed the more-cho-solve-rewrite branch 2 times, most recently from b41cfc7 to 35444df Compare June 21, 2025 19:52
@jessegrabowski
Copy link
Member Author

jessegrabowski commented Jun 21, 2025

I reset the logic of the rewrite in this PR, but added a test of behavior under different lower flags. I think we were doing the right thing from the get-go, but we might have to think about this a bit more carefully.

Even if everything is fine, I think having this new test is good.

@jessegrabowski jessegrabowski force-pushed the more-cho-solve-rewrite branch from 7aa255d to 025c025 Compare June 23, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graph rewriting linalg Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant