Skip to content

Fix emerging optimizer init_group for ckpt loading - #3897

Merged
chtruong814 merged 1 commit into
NVIDIA:devfrom
FDecaYed:deyuf/eopt-init
Mar 17, 2026
Merged

Fix emerging optimizer init_group for ckpt loading#3897
chtruong814 merged 1 commit into
NVIDIA:devfrom
FDecaYed:deyuf/eopt-init

Conversation

@FDecaYed

Copy link
Copy Markdown
Contributor

What does this PR do ?

Recent Emerging-Optimizers changes added skip_non_grad_params to _init_group. Megatron checkpoint initialization needs to explicitly disable skipping so optimizer state is fully initialized when loading/restoring checkpoints.

  • Update emerging optimizer checkpoint-state initialization to call _init_group(..., skip_non_grad_params=False) so state is created for params that do not yet have grads during checkpoint restore.
  • Bump the emerging_optimizers dependency pin to bc634ff8c0cf4fb5dbae0a531081281b499be3a0 to pick up the new skip_non_grad_params option.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

Code review

Feel free to message or comment the @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.

For MRs into `dev` branch The proposed review process for `dev` branch is under active discussion.

MRs are mergable after one approval by either eharper@nvidia.com or zijiey@nvidia.com.

Signed-off-by: Deyu Fu <deyuf@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Mar 17, 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.

@FDecaYed

Copy link
Copy Markdown
Contributor Author

/ok to test 7496370

@FDecaYed
FDecaYed enabled auto-merge March 17, 2026 11:05

@skyw skyw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FDecaYed
FDecaYed added this pull request to the merge queue Mar 17, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/23204532924

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 17, 2026
@chtruong814
chtruong814 added this pull request to the merge queue Mar 17, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/23208145215

Merged via the queue into NVIDIA:dev with commit f47ad91 Mar 17, 2026
52 checks passed
skyw added a commit to skyw/Megatron-LM that referenced this pull request Apr 2, 2026
@skyw skyw mentioned this pull request Apr 2, 2026
5 tasks
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.

6 participants