Skip to content

[2/4] Hyperparameter Transfer: add canonical width-MuP recipe - #4998

Draft
plugyawn wants to merge 16 commits into
NVIDIA:mainfrom
plugyawn:feature/scaling-recipe-mup
Draft

[2/4] Hyperparameter Transfer: add canonical width-MuP recipe#4998
plugyawn wants to merge 16 commits into
NVIDIA:mainfrom
plugyawn:feature/scaling-recipe-mup

Conversation

@plugyawn

@plugyawn plugyawn commented May 26, 2026

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.
    (Not every line)

What does this PR do?

PR 2/4 of the scaling-recipes split requested in #4381. This builds on #4829.
References: [1/4]: #4829, [3/4]: #4999, [3/4]: #4999.
Design doc: PR_MuP.pdf

Intended delta for review:
plugyawn/Megatron-LM@feature/scaling-policy-infra...feature/scaling-recipe-mup

This PR adds the public canonical width-MuP recipe surface while preserving the legacy --use-mup
behavior from #3058.

This PR:

  • adds --scaling-recipe {none,mup};
  • adds canonical base fields such as --scaling-base-hidden-size and --scaling-base-head-dim;
  • keeps legacy MuP flags as compatibility aliases;
  • derives mup_width_mult from hidden_size / scaling_base_hidden_size;
  • syncs legacy MuP fields for checkpoint/script compatibility;
  • compares checkpoint compatibility by resolved scaling context rather than raw legacy fields;
  • documents the new user-facing scaling recipe interface.

Issue tracking

Related to #4381 and #4088. Builds on #4829.

Testing

  • Added unit coverage for CLI parsing, alias compatibility, YAML defaults, checkpoint comparison,
    and checkpoint arg reset.
  • python -m py_compile megatron/core/parameterization/spec.py megatron/core/parameterization/ model_policy.py megatron/core/parameterization/training_policy.py megatron/training/arguments.py megatron/training/checkpointing.py megatron/training/yaml_arguments.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:05
@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:05
@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 force-pushed the feature/scaling-recipe-mup branch from 93e2e7c to 2ff4849 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