-
Notifications
You must be signed in to change notification settings - Fork 134
Do not use Numba objmode for supported advanced indexing operations #805
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
Do not use Numba objmode for supported advanced indexing operations #805
Conversation
959b7f6
to
8fd718c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #805 +/- ##
==========================================
+ Coverage 80.76% 80.87% +0.11%
==========================================
Files 163 164 +1
Lines 46941 46891 -50
Branches 11499 11474 -25
==========================================
+ Hits 37912 37925 +13
+ Misses 6786 6752 -34
+ Partials 2243 2214 -29
|
8fd718c
to
9fe718a
Compare
@kc611 sorry for tagging if your review, fat fingers on my side! Do keep the cool work on extending advanced indexing on the Numba side!!! |
c0e2255
to
478cd14
Compare
No worries! 🙂 I took a quick look at this PR and I'd say if you guys are using string-based function creation anyways then it's completely possible to support the full set of advanced indexing cases by simply creating the required loops within the string-based functions. |
Yeah, but we are not doing that yet. We are just creating dumb stuff like Thanks for checking it out! |
Use ScalarTypes in MakeSlice for compatibility with Numba
478cd14
to
b6ee8e7
Compare
This should be ready for review. After this we can start adding some simple non-supported cases like boolean indexing with indices.shape == x.shape, and some multiple vector index cases |
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.
Looks good to me. The duplicate indices thing isn't really clear to me. Also curious if the lines codecov is complaining about are unreachable, and, if so, whether we can just get rid of them.
# Numba does not support indexes with more than one dimension | ||
# Nor multiple vector indexes | ||
(len(adv_idxs_dims) > 1 or adv_idxs_dims[0] > 1) | ||
# The default index implementation does not handle duplicate indices correctly |
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.
Here "default" means on our end? Is that a problem?
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.
It means the code returned by numba_funcify_default_subtensor
. Shouldn't be a problem as long as we don't try to use it when it's not valid
Description
Several cases of advanced indexing are supported by Numba these days. This PR makes sure we don't skip on those!
Related Issue
Checklist
Type of change