Repository navigation
[CI][ROCm] Mark 3 nondeterministic gfx950 models flaky to unblock inductor-periodic - #193216
bobrenjc93 wants to merge 2 commits into
Conversation
inductor-periodic has been red continuously since 2026-08-08 on the rocm-periodic-dynamo-benchmarks gfx950 jobs. No non-ROCm job in the workflow is failing, so the practical cost is that the workflow cannot surface any real inductor regression while it stays red. Root cause is not an inductor change. bb96371 ("[ROCm][CI] Switch rocm-preview to TheRock wheels and upgrade CI to 7.14", pytorch#188429) landed inside the window between the last green run and the first red one. Despite being scoped to rocm-preview by title it modified .ci/docker/common/install_rocm.sh and .ci/docker/ubuntu-rocm/Dockerfile, which are shared image definitions, so the pytorch-linux-jammy-rocm-n-py3-benchmarks image was rebuilt and every ROCm job picked up the new stack. Comparing the two runs directly, BUILD_ROCM_VERSION went from 7.2 to 7.14 and the ROCm root moved from /opt/rocm to the TheRock pip wheel at site-packages/_rocm_sdk_devel. Each entry here is driven by an observed failure rather than applied uniformly: - vit_base_patch14_dinov2.lvd142m reports eager_two_runs_differ, meaning two eager runs disagree. Inductor is not involved; the model is nondeterministic under 7.14. Only the two inference baselines actually fail, so the training baseline is deliberately left at fail_accuracy rather than being changed to match. - convnextv2_nano.fcmae_ft_in22k_in1k is pinned to fail_accuracy but now passes, and check_accuracy.py exits nonzero on improvements too, so a stale pessimistic baseline keeps the job red. - torch_multimodal_clip fails 100% consistently and one-directionally, which looks like a genuine numerical change under 7.14 rather than flakiness. Per discussion in pytorch#192862 it is being set to fail_accuracy to unblock CI, not because the behaviour is considered correct; pytorch#192862 stays open to track it. Test Plan: Failing entries were taken from the current periodic run rather than from memory, by extracting the check_accuracy output of each failing job: ``` gh api --paginate "repos/pytorch/pytorch/actions/runs/31599760277/jobs?per_page=100" \ --jq '.jobs[] | select(.conclusion=="failure") | .id' gh api repos/pytorch/pytorch/actions/jobs/<id>/logs | grep -E "FAIL:|IMPROVED:" ``` The edits assert on the previous value so a stale assumption fails loudly instead of writing the wrong cell, and all 15 ROCm CSVs were re-parsed afterwards: ``` python3 -c " import csv,glob for f in glob.glob('benchmarks/dynamo/ci_expected_accuracy/rocm/*.csv'): rows=[r for r in csv.reader(open(f)) if r] assert rows[0]==['name','accuracy','graph_breaks'] for r in rows[1:]: assert len(r)==3 " ``` Real validation is the next inductor-periodic run: the four gfx950 jobs should go green and the workflow should be able to report regressions again. Authored with the assistance of an AI assistant.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/193216
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit df1b0f6 with merge base 32617a2 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The pinned expected values in the previous commit do not hold. Running the
gfx950 jobs against that change (ciflow/inductor-periodic on this PR) fixed two
of the four failing jobs and left two red, both for the same reason:
dynamic_inductor_timm 2/2 vit_base_patch14_dinov2 IMPROVED: accuracy=pass, expected=fail_accuracy
dynamic_inductor_torchbench 2/2 torch_multimodal_clip IMPROVED: accuracy=pass, expected=fail_accuracy
That invalidates the reasoning behind the pins. torch_multimodal_clip was
described as failing 100% consistently and one-directionally; it passed on the
first run after being pinned to fail_accuracy. vit_base_patch14_dinov2 was only
changed on the inference baselines because only those were failing, and then
the untouched training baseline went red on an improvement.
check_accuracy.py fails a job on any mismatch in either direction, so pinning a
value for a nondeterministic model just moves which outcome turns the job red.
flaky_models is the mechanism for this: membership yields PASS_BUT_FLAKY or
FAIL_BUT_FLAKY, and neither appends to failed or improved, so the job is green
whichever way the model lands. The ROCm block already carries alexnet and
demucs for exactly this root cause ("Discovered on gfx950 CI after ROCm 7.2
upgrade, eager mode non determinism").
This reverts the four CSV edits and instead adds the three models to the
ROCm-scoped flaky_models set, so nothing changes for CUDA.
The tradeoff is deliberate and worth stating: flaky_models suppresses accuracy
signal for these three models on ROCm entirely, so a genuine regression in them
would no longer be caught. That is the same tradeoff already accepted for
alexnet and demucs, and pytorch#192862 stays open to investigate the underlying
nondeterminism.
Test Plan:
Simulated every observed outcome through the real check_accuracy() with the
reverted CSV values:
```
observed=pass job_fails=False
observed=eager_two_runs_differ job_fails=False
observed=fail_accuracy job_fails=False
```
versus the pinned approach, where two of those three turn the job red.
Authored with the assistance of an AI assistant.
|
@naromero77amd @jeffdaily @jataylo — the requested validation is complete: the current PR checks are fully green, including every ROCm job. This is ready for review and merge; #192862 remains open to track the underlying gfx950 nondeterminism and eventual removal of the exemptions. Could one of you take a look? (Follow-up posted by Codex.) |
|
@pytorchbot mergee |
|
❌ 🤖 pytorchbot command failed: Try |
|
@pytorchbot merge |
Merge failedReason: Approvers from one of the following sets are needed:
|
|
@jansel, could you take a quick look and approve this? The ROCm behavior has been validated and approved by @naromero77amd, and all checks are green, but the merge bot requires an approval from an eligible Core Reviewer or Metamate. Once that approval lands, I will rerun (Follow-up posted by Codex.) |
|
@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 |
…uctor-periodic (pytorch#193216) Unblocks the gfx950 half of pytorch#192862. `inductor-periodic` has been red on main for 23 consecutive runs, last green 2026-08-07, so the workflow currently cannot surface any real inductor regression. Not an inductor change. `bb96371605b` (pytorch#188429, "Switch rocm-preview to TheRock wheels and upgrade CI to 7.14") landed between the last green run and the first red one. Despite being scoped to `rocm-preview` by title it modified `.ci/docker/common/install_rocm.sh` and `.ci/docker/ubuntu-rocm/Dockerfile`, so the shared `pytorch-linux-jammy-rocm-n-py3-benchmarks` image was rebuilt and every ROCm job picked up the new stack (`BUILD_ROCM_VERSION` 7.2 -> 7.14, ROCm root moving from `/opt/rocm` to the TheRock wheel). ## Why flaky_models rather than rebaselining The first version of this PR pinned expected values per @naromero77amd's guidance in pytorch#192862. **I ran it against the real gfx950 jobs and it does not work.** Two of four jobs were fixed; two stayed red, both on the same mode: ``` dynamic_inductor_timm 2/2 vit_base_patch14_dinov2 IMPROVED: accuracy=pass, expected=fail_accuracy dynamic_inductor_torchbench 2/2 torch_multimodal_clip IMPROVED: accuracy=pass, expected=fail_accuracy ``` That invalidates the premise I gave for the pins: - I described `torch_multimodal_clip` as failing 100% consistently and one-directionally, so a genuine numerical change. It **passed** on the first run after being pinned to `fail_accuracy`. The 9/9 sample was real but not predictive. - I only changed `vit_base_patch14_dinov2` on the inference baselines, since only those were failing. The untouched **training** baseline then went red on an improvement. `check_accuracy.py` fails a job on a mismatch in *either* direction, so pinning a value for a nondeterministic model only changes which outcome turns the job red. `flaky_models` is the mechanism built for this: membership yields `PASS_BUT_FLAKY` / `FAIL_BUT_FLAKY`, and neither appends to `failed` or `improved`. The ROCm block already carries `alexnet` and `demucs` for precisely this root cause -- *"Discovered on gfx950 CI after ROCm 7.2 upgrade, eager mode non determinism"*. So this reverts the four CSV edits and adds the three models to the ROCm-scoped set. Nothing changes for CUDA. ## Tradeoff This suppresses accuracy signal for these three models on ROCm entirely, so a genuine regression in them would no longer be caught. That is the same tradeoff already accepted for `alexnet`/`demucs`, and pytorch#192862 stays open to investigate the nondeterminism -- consistent with "we will go back and triage later". If you would rather keep real signal for `torch_multimodal_clip` specifically, the alternative is extending `get_eager_nondeterministic_models()` to cover the ROCm paths (it currently returns entries only for two CUDA files). That tolerates only `pass -> eager_two_runs_differ` while still catching a genuine `fail_accuracy`. Happy to switch if preferred -- it is narrower but has no existing ROCm precedent. ## Test plan Every observed outcome simulated through the real `check_accuracy()` with the reverted CSV values: ``` observed=pass job_fails=False observed=eager_two_runs_differ job_fails=False observed=fail_accuracy job_fails=False ``` Under the pinned approach two of those three turn the job red. `ciflow/inductor-periodic` is applied so the gfx950 jobs actually run on this PR -- note `ciflow/trunk` and `ciflow/inductor` do **not** trigger this workflow, which is why the first revision went unverified. Final validation is those four jobs going green here. Authored with the assistance of an AI assistant. ## Maintainer decision @naromero77amd confirmed in pytorch#192862 that ROCm prefers the scoped `flaky_models` approach. The alternative eager-nondeterministic handling is therefore not part of this change. The tracking issue remains open for root-causing and eventually removing these exemptions. ## Final validation The `ciflow/inductor-periodic` branch run completed with all ROCm/gfx950 jobs green: https://github.com/pytorch/pytorch/actions/runs/31715044756. Its sole failure was an unrelated CPU Hugging Face offline-cache miss in `dynamic_cpu_inductor_timm 2/2`. Pull Request resolved: pytorch#193216 Approved by: https://github.com/naromero77amd, https://github.com/jansel
Unblocks the gfx950 half of #192862.
inductor-periodichas been red on mainfor 23 consecutive runs, last green 2026-08-07, so the workflow currently cannot
surface any real inductor regression.
Not an inductor change.
bb96371605b(#188429, "Switch rocm-preview to TheRockwheels and upgrade CI to 7.14") landed between the last green run and the first
red one. Despite being scoped to
rocm-previewby title it modified.ci/docker/common/install_rocm.shand.ci/docker/ubuntu-rocm/Dockerfile, sothe shared
pytorch-linux-jammy-rocm-n-py3-benchmarksimage was rebuilt andevery ROCm job picked up the new stack (
BUILD_ROCM_VERSION7.2 -> 7.14, ROCmroot moving from
/opt/rocmto the TheRock wheel).Why flaky_models rather than rebaselining
The first version of this PR pinned expected values per @naromero77amd's
guidance in #192862. I ran it against the real gfx950 jobs and it does not
work. Two of four jobs were fixed; two stayed red, both on the same mode:
That invalidates the premise I gave for the pins:
torch_multimodal_clipas failing 100% consistently andone-directionally, so a genuine numerical change. It passed on the first
run after being pinned to
fail_accuracy. The 9/9 sample was real but notpredictive.
vit_base_patch14_dinov2on the inference baselines, sinceonly those were failing. The untouched training baseline then went red on
an improvement.
check_accuracy.pyfails a job on a mismatch in either direction, so pinninga value for a nondeterministic model only changes which outcome turns the job
red.
flaky_modelsis the mechanism built for this: membership yieldsPASS_BUT_FLAKY/FAIL_BUT_FLAKY, and neither appends tofailedorimproved. The ROCm block already carriesalexnetanddemucsfor preciselythis root cause -- "Discovered on gfx950 CI after ROCm 7.2 upgrade, eager mode
non determinism".
So this reverts the four CSV edits and adds the three models to the
ROCm-scoped set. Nothing changes for CUDA.
Tradeoff
This suppresses accuracy signal for these three models on ROCm entirely, so a
genuine regression in them would no longer be caught. That is the same tradeoff
already accepted for
alexnet/demucs, and #192862 stays open to investigatethe nondeterminism -- consistent with "we will go back and triage later".
If you would rather keep real signal for
torch_multimodal_clipspecifically,the alternative is extending
get_eager_nondeterministic_models()to cover theROCm paths (it currently returns entries only for two CUDA files). That tolerates
only
pass -> eager_two_runs_differwhile still catching a genuinefail_accuracy. Happy to switch if preferred -- it is narrower but has noexisting ROCm precedent.
Test plan
Every observed outcome simulated through the real
check_accuracy()with thereverted CSV values:
Under the pinned approach two of those three turn the job red.
ciflow/inductor-periodicis applied so the gfx950 jobs actually run on this PR-- note
ciflow/trunkandciflow/inductordo not trigger this workflow,which is why the first revision went unverified. Final validation is those four
jobs going green here.
Authored with the assistance of an AI assistant.
Maintainer decision
@naromero77amd confirmed in #192862 that ROCm prefers the scoped
flaky_modelsapproach. The alternative eager-nondeterministic handling is therefore not part of this change. The tracking issue remains open for root-causing and eventually removing these exemptions.Final validation
The
ciflow/inductor-periodicbranch run completed with all ROCm/gfx950 jobs green: https://github.com/pytorch/pytorch/actions/runs/31715044756. Its sole failure was an unrelated CPU Hugging Face offline-cache miss indynamic_cpu_inductor_timm 2/2.cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @azahed98