-
Notifications
You must be signed in to change notification settings - Fork 129
Support more cases of numba advanced indexing #1254
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
Support more cases of numba advanced indexing #1254
Conversation
d537caf
to
a1fc205
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (86.95%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1254 +/- ##
==========================================
- Coverage 81.99% 81.99% -0.01%
==========================================
Files 188 188
Lines 48553 48600 +47
Branches 8673 8685 +12
==========================================
+ Hits 39812 39849 +37
- Misses 6579 6586 +7
- Partials 2162 2165 +3
|
a1fc205
to
ec99fca
Compare
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.
Some typos and questions
…g in Numba Extends pre-existing rewrite to ravel multiple integer indices, and to place them consecutively. The following cases should now be supported without object mode: * Advanced integer indexing (not mixed with basic or boolean indexing) that do not require broadcasting of indices * Consecutive advanced integer indexing updating (set/inc) (not mixed with basic or boolean indexing) that do not require broadcasting of indices or y.
ec99fca
to
cd649ab
Compare
a0d9ecf
to
8ad0812
Compare
Started failing in 0.4.36: jax-ml/jax#26888 Skip failing JAX test Started failing in 0.4.36 and seems to be fixed in 0.5.1
8ad0812
to
d1f18a1
Compare
Support more cases of multi-dimensional advanced indexing and updating in Numba
Extends pre-existing rewrite to ravel multidimensional integer indices, to handle multiple inputs (if no broadcasting is needed) and to place them consecutively if they were not. It also extends it to Set/IncSubtensor as long as y is not broadcasted and advanced indices are consecutive.
The following cases should now be supported without object mode:
Also fixes bug in infer_shape of AdvancedIndexing with slices (which were mistakenly treated as NoneSlices)
Example of new kind of graphs that are supported.
On my machine that runs in 8us, and before with object mode it was 60us.
A case with a single matrix advanced indexing shows up in the logp of the Categorical, the gradient of which was not supported by numba without object mode before and now is.
📚 Documentation preview 📚: https://pytensor--1254.org.readthedocs.build/en/1254/