-
Notifications
You must be signed in to change notification settings - Fork 130
BUG: tag_solve_triangular
doesn't use a triangular solver
#382
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
Comments
@jessegrabowski Are you saying the rewrite should just use the |
@dehorsley is this something you would be interested in tweaking? |
Yeah that rewrite should use But I'm also curious why |
Edit: Nevermind I was looking at the wrong output Anyway, it's fine to tweak any useful rewrite that you think of that can make use of the new tags. The tag solution is not very elegant but it's better than nothing for now. |
The fault comes from this sequence of commits:
At this point the deprecation warning mentioned in #291 should also have been updated to direct people to use the new |
I got confused with the |
@dehorsley we realized there was a bug (not in your rewrites) and went ahead and fixed it. However I think @jessegrabowski suggested we also expand the rewrite (renamed after #383) to anything that has a "triangular" tag? Did I get that correctly? Also should we make the outputs of "Cholesky" have such a tag from the get go? If Jesse confirms, we would appreciate your help with those tasks :) |
Yeah my idea was to cast a wider net. Right now, the rewrite checks for "triangularity" by looking for a Cholesky parent node. So this graph is rewritten:
But, importantly for PyMC users, this graph is not rewritten:
Because the cholesky factorized matrix returned by LKJCholeskyCov isn't actually created via the I also wanted to verify that if we have a tagged triangular matrix,
Yes, this was my thinking |
Thanks @jessegrabowski. I opened #385 to keep track of it |
Describe the issue:
After #303 I was thinking it would be nice to use the new
lower_triangular
andupper_triangular
tags to re-write inverse and solves involving triangular matrices to usesolve_triangular
. I saw this optimization already exists astag_solve_triangular
. For example, this graph:Gets rewritten to:
But as I point out in #291,
Solve(assume_a='sym', lower=True)(A, b)
is not the same assolve_triangular(A, b, lower=True)
. Indeed, a lot of speed is being left on the table:And it seems like something is going wrong with the
Solve()
approach, because the following test fails:Am I missing something with all this?
Reproducable code example:
Error message:
No response
PyTensor version information:
Pytensor version: 2.12.3
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: