Repository navigation
[ROCm][inductor][UT] Adjust MI200 addmm OpInfo tolerance - #186407
naromero77amd wants to merge 4 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/186407
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New FailuresAs of commit 4f0f14c with merge base 2ab78d8 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
cec515f to
1d6d406
Compare
|
@pytorchbot fix-lint |
|
Successfully applied lint patches in https://github.com/pytorch/pytorch/actions/runs/27038436764. Please pull locally before pushing more changes. |
|
@claude did the test_comprehensive_addmm_cuda_float16 UT pass on MI200? |
|
Claude finished @naromero77amd's task in 14m 8s —— View job MI200 CI Results for
|
|
@claude did the test_comprehensive_addmm_cuda_float16 UT pass on MI200 in the latest round of CI testing? |
|
Claude finished @naromero77amd's task in 2m 35s —— View job MI200 CI Results for
|
|
@claude review these changes |
|
Claude finished @jansel's task in 1m 37s —— View job Code Review: MI200 addmm OpInfo Tolerance
Overall: The change is correct and solves the problem. The runtime arch check approach is well-motivated (avoiding import-time HIP init), the tolerance values are reasonable for the expected divergence, and both Minor feedback
# MI200 eager backward uses the rocBLAS alt-impl to preserve FP16
# denormals; inductor's compiled GEMM does not, causing ~9*eps divergence.
# See: https://docs.pytorch.org/docs/stable/notes/numerical_accuracy.html#reduced-precision-fp16-and-bf16-gemms-and-convolutions-on-amd-instinct-mi200-devices
overridden_kwargs.update({"rtol": 2e-2, "atol": 1e-3})The notes about "why runtime not dict" and "atol required by PyTorch" are minor implementation details that the code structure already makes clear. That said, this is a style nit — the existing comment is not wrong, just verbose.
overridden_kwargs.update({"rtol": 2e-2, "atol": 1e-3})
func = op.get_op()
No blocking issues — LGTM with optional style nits. |
|
@claude did the test_comprehensive_addmm_cuda_float16 UT pass on MI200 in the latest round of CI testing? |
|
Claude finished @naromero77amd's task in 1m 42s —— View job MI200 CI Results for
|
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: inductor-rocm-mi200 / linux-jammy-rocm-py3.10-mi200 / test (inductor, 1, 2, linux.rocm.gpu.mi210.1) 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: trunk / linux-jammy-rocm-py3.10-mi355 / test (distributed, 2, 4, linux.rocm.gpu.gfx950.2) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Co-authored-by: Cursor <[email protected]>
Follow-up to the inline MI200 FP16 addmm tolerance override. Three
adjustments based on review:
- Widen rtol from 10*eps (~9.8e-3) to 2e-2. The previous value cleared
the observed worst-case relative diff (~9*eps, 8.76e-3) by only ~11%,
which is too thin for an unstable MI200 shard given the full
comprehensive sample sweep and rocBLAS solver-version variation.
- Drop the atol override. At the failing magnitudes (|ref| ~ 0.78) the
rtol*|ref| term dominates by two orders of magnitude, so atol=tiny
never affected pass/fail; leaving atol at its default keeps the test
as strict as possible where the absolute term matters.
- Rewrite the comment to record why the check is inline rather than in
inductor_override_kwargs (the arch query forces import-time HIP init
that this module otherwise avoids; reference_in_float=True is inherited
from the existing ("addmm", f16) cuda entry).
Test Plan:
On an AMD Instinct MI200 (gfx90a):
```
PYTORCH_OPINFO_SAMPLE_INPUT_INDEX=0 PYTORCH_TEST_WITH_ROCM=1 \
python test/inductor/test_torchinductor_opinfo.py \
TestInductorOpInfoCUDA.test_comprehensive_addmm_cuda_float16
```
Not run in this environment (no MI200 available here); requires gfx90a
hardware to exercise the override branch.
Authored with assistance from an AI coding assistant (Claude Code).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Pair the widened rtol override with an FP16-scale atol so the OpInfo comparison satisfies PyTorch tolerance requirements without overly relaxing near-zero checks. Co-authored-by: Cursor <[email protected]>
|
Successfully rebased |
5c33346 to
4f0f14c
Compare
|
@claude Are the failures related or can this PR be merged? |
|
Claude finished @naromero77amd's task in 1m 32s —— View job Are the failures related? Can this PR be merged?
Answer: No, the failures are not related to your change. This PR can be merged. CI summaryOf 10 workflows on the latest commit, 9 passed and only
What failed in
|
|
@pytorchbot merge -i |
1 similar comment
|
@pytorchbot merge -i |
|
@pytorchbot merge -f "unrelated infra issues" |
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 |
) ## Summary This addresses the UT regression exposed after pytorch#183766 routed MI200 FP16 backward GEMMs through rocBLAS to preserve subnormals. - Add an MI200-only tolerance override for Inductor `addmm` FP16 OpInfo coverage. - Keep the existing FP32 eager reference while allowing FP16-scale absolute/relative differences. ## Test plan - `python test/inductor/test_torchinductor_opinfo.py -k test_comprehensive_addmm_cuda_float16` Pull Request resolved: pytorch#186407 Approved by: https://github.com/jeffdaily Co-authored-by: Cursor <[email protected]> Co-authored-by: PyTorch MergeBot <[email protected]> Co-authored-by: Jeff Daily <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
) ## Summary This addresses the UT regression exposed after pytorch#183766 routed MI200 FP16 backward GEMMs through rocBLAS to preserve subnormals. - Add an MI200-only tolerance override for Inductor `addmm` FP16 OpInfo coverage. - Keep the existing FP32 eager reference while allowing FP16-scale absolute/relative differences. ## Test plan - `python test/inductor/test_torchinductor_opinfo.py -k test_comprehensive_addmm_cuda_float16` Pull Request resolved: pytorch#186407 Approved by: https://github.com/jeffdaily Co-authored-by: Cursor <[email protected]> Co-authored-by: PyTorch MergeBot <[email protected]> Co-authored-by: Jeff Daily <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
) ## Summary This addresses the UT regression exposed after pytorch#183766 routed MI200 FP16 backward GEMMs through rocBLAS to preserve subnormals. - Add an MI200-only tolerance override for Inductor `addmm` FP16 OpInfo coverage. - Keep the existing FP32 eager reference while allowing FP16-scale absolute/relative differences. ## Test plan - `python test/inductor/test_torchinductor_opinfo.py -k test_comprehensive_addmm_cuda_float16` Pull Request resolved: pytorch#186407 Approved by: https://github.com/jeffdaily Co-authored-by: Cursor <[email protected]> Co-authored-by: PyTorch MergeBot <[email protected]> Co-authored-by: Jeff Daily <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Summary
This addresses the UT regression exposed after #183766 routed MI200 FP16 backward GEMMs through rocBLAS to preserve subnormals.
addmmFP16 OpInfo coverage.Test plan
python test/inductor/test_torchinductor_opinfo.py -k test_comprehensive_addmm_cuda_float16cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben