Repository navigation
Re-land: symbolic shapes guarding_hint_or_throw and optimization_hint (#175497) (#177570) - #177570
Closed
laithsakka wants to merge 1 commit into
Closed
laithsakka wants to merge 1 commit into
laithsakka wants to merge 1 commit into
Conversation
laithsakka
requested review from
albanD,
aorenste,
bdhirsh and
bobrenjc93
as code owners
March 16, 2026 20:46
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/177570
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 7b236a4 with merge base 4b76c95 ( 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. |
|
@laithsakka has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96046862. |
laithsakka
force-pushed
the
export-D96046862
branch
from
March 16, 2026 23:18
8dd8595 to
aa49e3e
Compare
laithsakka
added a commit
to laithsakka/pytorch
that referenced
this pull request
Mar 16, 2026
…pytorch#175497) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862
laithsakka
added a commit
to laithsakka/pytorch
that referenced
this pull request
Mar 16, 2026
…pytorch#175497) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862
laithsakka
force-pushed
the
export-D96046862
branch
from
March 16, 2026 23:19
aa49e3e to
8603765
Compare
laithsakka
added a commit
to laithsakka/pytorch
that referenced
this pull request
Mar 16, 2026
…pytorch#175497) (pytorch#177570) Summary: Pull Request resolved: pytorch#177570 X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862
laithsakka
force-pushed
the
export-D96046862
branch
from
March 16, 2026 23:22
8603765 to
693c7a1
Compare
laithsakka
force-pushed
the
export-D96046862
branch
from
March 17, 2026 02:07
693c7a1 to
e265c04
Compare
laithsakka
added a commit
to laithsakka/pytorch
that referenced
this pull request
Mar 17, 2026
…pytorch#175497) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862
laithsakka
force-pushed
the
export-D96046862
branch
from
March 17, 2026 06:53
e265c04 to
8fbe804
Compare
laithsakka
added a commit
to laithsakka/pytorch
that referenced
this pull request
Mar 17, 2026
…pytorch#175497) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862
…pytorch#175497) (pytorch#177570) Summary: Pull Request resolved: pytorch#177570 X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862
laithsakka
force-pushed
the
export-D96046862
branch
from
March 17, 2026 06:56
8fbe804 to
7b236a4
Compare
bobrenjc93
approved these changes
Mar 17, 2026
huydhn
approved these changes
Mar 17, 2026
Contributor
Author
|
@pytorchbot commit |
|
❌ 🤖 pytorchbot command failed: Try |
Contributor
Author
|
@pytorchbot merge |
Collaborator
Merge failedReason: This PR has internal changes and must be landed via Phabricator! Please try reimporting/rexporting the PR! Details for Dev Infra teamRaised by workflow job |
meta-codesync Bot
pushed a commit
to pytorch/benchmark
that referenced
this pull request
Mar 17, 2026
… (#175497) (#2672) Summary: X-link: pytorch/pytorch#177570 Pull Request resolved: #2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Reviewed By: huydhn Differential Revision: D96046862 fbshipit-source-id: db85ae13d29b7ace03154f1829b2bcbc465a266b
Contributor
Author
|
@pytorchbot merge |
Collaborator
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 |
EmanueleCoradin
pushed a commit
to EmanueleCoradin/pytorch
that referenced
this pull request
Mar 30, 2026
…pytorch#175497) (pytorch#177570) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862 Pull Request resolved: pytorch#177570 Approved by: https://github.com/bobrenjc93, https://github.com/huydhn
AaronWang04
pushed a commit
to AaronWang04/pytorch
that referenced
this pull request
Mar 31, 2026
…pytorch#175497) (pytorch#177570) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862 Pull Request resolved: pytorch#177570 Approved by: https://github.com/bobrenjc93, https://github.com/huydhn
drizzlezyk
pushed a commit
to Ascend/pytorch
that referenced
this pull request
May 9, 2026
Co-authored-by: chansinging<[email protected]> Co-authored-by: Chansinging<[email protected]> # message auto-generated for no-merge-commit merge: !35103 merge main_sync_0509 into master TORCH MAIN SYNC: switch to release candidate of torch 2.12 update Created-by: chansinging Commit-by: Chansinging;chansinging Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 同步社区演进,例行更新 lintrunner规避,见[issue](https://gitcode.com/Ascend/pytorch/issues/1865) # 【修改方案】 出包参考社区改动,pytorch/pytorch#177570 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地A3服务器和ci流水线已跑通测试  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35103
gplutop7
pushed a commit
to gplutop7/pytorch
that referenced
this pull request
Jul 15, 2026
…pytorch#175497) (pytorch#177570) (pytorch#177570) Summary: X-link: pytorch/benchmark#2672 similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint. Test Plan: existing tests Reviewed By: huydhn Differential Revision: D96046862 Pull Request resolved: pytorch#177570 Approved by: https://github.com/bobrenjc93, https://github.com/huydhn
laithsakka
added a commit
that referenced
this pull request
Nov 9, 2026
…_throw Fixes #201817 ShapeEnv.evaluate_expr on a float-valued expression without an explicit hint returned the value truncated to int and installed an unsound guard, e.g. for FloatTrueDiv(1.0, sqrt(ToFloat(s0))) with s0=64 it returned 0 and guarded Eq(..., 0), which fails on the very inputs it was created from. Since #177570, compute_concrete_val uses guarding_hint_or_throw, which goes through _maybe_realize_expr and does int(expr), truncating sympy.Float. _guarding_hint_or_throw_base now returns a Python float for sympy.Float. _maybe_realize_expr (shared with the int-only optimization_hint paths) is unchanged. Typing: - Add overloads to the module-level guarding_hint_or_throw so SymBool/bool -> bool, SymInt/int -> int, SymNode -> int | bool | float. - ShapeEnv and Inductor SizeVarAllocator guarding_hint_or_throw / guarding_hints_or_throw now return int | float (| bool for ShapeEnv). - Int-only Inductor call sites (expand's mark_reuse size products and the CUTLASS EVT size_hint_fn callback) convert explicitly with int(). Test: python test/test_dynamic_shapes.py -k test_evaluate_expr_float_without_hint ghstack-source-id: b6bcdc8 Pull-Request: #202324
laithsakka
added a commit
that referenced
this pull request
Nov 9, 2026
…_throw Fixes #201817 ShapeEnv.evaluate_expr on a float-valued expression without an explicit hint returned the value truncated to int and installed an unsound guard, e.g. for FloatTrueDiv(1.0, sqrt(ToFloat(s0))) with s0=64 it returned 0 and guarded Eq(..., 0), which fails on the very inputs it was created from. Since #177570, compute_concrete_val uses guarding_hint_or_throw, which goes through _maybe_realize_expr and does int(expr), truncating sympy.Float. _guarding_hint_or_throw_base now returns a Python float for sympy.Float. _maybe_realize_expr (shared with the int-only optimization_hint paths) is unchanged. Typing: - Add overloads to the module-level guarding_hint_or_throw so SymBool/bool -> bool, SymInt/int -> int, SymNode -> int | bool | float. - ShapeEnv and Inductor SizeVarAllocator guarding_hint_or_throw / guarding_hints_or_throw now return int | float (| bool for ShapeEnv). - Int-only Inductor call sites (expand's mark_reuse size products and the CUTLASS EVT size_hint_fn callback) convert explicitly with int(). Test: python test/test_dynamic_shapes.py -k test_evaluate_expr_float_without_hint ghstack-source-id: f5cf443 Pull-Request: #202324
pytorchmergebot
pushed a commit
that referenced
this pull request
Nov 10, 2026
…_throw (#202324) Fixes #201817 ShapeEnv.evaluate_expr on a float-valued expression without an explicit hint returned the value truncated to int and installed an unsound guard, e.g. for FloatTrueDiv(1.0, sqrt(ToFloat(s0))) with s0=64 it returned 0 and guarded Eq(..., 0), which fails on the very inputs it was created from. Since #177570, compute_concrete_val uses guarding_hint_or_throw, which goes through _maybe_realize_expr and does int(expr), truncating sympy.Float. _guarding_hint_or_throw_base now returns a Python float for sympy.Float. _maybe_realize_expr (shared with the int-only optimization_hint paths) is unchanged. Pull Request resolved: #202324 Approved by: https://github.com/aorenste
laithsakka
added a commit
that referenced
this pull request
Nov 12, 2026
…_throw Fixes #201817 ShapeEnv.evaluate_expr on a float-valued expression without an explicit hint returned the value truncated to int and installed an unsound guard, e.g. for FloatTrueDiv(1.0, sqrt(ToFloat(s0))) with s0=64 it returned 0 and guarded Eq(..., 0), which fails on the very inputs it was created from. Since #177570, compute_concrete_val uses guarding_hint_or_throw, which goes through _maybe_realize_expr and does int(expr), truncating sympy.Float. _guarding_hint_or_throw_base now returns a Python float for sympy.Float. _maybe_realize_expr (shared with the int-only optimization_hint paths) is unchanged. Typing: - Add overloads to the module-level guarding_hint_or_throw so SymBool/bool -> bool, SymInt/int -> int, SymNode -> int | bool | float. - ShapeEnv and Inductor SizeVarAllocator guarding_hint_or_throw / guarding_hints_or_throw now return int | float (| bool for ShapeEnv). - Int-only Inductor call sites (expand's mark_reuse size products and the CUTLASS EVT size_hint_fn callback) convert explicitly with int(). Test: python test/test_dynamic_shapes.py -k test_evaluate_expr_float_without_hint ghstack-source-id: f1f992a Pull-Request: #202324
laithsakka
added a commit
that referenced
this pull request
Nov 13, 2026
…_throw Fixes #201817 ShapeEnv.evaluate_expr on a float-valued expression without an explicit hint returned the value truncated to int and installed an unsound guard, e.g. for FloatTrueDiv(1.0, sqrt(ToFloat(s0))) with s0=64 it returned 0 and guarded Eq(..., 0), which fails on the very inputs it was created from. Since #177570, compute_concrete_val uses guarding_hint_or_throw, which goes through _maybe_realize_expr and does int(expr), truncating sympy.Float. _guarding_hint_or_throw_base now returns a Python float for sympy.Float. _maybe_realize_expr (shared with the int-only optimization_hint paths) is unchanged. Typing: - Add overloads to the module-level guarding_hint_or_throw so SymBool/bool -> bool, SymInt/int -> int, SymNode -> int | bool | float. - ShapeEnv and Inductor SizeVarAllocator guarding_hint_or_throw / guarding_hints_or_throw now return int | float (| bool for ShapeEnv). - Int-only Inductor call sites (expand's mark_reuse size products and the CUTLASS EVT size_hint_fn callback) convert explicitly with int(). Test: python test/test_dynamic_shapes.py -k test_evaluate_expr_float_without_hint ghstack-source-id: 16a2d62 Pull-Request: #202324
pytorchmergebot
pushed a commit
that referenced
this pull request
Nov 13, 2026
…_throw (#202324) Fixes #201817 ShapeEnv.evaluate_expr on a float-valued expression without an explicit hint returned the value truncated to int and installed an unsound guard, e.g. for FloatTrueDiv(1.0, sqrt(ToFloat(s0))) with s0=64 it returned 0 and guarded Eq(..., 0), which fails on the very inputs it was created from. Since #177570, compute_concrete_val uses guarding_hint_or_throw, which goes through _maybe_realize_expr and does int(expr), truncating sympy.Float. _guarding_hint_or_throw_base now returns a Python float for sympy.Float. _maybe_realize_expr (shared with the int-only optimization_hint paths) is unchanged. Pull Request resolved: #202324 Approved by: https://github.com/aorenste
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:
X-link: pytorch/benchmark#2672
similar to sizevars changed, migrating to guarding_hint_or_throw or optimization_hint.
Test Plan: existing tests
Reviewed By: huydhn
Differential Revision: D96046862
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @Lucaskabela