-
Notifications
You must be signed in to change notification settings - Fork 106
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
Allow access to solve_triangular
in pt.linalg
#291
Comments
at.linlag.solve
as suggested in depreciation warningpt.linlag.solve
as suggested in depreciation warning
Sounds fine to me to match the scipy API (even if we were to use Solve for it under the hood). In this case, since there's a performance difference we can use the already implemented More generally, are there any trade-offs? In what cases would we want to use |
The LAPACK documentation for SYSV, used in
From my admittedly limited understanding, |
pt.linlag.solve
as suggested in depreciation warningsolve_triangular
in pt.linalg
I updated the title of this issue for the thing that needs to be done. The related bug is now tracked in #382 |
I think this one is completed |
Yes this was done en passant in #417, and can be closed. |
Description
The current depreciation warning for
pt.slinalg.solve_lower_triangular
andpt.slinalg.solve_upper_triangular
directs the user to usept.linalg.solve
, but the specialized LAPACK triangular solver implemented inscipy.linalg.solve_triangular
(TRTRS) is not accessible via any combination of arguments topt.linalg.solve
.Currently, if one of the inputs to
pt.linalg.solve
is aCholesky
node, it will be replaced with a solveOp
withassume_a='sym'
. This invokes the SYSV routine, which is not the same as TRTRS. It'd be nice to speed test these two routines and make sure pytensor is using the faster one by default. If SYSV is faster in all cases, it doesn't make sense to have a solve triangular routine at all, so a priori I suspect it's not.Anyway, I would suggest the function
pt.slinalg.solve_triangular
be exposed inpt.linalg
, and the depreciation warning changed to direct users to this function. This would match the scipy API.Another alternative would be to add an additional option for
assume_a
inpt.linalg.solve
for triangular matrices, and add some additional control flow insidept.slinlag.Solve.perform
that would route toscipy.linalg.solve_triangular
ifassuma_a == 'triang'
. The disadvantage here is that the API would not longer follow that of scipy.The text was updated successfully, but these errors were encountered: