Skip to content

Update loss numbers for ROCm MI350 label. - #3078

Merged
tianyu-l merged 1 commit into
pytorch:mainfrom
akashveramd:av_update_features_loss_numbers2
Apr 24, 2026
Merged

tianyu-l merged 1 commit into
pytorch:mainfrom
akashveramd:av_update_features_loss_numbers2

Conversation

@akashveramd

@akashveramd akashveramd commented Apr 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR updates the loss numbers for ROCm MI350 label as the numbers were found to be incorrect for this failing job https://github.com/pytorch/torchtitan/actions/runs/24852088864/job/72755031032. Although the loss numbers were already updated for MI350 label in this merged PR #2740.

If this issue is observed again, then @lizamd your team will need to look into it to find a better solution for this issue.
cc: @jithunnair-amd @tianyu-l

@akashveramd akashveramd self-assigned this Apr 23, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 23, 2026
@pytorch-bot

pytorch-bot Bot commented Apr 23, 2026

Copy link
Copy Markdown

Warning: Unknown label ciflow/rocm.
Currently recognized labels are

  • ciflow/8gpu
  • ciflow/h100.8

Please add the new label to .github/pytorch-probot.yml

@akashveramd

Copy link
Copy Markdown
Collaborator Author

@tianyu-l: There is a CPU failing test which is unrelated to ROCm. Rest all jobs are passing. Does this PR look good for merge?

@jithunnair-amd jithunnair-amd left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem in line with 95a2542, which updated the CUDA losses file in the same way.

@tianyu-l
tianyu-l merged commit 136f75a into pytorch:main Apr 24, 2026
16 of 18 checks passed
tianyu-l pushed a commit that referenced this pull request May 4, 2026
…osses (#3196)

## Summary

Replaces the placeholder values in
`tests/assets/losses/qwen3_moe_rocm_mi350x.txt` with values that the
MI350 leg of `8 GPU Feature Tests` actually produces, fixing a hard
regression on `main`. Intended as a **temporary unblock** — see
verification caveats at the bottom.

## Failure on main

Every `8 GPU Feature Tests` ROCm job on `main` since 2026-04-30 03:46
UTC has failed with:

```
AssertionError: 8.03601360321045 != 8.159435272216797
  Loss mismatch at step 1: baseline=8.03601360321045, imported=8.159435272216797
```

Failing run:
https://github.com/pytorch/torchtitan/actions/runs/25197047879

## Root cause

PR #3081 added the qwen3 MoE invocation to `8 GPU Feature Tests` and
committed `tests/assets/losses/qwen3_moe_rocm_mi350x.txt` with
placeholder values rather than values from a real MI350 run. Its own
description includes the TODO `Generate reference loss files on CI
machines: # ROCm (8×MI350X): python3 scripts/loss_compare.py ...`.

## Provenance of the new values

The new file is the `[LOSS_COMPARE] Actual baseline losses` block
extracted from the failing CI log of run 25197047879 (sha `70340f4e`).
Cross-checks:

- **CI determinism:** also extracted the same block from run 25182832721
(sha `0138bde8`); 100/100 lines bit-identical to 25197047879.
- **CUDA cross-check:** `qwen3_moe_cuda.txt` step 1 =
`8.03599739074707`. New MI350 step 1 = `8.03601360321045`. Differ by
~2e-5, the magnitude of bf16 hardware-precision difference between CUDA
and ROCm.
- **Independent gfx950 rerun:** ran `scripts/loss_compare.py`
baseline-only on a separate gfx950 box (MI355X, same CDNA4 arch as
MI350X) in a fresh venv with the same
`torch==2.13.0.dev20260428+rocm7.1` wheel CI uses. Step 1 + step 2
reproduce **bit-identically** (`8.03601360321045` and
`7.309834957122803`). This rules out the placeholder hypothesis: the
model+config genuinely converges to ~8.036 at step 1 on gfx950.

## Verification caveats — please have a second reviewer with proper
MI350 access confirm

The independent gfx950 rerun above matched bit-identically only at steps
1 and 2; at step 3 onward it drifted at the 5th–6th significant digit
(e.g. step 100 differed by ~3e-4). Likely sources: the qwen3 invocation
in CI does not pass `--debug.deterministic` / `--debug.seed=42`, and
ROCm runtime env vars / hipBLASLt heuristic selection / host CPU layout
differ between hosts. So:

- This file is bit-identical to what *the CI runner* produces (verified
twice across two SHAs), so CI will pass.
- It is **not necessarily** what every gfx950 box anywhere will produce.
The same fragility is documented for the dense `llama3_rocm_mi350x.txt`
baseline (re-baselined every few weeks, most recently in #3078).
- I do not have access to the actual CI MI350X runner to verify on the
canonical hardware. **A reviewer with such access should re-run
`scripts/loss_compare.py` baseline-only with `--baseline-module=qwen3
--baseline-config=qwen3_moe_debug --steps=100` and confirm the produced
values match this file** before treating this as anything more than a
temporary unblock to get `main` green.

## Scope

- Touches **only** `tests/assets/losses/qwen3_moe_rocm_mi350x.txt`
(100-line replacement).
- The dense `llama3_rocm_mi350x.txt` baseline is untouched.
- No workflow YAML, model code, or `qwen3_moe_debug` config changes.
- A more durable fix — adding `--debug.deterministic` and
`--debug.seed=42` to the qwen3 invocation in
`integration_test_8gpu_features.yaml` to remove the cross-host fragility
— is out of scope here and worth a separate discussion.

## Test plan

- [x] Pre-commit clean on the modified file.
- [x] File still 100 lines, format `<step> <loss>` unchanged,
terminating newline preserved.
- [x] Step 1 + step 2 bit-reproduced on independent gfx950 host.
- [ ] `8 GPU Feature Tests` ROCm leg goes green on this PR.
- [ ] Independent confirmation on canonical MI350X CI hardware
(requested above).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/rocm ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot. module: rocm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants