Skip to content

[CI Fix][B200] Refresh Kimi K3 DistMuon golden - #5559

Merged
acisseJZhong merged 1 commit into
mainfrom
codex/refresh-kimi-k3-b200-wgrad-golden
Oct 20, 2026
Merged

acisseJZhong merged 1 commit into
mainfrom
codex/refresh-kimi-k3-b200-wgrad-golden

Conversation

@acisseJZhong

Copy link
Copy Markdown
Contributor

Summary

  • Refresh the Kimi K3 multimodal per-head DistMuon B200 golden.
  • Preserve the strict equality comparison and ten-step coverage.

Fixes #5449.

Root cause

#5399 intentionally changed the first accumulated weight gradient from a BF16 GEMM result later upcast to FP32 into a GEMM that produces FP32 directly. Kimi uses eight chunked LM-head losses even when outer gradient accumulation is one, so this changes the first WGRAD and the seven following in-place FP32 accumulations. The next optimizer update consequently changes losses from step 2 onward.

#5399 refreshed affected A10G goldens and #5423 refreshed MI350X goldens, but the Kimi B200 golden was omitted. The observed B200 sequence is bitwise identical across independent runs and later PyTorch nightlies:

Step 1 loss and grad norm remain unchanged, matching the expected first-update boundary.

Test plan

  • SKIP=pyrefly-check pre-commit run --all-files (pass)
  • Validate the strict ten-step comparison through ciflow/b200.

Local Pyrefly is unavailable because the shared venv uses PyTorch 2.14 and older optional APIs than current main.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 20, 2026
@acisseJZhong acisseJZhong added the ciflow/b200 Trigger B200 CI label Oct 20, 2026
@acisseJZhong
acisseJZhong marked this pull request as ready for review October 20, 2026 05:39
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 20, 2026
@acisseJZhong

Copy link
Copy Markdown
Contributor Author

The GraphTrainer B200 failure on this PR is the independent SimpleFSDP parameter-inspection issue fixed in #5560. That fix now passes the full GraphTrainer B200 workflow: https://github.com/pytorch/torchtitan/actions/runs/39375868492

The relevant validation for this golden-only PR is the regular B200 workflow: https://github.com/pytorch/torchtitan/actions/runs/39374678479

@acisseJZhong

Copy link
Copy Markdown
Contributor Author

acisseJZhong added a commit that referenced this pull request Oct 20, 2026
…pection (#5560)

## Summary

- Inspect parameter shard placements with SimpleFSDP parametrizations
disabled.
- Add a regression test for reapplying data parallel to an already
parametrized quantized weight.

## Root cause

The GraphTrainer B200 job fails in
`graph_trainer_dist_moe_mxfp8_fsdp_ep_pp` while applying pipeline-stage
parallelism:
https://github.com/pytorch/torchtitan/actions/runs/39351458272/job/118396337526

`data_parallel()` computes `linear_param_shard_placements(model)` before
its module loop skips modules that already have SimpleFSDP. On a
reused/shared module that GraphPP has already parametrized, reading
`child.weight` during that inspection invokes `ReplicateComputation` and
tries to build the MXFP8 compute operands.

This happens during model construction, while the model is still on the
`meta` device and before `to_empty(device=...)`. Dist-MoE checks both
`weight.is_cuda` and `weight.is_contiguous()` but reports either failure
as `ValueError: weight must be contiguous CUDA storage`. Here the failed
condition is `weight.is_cuda == False`, not contiguity.

### Regression provenance

#4867 introduced the unconditional
`linear_param_shard_placements(model)` scan that reads parametrized
`child.weight`. #4949 later allowed callers to supply
placements explicitly, but retained that scan on the default path.

The workflow installs `dist_moe@main` rather than a pinned revision. The
last passing run on October 15 installed `dist_moe@6f0c3d4216`:

https://github.com/pytorch/torchtitan/actions/runs/38663506034

The first failing run on October 16 installed `dist_moe@e3d21b8d2a`:

https://github.com/pytorch/torchtitan/actions/runs/38832949153

Between those revisions, meta-pytorch/dist_moe@fa32967a85 added the
valid CUDA/contiguous input contract and exposed the latent GraphTrainer
bug. That commit has no associated public GitHub PR.

The Dist-MoE check should not be weakened and the dependency should not
be pinned back: parameter-layout inspection should never execute the
parameter's compute representation in the first place.

### Fix

Use GraphTrainer's existing `disable_active_parametrization()` context
while inspecting shard placements. Inspection now sees the raw sharded
parameter instead of materializing its compute representation; actual
forward parametrization is unchanged.

An initial attempt to call `.contiguous()` at the Dist-MoE boundary
failed with the same error, confirming that the meta device, not storage
stride, was the violated contract:


https://github.com/pytorch/torchtitan/actions/runs/39374680382/job/118470042165

## Test plan

- `pytest -q
torchtitan/experiments/graph_trainer/tests/test_simple_fsdp.py -k
reapplying_data_parallel -vv` (pass)
- `SKIP=pyrefly-check pre-commit run --all-files` (pass)
- Full GraphTrainer B200 workflow (pass):
https://github.com/pytorch/torchtitan/actions/runs/39375868492

The shared local environment has an older PyTorch/Pyrefly API set than
current main, so the Pyrefly hook is left to CI.

The regular B200 failure on this PR is the independent Kimi K3 golden
drift fixed in #5559. Its reported values exactly match #5559's updated
golden, and that PR passes the regular B200 workflow:
https://github.com/pytorch/torchtitan/actions/runs/39374678479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/b200 Trigger B200 CI ciflow/fake-pg Run 1-GPU Fake PG integration tests 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.

[CI] B200 Kimi/Muon golden mismatch: investigate chunked LM-head precision change (#5399)

2 participants