-
Notifications
You must be signed in to change notification settings - Fork 130
Sparsity support in pytensor #1127
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
Is this specifically about implementing |
The original issue seems to be just solve, I imagine that's good enough to start |
So for solve it's easy enough to wrap For the numba backend we need to write our own overrides, as I did for Finally for the Torch backend I honestly have no idea. It looks like torch has sparse support as well as an spsolve implementation, so it might be straight forward? |
Great, thanks for the plan! Out of curiosity, what could we do? I'm not aware of what general sparsity support would look like beyond making sure things can use csr and csc tensors, which i think pytensor already has |
Some thoughts:
|
I think this was discussed in the design-notes: https://github.com/pymc-devs/design-notes/blob/main/PyTensor%20design%20meeting%20(July%207%2C%202023).md#type-compatibility-across-backends Does torch work with scipy-like CSC-CSR matrices? If so it should be easy to implement. JAX doesn't so the only thing we do for now is support operations on sparse constants -> dense outputs which we convert to the JAX compatible ones. This PR touches on this as well, I should perhaps revive it: #278 |
For torch, it does have support for csc and csr formats. It also has a more generic one (coo) and then specialized formats. They do have some weird characteristics, you can't use them at all if you don't do |
Description
I'm investing implementing ALS in pytensor which is usually implemented with sparsity constructs (see implicit for reference). I quickly looked around and saw this older thread where someone asked for sparsity support. @jessegrabowski gave a first pass answer, but mentioned the support is subpar. Opening this to track any enhancements we could bring.
The text was updated successfully, but these errors were encountered: