-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Delay mul/pow expansion for _SympyT to enable more folding
#138235
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/138235
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New Failures, 2 Unrelated FailuresAs of commit ca264be with merge base f3c3f3a ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
58b8608 to
edf9cb9
Compare
|
| add_loop_eager_dynamic, compile_time_instruction_count, 5563298740, 0.025 | ||
| add_loop_inductor, compile_time_instruction_count, 24064639114, 0.015 | ||
| add_loop_inductor_dynamic_gpu, compile_time_instruction_count, 40992578178, 0.025 | ||
| add_loop_inductor_dynamic_gpu, compile_time_instruction_count, 38593682350, 0.025 |
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.
This change turned out to be a flake, I'll revert.
edf9cb9 to
bd1f72e
Compare
Instead of calling `safe_expand` right after symbolic expression construction, we invoke it in `ShapeEnv.simplify`. This enables more simplification with product form, e.g., ``` (a + b)^2 / (a + b) --> (a + b) ``` which won't happen if we expand eagerly during product construction: ``` (a^2 + 2ab + b^2) / (a + b) --> no change ``` Fixes #136044.
bd1f72e to
ca264be
Compare
_SympyT_SympyT to enable more folding
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.
Wow! Passing all tests. You probably should also import to fbcode and see what happens there.
|
@StrongerXi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Internals all passed. The red ones are OSS flaky tests from main. Merging |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: linux-binary-manywheel / manywheel-py3_9-cuda12_1-build / build Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f "unrelated failure" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |

Instead of calling
safe_expandright after symbolic expression construction, we invoke it inShapeEnv.simplify. This enables more simplification with product form, e.g.,which won't happen if we expand eagerly during product construction:
Fixes #136044.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @rec