-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add basic CSC and CSR sparse matrix support #92
Conversation
It looks like |
if [[ "$unamestr" == 'Linux' ]]; then
if [[ "${BITS32}" == "yes" ]]; then
SEGVCATCH=""
else
if command -v catchsegv; then
CATCHSEGV=catchsegv
else
CATCHSEGV=""
fi
fi |
All tests pass locally, but I had to manually import
|
1a638be
to
f6a491a
Compare
Fixed. |
@brandonwillard, code looks good. My only suggestion is to emit a As for the current
|
Should this be on module load? Seems like that might cause the warning to be emitted whenever
Oh, perhaps that's due to the changes between Numba 0.47.0+0.g4eb9cf875.dirty and 0.53.1.
I added that liberally. |
Yes, that's it: Numba 0.47 appears to have some important differences that cause this approach to fail. |
a9386bf
to
93285a4
Compare
I've updated the imports so that some of the module changes between versions are handled, but that doesn't seem to do the trick locally. |
I'm impressed that one of the CI jobs is using Numba 0.47 as it is almost ten versions older. I'll raise this at the next public meeting to update the CI config used here.
Try to put the warning at the |
db16cfe
to
d14617d
Compare
Thanks; making this support much older versions already seems like it could be a real hassle.
Done. |
d14617d
to
c9ae99b
Compare
c9ae99b
to
5a52147
Compare
I suspect this is coming from CI using Python 3.6 and 3.7, Numba 0.57 (currently in development) has a baseline of Python 3.8. Perhaps move all the Python versions in CI up by a |
It seems like it's all passing now for related reasons. |
@brandonwillard, can you add docs for your changes? |
@brandonwillard, let me know once you have the chance to update the docs and we can merge this PR. |
I'll try to do that in the next day or so. If I don't, feel free to send me another reminder. |
Hi @brandonwillard. Quick update on my side. I'll review this PR later this week. |
self.indices = types.Array(types.int32, 1, "A") | ||
self.indptr = types.Array(types.int32, 1, "A") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing, but these can also be int64
. Scipy is pretty aggressive about down casting it to int32, but if you have enough values to need 64 bit integers they will stick around.
Super excited to see this moving forward!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing, but these can also be
int64
. Scipy is pretty aggressive about down casting it to int32, but if you have enough values to need 64 bit integers they will stick around.Super excited to see this moving forward!
Thanks for the heads up! If no one objects, I'll be glad to change them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking in some relevant discussion from scipy, since it came up on my notifications again: scipy/scipy#16774
tldr (from my perspective) scipy wants to be more supportive of int64 indices, and remove the automatic down casting to int32 since checking the values is expensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guilhermeleobas, are you folks cool with these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandonwillard can you submit this change in a new PR, if it is still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @brandonwillard.
@esc, Could you take a look at this PR and merge it if possible? |
Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
@stuartarchibald thank you for the last review. I will merge this now trusting everyone involved. Thank you all for the patch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
the deployment to anacona.org broke on this one because the token was out of date. |
I deployed a fresh token and retriggered the action to produce a new dev package: https://anaconda.org/numba/numba-scipy/files?version=0.4.0dev0&type=conda&channel=dev |
This PR adds basic type support for CSC and CSR sparse matrices. It's just a start to adding real sparse matrix support (i.e. #29), but it at least allows one to use object mode in a more constrained way and reference simple properties of sparse matrices. More useful additions will follow.