Support negative axes in microbatching - #1751
Open
anxkhn wants to merge 2 commits into
Open
Conversation
Author
|
hey @irhyl, could you please review this pr when you have a chance? |
Contributor
hi @anxkhn the test is a bit minimal, though. it’d be good to cover a few more shapes, including in_axes=-2. if possible, also add a sharding test. otherwise, solid catch on the canonicalization. |
Cover more input shapes, in_axes=-2, and explicit sharding. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
anxkhn
force-pushed
the
fix/microbatch-negative-axis
branch
from
August 19, 2026 20:37
fbfbe14 to
a840323
Compare
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
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.
Summary
Canonicalize negative batch axes before reshaping and slicing microbatches.
Negative
in_axesvalues were used directly in shape slicing, producing invalid reshape targets. The fix resolves each axis against the relevant array rank in bothreshape_batch_axisand_take_fn.Tests
in_axes=-1