Fix division by zero in reduce_util.h grain size calculation#16462
Merged
psiddh merged 3 commits intopytorch:mainfrom Jan 6, 2026
Merged
Fix division by zero in reduce_util.h grain size calculation#16462psiddh merged 3 commits intopytorch:mainfrom
psiddh merged 3 commits intopytorch:mainfrom
Conversation
Changed cortex_m_pass_manager.py to use relative imports (from .activation_fusion_pass) instead of absolute imports (from executorch.backends.cortex_m.passes) for intra-package references. This breaks the circular import chain: __init__.py → cortex_m_pass_manager.py → __init__.py Resolves: ImportError: cannot import name 'ActivationFusionPass' from partially initialized module 'executorch.backends.cortex_m.passes'
Add zero check for reduction_size before dividing to calculate grain_size, preventing crash when fuzzer triggers edge case with empty reduction dimension.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16462
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 8186e26 with merge base 4bf3869 ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
JacobSzwejbka
approved these changes
Jan 5, 2026
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.
Test plan
[PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.