Skip to content
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

Speed of tridiagonal_solve() #7

Open
jhrmnn opened this issue Mar 17, 2021 · 1 comment
Open

Speed of tridiagonal_solve() #7

jhrmnn opened this issue Mar 17, 2021 · 1 comment

Comments

@jhrmnn
Copy link
Contributor

jhrmnn commented Mar 17, 2021

Hi. As you warn in the code, tridiagonal_solve() is quite slow. I've compared to plain torch.solve(), which is much faster, so I'll be using that in my application, but I was wondering if you are interested in a patch, or perhaps you had other reasons to use the Thomas algorithm.

@patrick-kidger
Copy link
Owner

patrick-kidger commented Mar 17, 2021

So I frequently use this on relatively long sequences. Linear scaling in time is good for peace of mind, and linear scaling in memory might be a necessity to have it work in memory.

That's just theoretically speaking, though. I've not run time or memory benchmarks against torch.solve. If you can demonstrate that it's more time efficient, and not too memory inefficient, then I'd be happy to accept a patch that dispatches to torch.solve in the regime for which those are true. (Or if you prefer, just an argument to switch from one to the other, as I appreciate that'll be less hassle to put together.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants