Skip to content

[CI][ROCm] Mark 3 nondeterministic gfx950 models flaky to unblock inductor-periodic - #193216

Closed
bobrenjc93 wants to merge 2 commits into
pytorch:mainfrom
bobrenjc93:bob/rocm-gfx950-rebaseline
Closed

bobrenjc93 wants to merge 2 commits into
pytorch:mainfrom
bobrenjc93:bob/rocm-gfx950-rebaseline

Conversation

@bobrenjc93

@bobrenjc93 bobrenjc93 commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Unblocks the gfx950 half of #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 (#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 #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 #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 #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.

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

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.
@pytorch-bot

pytorch-bot Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

🔗 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 Failures

As of commit df1b0f6 with merge base 32617a2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@bobrenjc93 bobrenjc93 added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 12, 2026
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.
@bobrenjc93 bobrenjc93 changed the title [CI][ROCm] Rebaseline gfx950 dynamo benchmark accuracy for ROCm 7.14 [CI][ROCm] Mark 3 nondeterministic gfx950 models flaky to unblock inductor-periodic Aug 13, 2026
@bobrenjc93
bobrenjc93 marked this pull request as ready for review August 14, 2026 03:02
@bobrenjc93

Copy link
Copy Markdown
Contributor Author

@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.)

@bobrenjc93

Copy link
Copy Markdown
Contributor Author

@pytorchbot mergee

@pytorch-bot

pytorch-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'mergee' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'lint', 'fix-lint', 'apply-lint', 'cherry-pick')

usage: @pytorchbot [-h]
                   
                   {merge,revert,rebase,label,drci,lint,fix-lint,apply-lint,cherry-pick}
                   ...

Try @pytorchbot --help for more info.

@bobrenjc93

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: Approvers from one of the following sets are needed:

  • ONNX exporter (justinchuby, liqunfu, shubhambhokare1, titaiwangms, wschin, ...)
  • Metamates (aditvenk, AmesingFlank, amirafzali, angelayi, anshul-si, ...)
  • Core Reviewers (mruberry, lezcano, Skylion007, ngimel, peterbell10, ...)
  • Core Maintainers (soumith, gchanan, ezyang, malfet, albanD, ...)
Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@bobrenjc93
bobrenjc93 requested a review from a team August 15, 2026 03:55
@bobrenjc93

Copy link
Copy Markdown
Contributor Author

@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 @pytorchbot merge. #192862 will remain open to track the underlying gfx950 nondeterminism and eventual removal of these exemptions.

(Follow-up posted by Codex.)

@bobrenjc93
bobrenjc93 requested a review from jansel August 15, 2026 22:00
@jansel

jansel commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

@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

orrangetabby17 pushed a commit to orrangetabby17/pytorch that referenced this pull request Sep 2, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants