Skip to content

Fix inductor_timm eager nondeterminism baselines - #187954

Closed
jansel wants to merge 1 commit into
gh/jansel/1509/basefrom
gh/jansel/1509/head
Closed

jansel wants to merge 1 commit into
gh/jansel/1509/basefrom
gh/jansel/1509/head

Conversation

@jansel

@jansel jansel commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

The inductor_timm CUDA training shards were failing before they ever
compiled mobilenetv2_100 and tf_efficientnet_b0. The benchmark first
runs two eager train-mode AMP executions and compares them with zero
tolerance on CUDA; these two TIMM models are not bitwise deterministic in
that eager precheck, so the run recorded eager_two_runs_differ and
exited with zero Dynamo graphs. The later graph-break 0 readings in CI
were therefore early-exit artifacts, not real graph-break improvements.

Teach the TIMM benchmark about a CUDA Inductor AMP-scoped eager
nondeterminism skip list. The skip is keyed off the active device so mixed
CPU/CUDA runs do not hide CPU accuracy, and it only applies to training
accuracy runs on CUDA Inductor AMP. Update the static and dynamic CUDA
TIMM training expected accuracy rows to pass_due_to_skip while keeping
the existing graph-break baselines intact, so CI still requires the models
to compile and report their normal graph-break counts.

I considered simply updating the graph-break baselines to zero, as suggested
by the generic checker output, but that would bless the early-exit artifact
caused by the eager/eager failure. Recording the eager nondeterminism is the
narrower fix and preserves graph-break coverage.

Fixes #187951
Generated by my agent

Test Plan:

  • python -m unittest benchmarks.dynamo.test.TestDynamoBenchmark.test_timm_auto_install_uses_no_deps benchmarks.dynamo.test.TestDynamoBenchmark.test_prepare_repro_installs_timm_without_deps benchmarks.dynamo.test.TestDynamoBenchmark.test_timm_cuda_inductor_amp_skips_eager_nondeterministic_models
  • git diff --cached --check
  • bash -lc 'python benchmarks/dynamo/check_accuracy.py --actual <(printf "name,accuracy,graph_breaks\nmobilenetv2_100,pass_due_to_skip,7\ntf_efficientnet_b0,pass_due_to_skip,6\n") --expected benchmarks/dynamo/ci_expected_accuracy/inductor_timm_training.csv && python benchmarks/dynamo/check_graph_breaks.py --actual <(printf "name,accuracy,graph_breaks\nmobilenetv2_100,pass_due_to_skip,7\ntf_efficientnet_b0,pass_due_to_skip,6\n") --expected benchmarks/dynamo/ci_expected_accuracy/inductor_timm_training.csv'
  • lintrunner -a

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @jataylo @azahed98

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (2 Unrelated Failures)

As of commit 779d1fa with merge base 9f132a8 (image):

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

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@jansel

jansel commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@claude review these changes

@claude

claude Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

Claude finished @jansel's task in 6m 56s —— View job


PR Review: Fix inductor_timm eager nondeterminism baselines

  • Gather context (PR diff)
  • Review timm_models.py logic
  • Review test changes
  • Review CSV / yaml baseline changes

Overall this is a clean, well-scoped fix. The diagnosis (eager/eager precheck early-exit being misread as a graph-break improvement) is convincing, and recording the eager nondeterminism rather than blessing the 0 graph-break artifact is the right call — it preserves real compile + graph-break coverage. Verified the supporting mechanics:

Correctness — confirmed

  • benchmark_common.current_device is a genuine module-level global, declared global in run() (common.py:4465-4476) and assigned per-model at common.py:4826. So reading benchmark_common.current_device in the property reflects the active device at the time the accuracy check runs (common.py:2362, 2439, 2574). The device-keying works at runtime, not just in the test.
  • The skip only widens the set; base eager_not_deterministic behavior is untouched, and the torch.version.hip is None guard correctly excludes ROCm.
  • No CPU regression risk: timm training in CI is CUDA-only (inductor_timm_training.csv / dynamic_inductor_timm_training.csv are the CUDA configs; CPU uses cpu_inductor_timm_* and only has inference files). So flipping these two rows to pass_due_to_skip won't mask CPU accuracy, and the device-keyed guard is belt-and-suspenders for any mixed run.
  • Checker interaction is right: with expected pass_due_to_skip and actual pass_due_to_skip, check_accuracy.py:73-74 prints XFAIL and continues (not a failure). If a model later becomes deterministic and reports pass, it surfaces as IMPROVED: (check_accuracy.py:88), prompting a baseline refresh — good failure-forward behavior. Graph-break baselines (7/6) are untouched, so check_graph_breaks.py still enforces compilation.

Minor observations (non-blocking)

  1. timm_models.py:215-218 — the args.devices fallback is effectively dead in production. By the time any of the three call sites query this property, current_device is already set, so the single-device fallback only matters for the unit test (which sets current_device directly anyway) or for callers that read the property before run(). It's harmless, but if you want to trim it, the property could rely on current_device alone. Keeping it is also fine as defensive code.

  2. timm_models.yaml provides a list, consumed via set().update(list) — works correctly. The .get(..., set()) default is good defensiveness if the key is ever removed.

  3. Test coverage is solid — it exercises CUDA-AMP-inductor (skip present), CPU (skip absent), and AMP-off (skip absent). One uncovered axis is the ROCm path (torch.version.hip), but mocking that is awkward and the guard is simple; not worth adding.

Nothing here blocks merge. LGTM.
· branch gh/jansel/1509/head

@frgossen

Copy link
Copy Markdown
Contributor

@jansel are you confident that this is the right fix? I see these tests failing after a cDNN upgrade in #187091. It looks like cuDNN is introducing nondeterminism here.

@frgossen

Copy link
Copy Markdown
Contributor

For reference: #188288

pytorchmergebot pushed a commit that referenced this pull request Jun 26, 2026
> **Re-land of #185453** — identical content. The original was reverted twice, **neither pin-caused**: an OSS autorevert false-positive on a flaky CUDA-init in the *unstable* vLLM shard, and an internal sync-revert. `autorevert: disable` is set here to prevent a recurrence.

Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s #10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: #187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: #187954).

Pull Request resolved: #188251
Approved by: https://github.com/njriasan, https://github.com/atalman
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`pytorch#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s pytorch#10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: pytorch#187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: pytorch#187954).

Pull Request resolved: pytorch#185453
Approved by: https://github.com/atalman
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
…188251)

> **Re-land of pytorch#185453** — identical content. The original was reverted twice, **neither pin-caused**: an OSS autorevert false-positive on a flaky CUDA-init in the *unstable* vLLM shard, and an internal sync-revert. `autorevert: disable` is set here to prevent a recurrence.

Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`pytorch#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s pytorch#10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: pytorch#187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: pytorch#187954).

Pull Request resolved: pytorch#188251
Approved by: https://github.com/njriasan, https://github.com/atalman
vishalgoyal316 pushed a commit to vishalgoyal316/pytorch that referenced this pull request Jul 16, 2026
Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`pytorch#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s pytorch#10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: pytorch#187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: pytorch#187954).

Pull Request resolved: pytorch#185453
Approved by: https://github.com/atalman
vishalgoyal316 pushed a commit to vishalgoyal316/pytorch that referenced this pull request Jul 16, 2026
…188251)

> **Re-land of pytorch#185453** — identical content. The original was reverted twice, **neither pin-caused**: an OSS autorevert false-positive on a flaky CUDA-init in the *unstable* vLLM shard, and an internal sync-revert. `autorevert: disable` is set here to prevent a recurrence.

Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`pytorch#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s pytorch#10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: pytorch#187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: pytorch#187954).

Pull Request resolved: pytorch#188251
Approved by: https://github.com/njriasan, https://github.com/atalman
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`pytorch#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s pytorch#10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: pytorch#187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: pytorch#187954).

Pull Request resolved: pytorch#185453
Approved by: https://github.com/atalman
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
…188251)

> **Re-land of pytorch#185453** — identical content. The original was reverted twice, **neither pin-caused**: an OSS autorevert false-positive on a flaky CUDA-init in the *unstable* vLLM shard, and an internal sync-revert. `autorevert: disable` is set here to prevent a recurrence.

Updates the Triton pin from **3.7.1 → 3.8**.

## Pin target
[`triton-lang/triton@43422b04`](triton-lang/triton@43422b0) — the tip of Triton's **`release/3.8.x`** branch (cut from `3bb23dde`). On top of the 3.8 line it carries two cherry-picks needed for this bump:

- **LLVM pin → [`llvm/llvm-project#203770`](llvm/llvm-project#203770 (triton-lang/triton#10719) — fixes a **gfx950 / MI350 bf16 inference miscompile (silent NaN)** under `torch.compile` that otherwise blocks this bump (deit / beit / nanogpt / ViT). Root cause is an upstream LLVM AMDGPU WAR-hazard regression (`pytorch#197267`); `#203770` is the upstream fix, cherry-picked into Triton's LLVM fork and rebuilt as the prebuilt LLVM. Validated on an MI350 box (bf16 inference PASS; NaN without it).
- **AMD buffer soffset-opt revert** (triton-lang/triton#10720) — stability; mirrors `main`'s pytorch#10715.

## Published-wheel constraint
Release wheels now pin Triton to the **minor** version — `triton~=3.8.0` in `.ci/pytorch/binary_populate_env.sh` — so future `3.8.x` patch releases are picked up without re-releasing PyTorch. Nightly / dev wheels keep their exact `+git<hash>` pins.

## CI
Pin-caused CI failures are tracked in the issue tracker: pytorch#187401. The principal blocker (gfx950 / MI350 bf16 miscompile) is resolved by the `release/3.8.x` LLVM pin above. Any [inductor_timm test-osdc](https://hud.pytorch.org/pr/pytorch/pytorch/185453) failure is a pre-existing PyTorch issue unrelated to the Triton pin (fix: pytorch#187954).

Pull Request resolved: pytorch#188251
Approved by: https://github.com/njriasan, https://github.com/atalman
@github-actions
github-actions Bot deleted the gh/jansel/1509/head branch July 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.

2 participants