Megatron-LM icon indicating copy to clipboard operation
Megatron-LM copied to clipboard

Enhance optimizer state loading with runtime overrides

Open yhgalaxy opened this issue 8 months ago • 5 comments

Added logic to override optimizer parameter scheduler settings based on runtime arguments when option --override-opt-param-scheduler on. This includes restoring max_lr and min_lr values and synchronizing scheduler num_steps with consumed_train_samples.

What does this PR do ?

:warning: For major changes (either in lines of code or in its impact), please make sure to first share a design doc with the team. If you're unsure what's the best way to do so, contact the @mcore-oncall.

Contribution process

flowchart LR
    A[Pre-checks] --> B[PR Tests]
    subgraph Code Review/Approval
        C1[Expert Review] --> C2[Final Review]
    end
    B --> C1
    C2 --> D[Merge]

Pre-checks

  • [ ] I want this PR in a versioned release and have added the appropriate Milestone (e.g., Core 0.8)
  • [ ] 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

The following process is enforced via the CODEOWNERS file for changes into megatron/core. For changes outside of megatron/core, it is up to the PR author whether or not to tag the Final Reviewer team.

For MRs into `main` branch

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!

(Step 1): Add PR label Expert Review

(Step 2): Collect the expert reviewers reviews

  1. Attach the Expert Review label when your PR is ready for review.
  2. GitHub auto-assigns expert reviewers based on your changes. They will get notified and pick up your PR soon.

:warning: Only proceed to the next step once all reviewers have approved, merge-conflict are resolved and the CI is passing.
Final Review might get declined if these requirements are not fulfilled.

(Step 3): Final Review

  1. Add Final Review label
  2. GitHub auto-assigns final reviewers based on your changes. They will get notified and pick up your PR soon.

(Optional Step 4): Cherry-pick into release branch

If this PR also needs to be merged into core_r* release branches, after this PR has been merged, select Cherry-pick to open a new PR into the release branch.

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

MRs are mergable after one approval by either [email protected] or [email protected].

Merging your PR

Any member of core-adlr and core-nemo will be able to merge your PR.

yhgalaxy avatar Mar 05 '26 14:03 yhgalaxy

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.

copy-pr-bot[bot] avatar Mar 05 '26 14:03 copy-pr-bot[bot]

We are changing our review process and marking all open, unlabeled PRs as draft. This change will go in effect starting once https://github.com/NVIDIA/Megatron-LM/pull/3659 is merged.

Moving forward, all PRs will be required to start as draft PRs. If you wish to get your PR merged, mark your PR as “Ready for review”. Read more about the new process at submit.md.

Phlip79 avatar Mar 05 '26 18:03 Phlip79

@yhgalaxy Requesting to add unit-tests

gautham-kollu avatar Apr 07 '26 23:04 gautham-kollu

What should I do?

yhgalaxy avatar Apr 17 '26 09:04 yhgalaxy

/ok to test a3321584dfbbf6b9dbe66db254bdc748a0b91152

maanug-nv avatar Jun 11 '26 01:06 maanug-nv

@yhgalaxy can you run git rebase HEAD~7 --signoff

maanug-nv avatar Jun 16 '26 17:06 maanug-nv

@yhgalaxy can you run git rebase HEAD~7 --signoff

OK,DCO is fixed. Thank you.

yhgalaxy avatar Jun 17 '26 12:06 yhgalaxy