-
Notifications
You must be signed in to change notification settings - Fork 134
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
Merged
ricardoV94
merged 4 commits into
pymc-devs:main
from
ricardoV94:more_numba_advanced_indexing
Mar 3, 2025
Merged
Support more cases of numba advanced indexing #1254
ricardoV94
merged 4 commits into
pymc-devs:main
from
ricardoV94:more_numba_advanced_indexing
Mar 3, 2025
+239
−66
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d537caf
to
a1fc205
Compare
Codecov ReportAttention: Patch coverage is
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
🚀 New features to boost your workflow:
|
a1fc205
to
ec99fca
Compare
jessegrabowski
requested changes
Feb 28, 2025
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
jessegrabowski
approved these changes
Mar 1, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/