Repository navigation
[ci] Refresh A10G golden losses for torch nightly 20261125's Inductor deterministic mode - #6398
Conversation
… 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).
|
@claude review |
There was a problem hiding this comment.
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
- Description: "Summary (human-written)" is empty. Please fill it in before merging.
- 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 runsTEST_SCOPE=real_pg_required(.github/workflows/integration_test.yaml:154). That scope only keeps tests withuse_real_pg=True(tests/integration_tests/run_tests.py:404-408), so it checksllama3_pp,deepseek_v3_cp_ppandgpt_oss_pp.real_pg/a10g/{llama3,deepseek_v3,qwen3,muse_glimmer}.txtare only exercised by the full suite on main. The values do match four main runs, so the risk is low. Either pushciflow/real-pgso 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 intorchtitan/models/muse_glimmer/. It usesattn_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) andtests/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.
|
Merging because remaining failure is on GPT-OSS which will be fixed by #6400. |
## 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.
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.
…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]>
…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]>
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. Torchdev20261124passed (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.deterministicmode, Inductor now compiles its generated Triton kernels withenable_fp_fusion=False, so the result no longer depends on which block size ornum_warpsautotuning picks. The golden runs setdebug.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):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._inductor/_dynamo/fx/...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.
fake_pg/a10g/llama3.txtllama3_fsdp+tp+cp,+region_acfake_pg/a10g/deepseek_v3.txtdeepseek_v3_fsdp+epfake_pg/a10g/qwen3.txtqwen3_moe_fsdp+tp+cp+ep_param_groupsfake_pg/a10g/muse_glimmer.txtmuse_glimmer_text_fsdpreal_pg/a10g/llama3.txtllama3_fsdp+tp+cp,+region_acreal_pg/a10g/llama3_pp.txtllama3_fsdp+tp+ppreal_pg/a10g/deepseek_v3.txtdeepseek_v3_fsdp+epreal_pg/a10g/deepseek_v3_cp_pp.txtdeepseek_v3_fsdp+cp+pp+epreal_pg/a10g/gpt_oss_pp.txtgpt_oss_pp+fsdp+cp+ep+sacopreal_pg/a10g/qwen3.txtqwen3_moe_fsdp+tp+cp+ep_param_groupsreal_pg/a10g/muse_glimmer.txtmuse_glimmer_text_fsdpOver 10 steps, last-bit differences grow more in some runs than others (
real_pgmuse_glimmer8.0e-3,gpt_oss_pp1.7e-3,fake_pgqwen35.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.txtare unchanged and still pass.gpt_oss_fsdp+tp+ep(gpt_oss.txt), andgpt_oss_pp+fsdp+ep+sacopin Real PG, crash underdev20261125for 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_compareprinted in the A10G CI logs underdev20261125. A10G numerics can't be reproduced off that hardware, so they come straight from CI. The values agree across runs:Testing
ciflow/fake-pgchecks the 4 fake-PG files.ciflow/real-pgis added so the full Real PG suite checks all 7 real-PG files. Thereal_pg_requiredsubset only coversllama3_pp,deepseek_v3_cp_ppandgpt_oss_pp.python -m tests.integration_tests.run_tests --execution_mode fake_pg --ngpu 1 --test_name deepseek_v3_fsdp+epon GB300, with each torch/cuDNN combination as aPYTHONPATHoverlay.pre-commit runon 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 torchdev20261119, 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) andrl_grpo_cuda.txt(RL loss guard) are unaffected for now. Those jobs end up on pinned older torch (dev20261102anddev20261107in today's runs). Expect the same drift when their torch pins move pastdev20261125.