[inductor] Fix bugs in emulate_precision_casts#163520
Closed
jansel wants to merge 4 commits intogh/jansel/546/basefrom
Closed
[inductor] Fix bugs in emulate_precision_casts#163520jansel wants to merge 4 commits intogh/jansel/546/basefrom
jansel wants to merge 4 commits intogh/jansel/546/basefrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/163520
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 49b28d4 with merge base 51152ef ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Sep 22, 2025
eellison
approved these changes
Sep 23, 2025
Comment on lines
-806
to
-809
| if ( | ||
| not isinstance(func, torch._ops.OpOverload) | ||
| or torch.Tag.pointwise not in func.tags | ||
| ): |
Comment on lines
+816
to
+821
| if not output_low_precision: | ||
| for input_node in last_node.all_input_nodes: | ||
| val = input_node.meta.get("val") if hasattr(input_node, "meta") else None | ||
| if isinstance(val, torch.Tensor) and val.dtype in low_pr_fp: | ||
| output_low_precision = True | ||
| break |
Contributor
There was a problem hiding this comment.
Thinking out loud:
For something like
x: bfloat16
y = x.to(float32)
This would set low_precision_pointwise_barrier on the x.to(float32) output. I guess this is okay because its actual dtype later in lowering will be float32, so we'll ignore it.
And the decomps themselves should be upcasting intermediaries to be fp32, so those will also get ignored, e.g. gelu here.
Collaborator
|
Starting merge as part of PR stack under #163482 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 24, 2025
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 24, 2025
This reverts commit a8cd437. See #163481 (comment) This PR might also cause issues with cudagraphs. Pull Request resolved: #163737 Approved by: https://github.com/ezyang ghstack dependencies: #163386, #163398, #163387, #163414, #163415, #163419, #163434, #163393, #163412, #163422, #163481, #163520, #163482
dsashidh
pushed a commit
to dsashidh/pytorch
that referenced
this pull request
Sep 26, 2025
Fixes pytorch#163449 Pull Request resolved: pytorch#163520 Approved by: https://github.com/eellison ghstack dependencies: pytorch#163386, pytorch#163398, pytorch#163387, pytorch#163414, pytorch#163415, pytorch#163419, pytorch#163434, pytorch#163393, pytorch#163412, pytorch#163422, pytorch#163481
dsashidh
pushed a commit
to dsashidh/pytorch
that referenced
this pull request
Sep 26, 2025
Fixes pytorch#163457 Pull Request resolved: pytorch#163482 Approved by: https://github.com/eellison ghstack dependencies: pytorch#163386, pytorch#163398, pytorch#163387, pytorch#163414, pytorch#163415, pytorch#163419, pytorch#163434, pytorch#163393, pytorch#163412, pytorch#163422, pytorch#163481, pytorch#163520
dsashidh
pushed a commit
to dsashidh/pytorch
that referenced
this pull request
Sep 26, 2025
This reverts commit a8cd437. See pytorch#163481 (comment) This PR might also cause issues with cudagraphs. Pull Request resolved: pytorch#163737 Approved by: https://github.com/ezyang ghstack dependencies: pytorch#163386, pytorch#163398, pytorch#163387, pytorch#163414, pytorch#163415, pytorch#163419, pytorch#163434, pytorch#163393, pytorch#163412, pytorch#163422, pytorch#163481, pytorch#163520, pytorch#163482
jainapurva
pushed a commit
that referenced
this pull request
Sep 29, 2025
jainapurva
pushed a commit
that referenced
this pull request
Sep 29, 2025
jainapurva
pushed a commit
that referenced
this pull request
Sep 29, 2025
This reverts commit a8cd437. See #163481 (comment) This PR might also cause issues with cudagraphs. Pull Request resolved: #163737 Approved by: https://github.com/ezyang ghstack dependencies: #163386, #163398, #163387, #163414, #163415, #163419, #163434, #163393, #163412, #163422, #163481, #163520, #163482
Khanaksahu
pushed a commit
to Khanaksahu/pytorch
that referenced
this pull request
Nov 17, 2025
Fixes #163449 ghstack-source-id: e173d84 Pull-Request: pytorch/pytorch#163520
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.
Stack from ghstack (oldest at bottom):
Fixes #163449
cc @ezyang @EikanWang @jgong5 @wenzhe-nrv @voznesenskym @penguinwu @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben