Skip to content

[kimi] Update and Make Kimi K3 B200 numerics reproducible - #5143

Merged
shuhuayu merged 1 commit into
pytorch:mainfrom
shuhuayu:k3-parity
Oct 9, 2026
Merged

shuhuayu merged 1 commit into
pytorch:mainfrom
shuhuayu:k3-parity

Conversation

@shuhuayu

@shuhuayu shuhuayu commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Disable Attention Gym KDA autotuning when PyTorch deterministic algorithms are enabled; ordinary training still autotunes.
  • Refresh the Kimi K3 10-step B200 loss and gradient-norm golden after the attention-residual initialization change in [Kimi K3] Zero-initialize the attention residual projections #4881.
  • Keep the existing kimi_k3_debugmodel_mm_muon recipe and FSDP2/EP2 topology unchanged.

Why

The old golden predates #4881, which intentionally changed Kimi K3 attention-residual projections from truncated-normal to zero initialization.

While re-exporting it, two otherwise identical deterministic B200 runs diverged after step 1. A back-to-back diagnostic on the same runner reproduced both traces: Attention Gym's KDA autotuner can select numerically different valid schedules based on benchmark/cache state. Deterministic mode now skips that benchmark-dependent choice and uses the default schedule, matching TorchTitan's existing handling for other autotuned attention kernels.

Numerical source

Both sequential exports were byte-for-byte identical.

Validation

@shuhuayu shuhuayu added the ciflow/b200 Trigger B200 CI label Oct 8, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 8, 2026
@pytorch-bot pytorch-bot Bot added the ciflow/rl label Oct 8, 2026
@shuhuayu
shuhuayu force-pushed the k3-parity branch 2 times, most recently from 923b29b to 6254905 Compare October 8, 2026 09:34
@shuhuayu shuhuayu changed the title Refresh Kimi K3 B200 numerics Make Kimi K3 B200 numerics reproducible Oct 8, 2026
@shuhuayu shuhuayu changed the title Make Kimi K3 B200 numerics reproducible [kimi] Update and Make Kimi K3 B200 numerics reproducible Oct 8, 2026
@shuhuayu
shuhuayu marked this pull request as ready for review October 9, 2026 00:35
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 9, 2026
@shuhuayu

shuhuayu commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

the numerical parity test passed, the remaining failure related to kimi is from spmd type check, will fix it in a separate pr.

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 ciflow/rl 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