Repository navigation
Fix Muse Glimmer final norm initialization - #4489
Conversation
|
Hi @yikw1022! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
@claude review this PR |
|
Claude finished @tianyu-l's task in 4m 46s —— View job Review: Fix Muse Glimmer final norm initialization
SummaryThe fix is correct and the root cause is real. I was able to independently confirm the bug from the checked-in golden numerics, which is nice corroboration. Root-cause confirmation. The final norm is a The debug vocab is 2048, and Fix correctness. Overriding Blocking issue: golden loss assets must be regeneratedPer
After this fix, step-1 logits are no longer zero, so the loss will no longer be Minor / non-blocking
VerdictCorrect, well-reasoned fix that preserves checkpoint compatibility. Please regenerate the two |
| # Final output norm is gain-centered on 0.0. | ||
| norm=_gain_norm(dim, _NORM_EPS, gain_center=0.0), | ||
| # Keep the checkpoint's zero gain center, but initialize to unit scale. | ||
| norm=dataclasses.replace( |
There was a problem hiding this comment.
see if you like this style or the style claude suggests
## Summary - automatically apply `ciflow/8gpu` when a PR changes files under `tests/assets/losses/` - refresh the stale Real-PG A10G goldens for DeepSeek V3, GPT-OSS, Muse Glimmer, and Qwen3 - normalize the generated parallelism header in the DeepSeek V3 CP+PP golden ## Why A Fake-PG golden update signals an expected numerics change, but the corresponding Real-PG numerics currently run only after merge unless the author manually adds `ciflow/8gpu`. Labeling any golden update automatically makes the author validate the full 8-GPU Real-PG suite before landing. The current Real-PG values became stale after #4484 changed MoE router numerics and #4489 changed Muse Glimmer initialization. ## Test plan - `pre-commit run --files .github/labeler.yml tests/assets/losses/real_pg/*.txt` - [8-GPU Real-PG golden export on current main](https://github.com/pytorch/torchtitan/actions/runs/34075482250): feature and model suites passed - compared all exported goldens byte-for-byte with the checked-in files - confirmed all 10 loss and grad-norm steps for the four changed numerical goldens against an independent scheduled Real-PG run ([run 34070052002](https://github.com/pytorch/torchtitan/actions/runs/34070052002))
The final output norm uses
gain_center=0.0and inherited zero weightinitialization from
_gain_norm, resulting in zero effective scale atinitialization. This zeros the final hidden states and logits, and produces
zero gradients for the decoder and lm_head on the first backward pass.
Initialize only the final norm weight to one while retaining
gain_center=0.0, so its initial effective scale is one. This keeps thecheckpoint parameterization unchanged and leaves the other gain-centered
norm initializations unchanged.
Validation:
git diff --checkpassed.gradients before the change, and nonzero outputs and gradients after it.