Skip to content

[inductor] Fix reciprocal to use float32 for division_rounding#174751

Closed
mlazos wants to merge 29 commits intogh/mlazos/97/basefrom
gh/mlazos/97/head
Closed

[inductor] Fix reciprocal to use float32 for division_rounding#174751
mlazos wants to merge 29 commits intogh/mlazos/97/basefrom
gh/mlazos/97/head

Conversation

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 11, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/174751

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 119e900 with merge base 197c376 (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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.

mlazos added a commit that referenced this pull request Feb 11, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: 87aec4b
Pull-Request: #174751
mlazos added a commit that referenced this pull request Feb 11, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: 87aec4b
Pull-Request: #174751
mlazos added a commit that referenced this pull request Feb 11, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: 87aec4b
Pull-Request: #174751
[ghstack-poisoned]
mlazos added a commit that referenced this pull request Feb 11, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: dd633c7
Pull-Request: #174751
mlazos added a commit that referenced this pull request Feb 11, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: 87aec4b
Pull-Request: #174751
[ghstack-poisoned]
Comment thread test/inductor/test_cuda_repro.py Outdated
mlazos added a commit that referenced this pull request Feb 12, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: 49967f5
Pull-Request: #174751
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
mlazos added a commit that referenced this pull request Feb 18, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py
ghstack-source-id: 0edd804
Pull-Request: #174751
[ghstack-poisoned]
mlazos added a commit that referenced this pull request Feb 18, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

The OpDecompositions.reciprocal method decomposes reciprocal(x) to
1 / x. When eager_numerics.division_rounding is enabled, truediv checks
if both operands are float32 before using div_rn. With an int32 constant,
this check fails and regular division is used, causing ~13% of values
to differ from eager.

Test: test_reciprocal_precision_rounding in test_cuda_repro.py
ghstack-source-id: a658442
Pull-Request: #174751
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 3 checks: inductor / unit-test / inductor-test / test (inductor, 2, 2, linux.g5.4xlarge.nvidia.gpu), inductor / unit-test / inductor-test / test (inductor, 1, 2, linux.g5.4xlarge.nvidia.gpu), trunk / win-vs2022-cuda12.8-py3 / build

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: linux-aarch64 / linux-jammy-aarch64-py3.10 / test (openreg, 1, 1, lf.linux.arm64.m8g.4xlarge)

Details for Dev Infra team Raised by workflow job

@mlazos
Copy link
Copy Markdown
Contributor Author

mlazos commented Feb 27, 2026

@pytorchbot merge -f "unrelated failures"

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot added a commit that referenced this pull request Feb 27, 2026
#174751)"

This reverts commit 1b9046a.

Reverted #174751 on behalf of https://github.com/jeanschmidt due to Need to revert in order to revert #175555 - see D94699526 ([comment](#174933 (comment)))
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@mlazos your PR has been reverted as part of the stack under #174933.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Feb 27, 2026
@mlazos
Copy link
Copy Markdown
Contributor Author

mlazos commented Feb 28, 2026

@pytorchbot merge

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

v0i0 added a commit that referenced this pull request Mar 3, 2026
PR #174751 fixed reciprocal to use float32 for division_rounding,
which makes these xfails stale under the inductor_numerics backend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0i0 added a commit that referenced this pull request Mar 3, 2026
PR #174751 fixed reciprocal to use float32 for division_rounding,
which makes these xfails stale under the inductor_numerics backend.
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

The OpDecompositions.reciprocal method decomposes reciprocal(x) to
1 / x. When eager_numerics.division_rounding is enabled, truediv checks
if both operands are float32 before using div_rn. With an int32 constant,
this check fails and regular division is used, causing ~13% of values
to differ from eager.

Test: test_reciprocal_precision_rounding in test_cuda_repro.py
ghstack-source-id: 67e2eb4
Pull-Request: pytorch/pytorch#174751
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

The OpDecompositions.reciprocal method decomposes reciprocal(x) to
1 / x. When eager_numerics.division_rounding is enabled, truediv checks
if both operands are float32 before using div_rn. With an int32 constant,
this check fails and regular division is used, causing ~13% of values
to differ from eager.

Test: test_reciprocal_precision_rounding in test_cuda_repro.py
ghstack-source-id: 9bf7138
Pull-Request: pytorch/pytorch#174751
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 13, 2026
Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

The OpDecompositions.reciprocal method decomposes reciprocal(x) to
1 / x. When eager_numerics.division_rounding is enabled, truediv checks
if both operands are float32 before using div_rn. With an int32 constant,
this check fails and regular division is used, causing ~13% of values
to differ from eager.

Test: test_reciprocal_precision_rounding in test_cuda_repro.py
ghstack-source-id: 4f8ac82
Pull-Request: pytorch/pytorch#174751
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
…ch#174751)

Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py

Pull Request resolved: pytorch#174751
Approved by: https://github.com/v0i0
ghstack dependencies: pytorch#174749, pytorch#174933
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
pytorch#174751)"

This reverts commit 1b9046a.

Reverted pytorch#174751 on behalf of https://github.com/jeanschmidt due to Need to revert in order to revert pytorch#175555 - see D94699526 ([comment](pytorch#174933 (comment)))
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
…ch#174751)

Use float32 constant instead of int for reciprocal to ensure proper
floating-point division when emulating eager division rounding.

Test: test_div_precision_rounding in test_cuda_repro.py

Pull Request resolved: pytorch#174751
Approved by: https://github.com/v0i0
ghstack dependencies: pytorch#174749, pytorch#174933
@github-actions github-actions Bot deleted the gh/mlazos/97/head branch March 31, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants