Skip to content

[ci] Refresh A10G golden losses for torch nightly 20261125's Inductor deterministic mode - #6398

Merged
tianyu-l merged 1 commit into
mainfrom
golden-fp-fusion-nightly-1125
Nov 26, 2026
Merged

tianyu-l merged 1 commit into
mainfrom
golden-fp-fusion-nightly-1125

Conversation

@tianyu-l

@tianyu-l tianyu-l commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary (human-written)

Why

Since torch 2.16.0.dev20261125, "1 GPU Integration (Fake PG)" fails on every PR and "8 GPU Integration (Real PG - full suite - models)" fails on main. The A10G golden losses drift in the low digits. Torch dev20261124 passed (last green: 11:04 UTC run 45601059954), and every run after the nightly switch fails the same tests with the same values.

The cause is pytorch/pytorch#204322, "[inductor] Deterministic mode: turn off Triton FMA contraction, emit explicit FMAs". In config.deterministic mode, Inductor now compiles its generated Triton kernels with enable_fp_fusion=False, so the result no longer depends on which block size or num_warps autotuning picks. The golden runs set debug.deterministic=True, so their rounding changes. This is an intentional upstream numerics change, not a torchtitan bug, so the fix is to regenerate the goldens.

Example (llama3_fsdp+tp+cp, Fake PG, A10G):

step  golden (dev20261124)          dev20261125
4     3.6361570  gn 0.76279575      3.6361570  gn 0.76279598
5     3.6227007                     3.6228001
10    3.4226971                     3.4225903

How the cause was isolated

The two nightlies are 70 PyTorch commits apart (283f59dd27...122eafd311), and the new torch also pins cuDNN 9.28.1 (was 9.26.0). I bisected locally on GB300 with deepseek_v3_fsdp+ep (Fake PG), which reproduces the drift there. Each row below gives bitwise-identical results on repeat runs.

torch binary cuDNN Python change step 1 loss
dev20261124 9.26.0 -- 7.990665912628174
dev20261124 9.28.1 -- 7.990665912628174
dev20261125 9.28.1 -- 7.990651607513428
dev20261125 9.28.1 dev20261124's _inductor/_dynamo/fx/... 7.990665912628174
dev20261125 9.28.1 only #204322 reverted 7.990665912628174
dev20261125 9.28.1 only #204320 reverted 7.990651607513428
dev20261125 9.28.1 #184946, #206365, #203784, #203888 reverted 7.990651607513428

So the cuDNN bump has no effect, and reverting #204322 alone restores the old numerics bit for bit.

What changed

Mechanical: the numeric rows of 11 golden files are replaced. Headers and step counts are unchanged and were checked against the source blocks.

Golden file Tests max rel. loss diff final loss old -> new
fake_pg/a10g/llama3.txt llama3_fsdp+tp+cp, +region_ac 3.1e-05 3.42270 -> 3.42259
fake_pg/a10g/deepseek_v3.txt deepseek_v3_fsdp+ep 4.0e-05 6.32932 -> 6.32955
fake_pg/a10g/qwen3.txt qwen3_moe_fsdp+tp+cp+ep_param_groups 5.5e-03 2.96522 -> 2.98026
fake_pg/a10g/muse_glimmer.txt muse_glimmer_text_fsdp 3.4e-04 6.71710 -> 6.71748
real_pg/a10g/llama3.txt llama3_fsdp+tp+cp, +region_ac 7.1e-05 4.05240 -> 4.05239
real_pg/a10g/llama3_pp.txt llama3_fsdp+tp+pp 6.3e-05 4.19607 -> 4.19609
real_pg/a10g/deepseek_v3.txt deepseek_v3_fsdp+ep 1.1e-04 3.81001 -> 3.81031
real_pg/a10g/deepseek_v3_cp_pp.txt deepseek_v3_fsdp+cp+pp+ep 2.5e-04 3.83078 -> 3.83064
real_pg/a10g/gpt_oss_pp.txt gpt_oss_pp+fsdp+cp+ep+sacop 1.7e-03 3.90803 -> 3.90858
real_pg/a10g/qwen3.txt qwen3_moe_fsdp+tp+cp+ep_param_groups 6.8e-05 5.34935 -> 5.34934
real_pg/a10g/muse_glimmer.txt muse_glimmer_text_fsdp 8.0e-03 3.71158 -> 3.70928

Over 10 steps, last-bit differences grow more in some runs than others (real_pg muse_glimmer 8.0e-3, gpt_oss_pp 1.7e-3, fake_pg qwen3 5.5e-3). Final losses move in both directions. Fake PG grad norms are already meaningless (up to ~1e17) and change by more.

{fake_pg,real_pg}/a10g/sft.txt are unchanged and still pass. gpt_oss_fsdp+tp+ep (gpt_oss.txt), and gpt_oss_pp+fsdp+ep+sacop in Real PG, crash under dev20261125 for a separate reason. pytorch/pytorch#206398 made varlen's lse differentiable, and only FA4 can backpropagate through it. That is fixed in a separate PR, so this PR's Fake PG and Real PG jobs still fail on those two tests.

Numerics

The new values are the "Baseline metrics in import file format" blocks that loss_compare printed in the A10G CI logs under dev20261125. A10G numerics can't be reproduced off that hardware, so they come straight from CI. The values agree across runs:

Testing

  • This PR's CI is the test. ciflow/fake-pg checks the 4 fake-PG files. ciflow/real-pg is added so the full Real PG suite checks all 7 real-PG files. The real_pg_required subset only covers llama3_pp, deepseek_v3_cp_pp and gpt_oss_pp.
  • The local bisection above used python -m tests.integration_tests.run_tests --execution_mode fake_pg --ngpu 1 --test_name deepseek_v3_fsdp+ep on GB300, with each torch/cuDNN combination as a PYTHONPATH overlay.
  • pre-commit run on the changed files passes.

Known issues / follow-ups

  • real_pg/mi350x/* is not updated. The ROCm workflow (integration_test_rocm.yaml) still passes on main because the ROCm nightly index serves torch dev20261119, which predates #204322 (run 45670678052). Expect the same drift on MI350X once the ROCm nightly advances. Those goldens need a refresh from that run's logs then.
  • real_pg/kimi_k3_b200.txt (B200 workflow) and rl_grpo_cuda.txt (RL loss guard) are unaffected for now. Those jobs end up on pinned older torch (dev20261102 and dev20261107 in today's runs). Expect the same drift when their torch pins move past dev20261125.
  • The goldens track whatever nightly CI installs, so a later nightly can shift them again.

… deterministic mode

pytorch/pytorch#204322 (first in torch 2.16.0.dev20261125) compiles
Inductor's generated Triton kernels with FMA contraction off in
deterministic mode. The golden runs use debug.deterministic=True, so
loss and grad_norm drift in the low digits and the A10G Fake PG and
Real PG model suites fail on every PR and on main.

Values are taken from the CI logs of the A10G runs with the new
nightly (Fake PG: #6395 at main HEAD, agreeing with #6245, #5678,
#6389; Real PG: main 7ccb1bb, agreeing with three earlier main runs).
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Nov 25, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 25, 2026
@tianyu-l

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @tianyu-l's task in 1m 35s —— View job


Approve, with a few description fixes to make before merging -- see the review.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The drift comes from an intentional upstream numerics change (pytorch/pytorch#204322). The bisection pins it to that one commit bit for bit, so regenerating the goldens is the right fix and there's nothing for torchtitan to change in code.

What this PR does. It replaces the numeric rows of 11 A10G golden-loss files with values that loss_compare printed in CI under torch dev20261125. Headers and step counts are unchanged. I checked every hunk: each file has 10 rows replaced and 10 added, and no header lines changed.

Example. llama3_fsdp+tp+cp, Fake PG: step 4 loss stays at 3.6361570, step 5 changes 3.6227007 -> 3.6228001, step 10 changes 3.4226971 -> 3.4225903. Since #204322, Inductor's deterministic mode compiles Triton kernels with enable_fp_fusion=False. That changes rounding in every golden run that sets debug.deterministic=True.

Must fix

  1. Description: "Summary (human-written)" is empty. Please fill it in before merging.
  2. Description: "This PR's CI (Fake PG and Real PG on A10G) is the test" isn't accurate for 4 of the 7 real-PG files. With only ciflow/fake-pg, the real-PG job runs TEST_SCOPE=real_pg_required (.github/workflows/integration_test.yaml:154). That scope only keeps tests with use_real_pg=True (tests/integration_tests/run_tests.py:404-408), so it checks llama3_pp, deepseek_v3_cp_pp and gpt_oss_pp. real_pg/a10g/{llama3,deepseek_v3,qwen3,muse_glimmer}.txt are only exercised by the full suite on main. The values do match four main runs, so the risk is low. Either push ciflow/real-pg so this PR checks all 7 files before merge, or reword Testing to say these 4 rely on the main-run logs.

Should consider

  • Description: "The larger diffs are in the 10-step MoE debug runs" doesn't match the table. The largest diff (real_pg/a10g/muse_glimmer.txt, 8.0e-3) is a dense FSDP model with no MoE in torchtitan/models/muse_glimmer/. It uses attn_backend="flex" (tests/integration_tests/models.py:517), so the bigger shift is more likely from flex attention's Triton kernel now compiling without FMA contraction. Please reword that sentence (unverified cause).

Questions

  • Are the other deterministic goldens on nightly CI affected: tests/assets/losses/real_pg/kimi_k3_b200.txt (B200 workflow) and tests/assets/losses/rl_grpo_cuda.txt (RL loss guard, --assert-equal)? If either path compiles Triton kernels in deterministic mode, it should drift the same way. That would mean either a follow-up refresh or a note under "Known issues" next to MI350X.

Not verified: the new values themselves. They come from A10G CI logs and can't be reproduced off that hardware. This PR changes only test assets, but a maintainer still needs to review it.

@tianyu-l tianyu-l added the ciflow/real-pg Run the full 8-GPU Real PG integration suite label Nov 25, 2026
@tianyu-l

Copy link
Copy Markdown
Contributor Author

Merging because remaining failure is on GPT-OSS which will be fixed by #6400.

@tianyu-l
tianyu-l merged commit a5e0c92 into main Nov 26, 2026
21 of 24 checks passed
@tianyu-l
tianyu-l deleted the golden-fp-fusion-nightly-1125 branch November 26, 2026 04:00
tianyu-l added a commit that referenced this pull request Nov 26, 2026
## Summary (human-written)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
     this approach, and what you checked yourself. -->

## Why
`TrainingEngine` binds each rank to its GPU's NUMA node at startup
(`torchtitan/training_engine.py` -> `maybe_apply_numa_binding` in
`torchtitan/distributed/offloading.py`). `torch.numa.binding` refuses to
bind unless the `numactl` CLI is on `PATH`, and none of our CI images
install it. So every rank of every integration test logs the same
traceback twice, once at error level and once at warning level, then
continues without binding.

**Example** (`1 GPU Integration (Fake PG)`, `llama3_fsdp+tp+cp`, a
passing test):

```
E... torch/numa/binding.py:257] Failed to apply NUMA binding for input={'device_index': 0, ...
E... torch/numa/binding.py:257]     raise RuntimeError("numactl CLI is required for NUMA binding")
W... torch/numa/binding.py:259] Continuing executing without applying NUMA binding, despite exception Traceback ...
W... torch/numa/binding.py:259] RuntimeError: numactl CLI is required for NUMA binding
```

The traceback shows up 164 times in one Fake PG log, 820 times in one
A10G Real PG models log and 644 times in one ROCm models log. Nothing
fails, but people reading failed CI logs take it for the cause (this
happened on #6398).

## What changed
- `.ci/docker/common/install_base.sh`: add `numactl` to the apt
packages. All three images (`torchtitan-ubuntu-22.04-clang12`, its `:rl`
variant, `torchtitan-rocm-ubuntu-22.04-clang12`) run this script.

torch only checks that the binary exists (`shutil.which("numactl")`).
The in-process binding torchtitan uses then calls `sched_setaffinity`,
so the container needs no extra privileges.

## Alternatives considered
- Skip binding quietly in `maybe_apply_numa_binding` when `numactl` is
missing: that would hide the same misconfiguration on real clusters,
where binding matters for CPU-offloaded optimizer states
(`torchtitan/components/optim/CPU_OFFLOADED_MOMENTS.md`). CI should run
the binding path the recipes use.

## Numerics
None. CPU affinity doesn't affect GPU computation, so golden losses stay
the same.

## Testing
`.ci/docker` changes the image tag (`git rev-parse HEAD:.ci/docker`), so
this PR needs `ciflow/docker` to build the images before the GPU jobs
can pull them. After the build, check that the GPU job logs no longer
contain `numactl CLI is required` and show the `CPU affinity for GPU N`
line.
IvanKobzarev added a commit to IvanKobzarev/torchtitan that referenced this pull request Dec 1, 2026
Port the Cuspy configuration and golden-loss updates from pytorch#6390 and pytorch#6398. Use the GPT-OSS attention backend split from pytorch#6400 so varlen LSE backward runs on FA4 hardware. Select both Gloo and NCCL for the Muon CPU-offload test mesh.
akashveramd pushed a commit to akashveramd/torchtitan that referenced this pull request Dec 1, 2026
…y 20261201 (#22)

With the ROCm CI index on rocm10.1 the models leg picks up a torch nightly
past 20261125 for the first time, and 8 mi350x goldens no longer match bit
for bit. Two upstream changes stack: pytorch/pytorch#204322 (Inductor
deterministic mode now compiles Triton with enable_fp_fusion=False; CUDA
absorbed this in pytorch#6398) and rocm10.0 -> rocm10.1 library drift.

Mechanical: the numeric rows of 8 golden files are replaced with the
"Baseline metrics in import file format" blocks loss_compare printed in
the ROCm models job of run 46727068719 (torch 2.17.0.dev20261201+rocm10.1,
torchao 0.19.0.dev20261119+rocm10.1). Headers and step counts are
unchanged.

Co-authored-by: Claude Fable 5.1 <[email protected]>
akashveramd pushed a commit to akashveramd/torchtitan that referenced this pull request Dec 1, 2026
…y 20261201 (#22)

With the ROCm CI index on rocm10.1 the models leg picks up a torch nightly
past 20261125 for the first time, and 8 mi350x goldens no longer match bit
for bit. Two upstream changes stack: pytorch/pytorch#204322 (Inductor
deterministic mode now compiles Triton with enable_fp_fusion=False; CUDA
absorbed this in pytorch#6398) and rocm10.0 -> rocm10.1 library drift.

Mechanical: the numeric rows of 8 golden files are replaced with the
"Baseline metrics in import file format" blocks loss_compare printed in
the ROCm models job of run 46727068719 (torch 2.17.0.dev20261201+rocm10.1,
torchao 0.19.0.dev20261119+rocm10.1). Headers and step counts are
unchanged.

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/real-pg Run the full 8-GPU Real PG integration suite CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants