Skip to content

[4/4] Hyperparameter Transfer across Muon and preconditioned optimizers. - #5000

Draft
plugyawn wants to merge 25 commits into
NVIDIA:mainfrom
plugyawn:feature/muon-spectral-mup
Draft

[4/4] Hyperparameter Transfer across Muon and preconditioned optimizers.#5000
plugyawn wants to merge 25 commits into
NVIDIA:mainfrom
plugyawn:feature/muon-spectral-mup

Conversation

@plugyawn

@plugyawn plugyawn commented May 26, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

PR 4/4 of the scaling-recipes split requested in #4381. This builds on the scaling-policy, width-
MuP, and depth-MuP PRs, as started in #4829.
Design doc: PR_MuP.pdf

References: [1/4]: #4829, [2/4]: #4998, [3/4]: #4999.

Intended delta for review:
plugyawn/Megatron-LM@feature/depth-mup...feature/muon-spectral-mup

Builds on #4999.
Currently only handles Muon, but the routing is expressed through emerging-optimizers and parameter-role policy hooks, so the same pattern should extend to other matrix-preconditioned or optimizer-specific parameterizations in future PRs. @mkhona-nvidia could comment better.

TL;DR: this PR adds the Muon scalar-optimizer interaction needed for the scaling-recipes stack. It is the
follow-up to the Muon/MuP behavior discussed in #3715.

This PR:

  • lets Muon-family optimizers route nonlinear, embedding, bias, and norm parameters through a
    configured scalar optimizer;
  • adds muon_scalar_optimizer validation for CLI/YAML paths;
  • supports adam and lion as scalar optimizers;
  • keeps Muon-managed matrix parameters on the Muon path so they are not accidentally given Adam-
    style MuP matrix overrides;
  • preserves the warning around spectral Muon scaling when used with MuP-style transfer.

This does not change the core orthogonalized matrix update itself; it only makes the scalar-
parameter side explicit and configurable.

Issue tracking

Related to #4381 and #3715.

Testing

  • Added unit coverage for muon_scalar_optimizer validation.
  • Added routing tests for Muon nonlinear/scalar parameter groups.
  • Added Lion beta/default handling coverage.
  • python -m py_compile megatron/core/optimizer/emerging_optimizers.py megatron/core/optimizer/ __init__.py megatron/training/arguments.py megatron/training/yaml_arguments.py tests/unit_tests/ test_lion_optimizer.py tests/unit_tests/transformer/test_mup.py
  • Local pytest collection is currently blocked in my environment by Python 3.12 / Torch Dynamo
    compatibility.

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code
  • I have added relevant documentation
  • I have run tools/autoformat.sh

Code review

Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!

All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.

Step 1: Mark PR as "Ready for Review"

  1. When your PR is ready, click Ready for Review.
  2. An oncall reviewer is auto-assigned and expert reviewers are notified based on your changes.
    • Some PRs may jump straight to step 2. This is determined by .github/CODEOWNERS.

⚠️ Only mark as ready once merge-conflicts are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

Step 2: Final Review

For PRs that change megatron/core, once all expert reviewers have approved, the Final Review label is applied automatically and final reviewers are assigned.

For PRs outside megatron/core, this step is skipped.

Step 3: Approved

Once all required reviewers have approved, the Approved label is applied automatically.

Merge

Any member of mcore-engineers will be able to merge your PR.

@plugyawn
plugyawn requested review from a team as code owners May 26, 2026 21:08
@copy-pr-bot

copy-pr-bot Bot commented May 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci
svcnvidia-nemo-ci marked this pull request as draft May 26, 2026 21:08
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically converted to draft because all PRs must start as drafts.

When you are ready for review, click Ready for Review to begin the review process. This will:

  1. Add the oncall reviewer (optional reviewer)
  2. Add required review teams based on your changes

See the contribution guide for more details.

@plugyawn plugyawn changed the title Feature/muon spectral mup [4/4] Hyperparameter Transfer across Muon Optimizer May 26, 2026
@plugyawn plugyawn changed the title [4/4] Hyperparameter Transfer across Muon Optimizer [4/4] Hyperparameter Transfer across Muon and preconditioned optimizers. May 26, 2026
@plugyawn
plugyawn force-pushed the feature/muon-spectral-mup branch from 05d2aec to 85e2e92 Compare May 27, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants