-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Sparse Op
implementations in Numba
#658
Comments
During numba/numba#7524 a conclusion was drawn that the C-approach will be (performance-wise) much similar to a simple call to Numba's |
Yes, we can always use object mode for this, and we might need to do that in order to replace the C backend; however, we don't want to lose any performance gains we might currently be getting from the sparse It looks like some Numba-compatible sparse matrix code is available, as mentioned in the main Numba + sparse matrix issue here. |
Seems like there's an Numba compatible implementation at https://github.com/lenskit/csr. It has the basic operations coded as Numba functions, we could use those to build our own versions. It seems to be limited to CSR matrices but I guess similar lowering and architectural logic can be extended to CSC and BSR. Preferably I'd say we should try lowering the And shouldn't the Lines 578 to 582 in e476ebc
The only reason I see they were made an Lines 522 to 543 in e476ebc
We could just as easily make an Op specially for these conversions, which along with a Lines 439 to 444 in e476ebc
This will help us with |
There's a lot of refactoring needed in that sparse matrix code; some of it was started in #303, but that's definitely not all of it.
Those The thing to consider when it comes to Sub-
Assuming sparse matrices are only ever the output of a |
We need to determine how we're going to support the sparse matrix
Op
s in Numba.Our sparse matrix
Op
s are basically just interfaces toscipy.sparse
, and Numba/numba-scipy
doesn't already supportscipy.sparse
, so we would need to create our own means of accessingscipy.sparse
at the C level and/or implement the appropriate functions/objects in pure Numba.The former (i.e. C) approach might be easier to implement in the short-term, and it could involve the same mechanisms as numba/numba#7524. Ideally, this work would be done in
numba-scipy
and used by Aesara, but we could consider transitioning the code from Aesara tonumba-scipy
if that helps us replace the C backend sooner.The text was updated successfully, but these errors were encountered: