Skip to content

Add Lion optimizer support - #3813

Merged
mchrzanowski merged 9 commits into
NVIDIA:mainfrom
mchrzanowski:add-lion-optimizer-v2
Mar 18, 2026
Merged

mchrzanowski merged 9 commits into
NVIDIA:mainfrom
mchrzanowski:add-lion-optimizer-v2

Conversation

@mchrzanowski

Copy link
Copy Markdown
Contributor

Import Lion optimizer from emerging_optimizers and integrate it as a standalone optimizer (--optimizer lion) and as a Muon nonlinear parameter optimizer (--muon-nonlinear-optimizer lion).

@mchrzanowski
mchrzanowski requested review from a team as code owners March 11, 2026 22:49
@copy-pr-bot

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

@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.

@svcnvidia-nemo-ci
svcnvidia-nemo-ci marked this pull request as draft March 11, 2026 22:49
@mchrzanowski
mchrzanowski force-pushed the add-lion-optimizer-v2 branch from 457ce16 to c4a57c3 Compare March 12, 2026 03:19
@mchrzanowski
mchrzanowski marked this pull request as ready for review March 12, 2026 03:20
@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team March 12, 2026 03:20
@mchrzanowski
mchrzanowski requested review from mkhona-nvidia and removed request for a team March 12, 2026 03:20
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the Final Review PR is in the "final review" stage label Mar 12, 2026
Comment thread megatron/core/optimizer/muon.py Resolved
Comment thread megatron/training/arguments.py Outdated
@@ -2171,6 +1855,16 @@ def _add_regularization_args(parser):
help='How to perform NS calculation for tensor model parallel weights')
group.add_argument('--muon-extra-scale-factor', type=float, default=1.0,
help='Additional scale factor for the muon update')
group.add_argument('--muon-nonlinear-optimizer', type=str, default='adam',

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.

We need to make sure to ping downstream stuff (Mbridge etc)'s Muon recipe to additionally add --muon-non-linear-optimizer as an extra entry.

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.

@janEbert , maybe you could add this to mbridge?

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.

Sounds good!

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the Final Review PR is in the "final review" stage label Mar 13, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the Final Review PR is in the "final review" stage label Mar 13, 2026
Comment thread megatron/core/optimizer/muon.py Resolved
@mchrzanowski
mchrzanowski force-pushed the add-lion-optimizer-v2 branch from 6dd614b to 0fb94af Compare March 13, 2026 17:02
@mchrzanowski
mchrzanowski requested a review from deepakn94 March 13, 2026 17:13
Comment thread megatron/core/optimizer/muon.py Resolved
@ericharper
ericharper requested a review from janEbert March 16, 2026 21:06
@svcnvidia-nemo-ci svcnvidia-nemo-ci added Approved All necessary approvals have been made and removed Final Review PR is in the "final review" stage labels Mar 16, 2026
@mchrzanowski

Copy link
Copy Markdown
Contributor Author

/ok ebdbe2c

@mchrzanowski

Copy link
Copy Markdown
Contributor Author

/ok to test f212469f212469

@mchrzanowski

Copy link
Copy Markdown
Contributor Author

/ok to test f212469

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mchrzanowski

Copy link
Copy Markdown
Contributor Author

/ok to test 207c465

@mchrzanowski

Copy link
Copy Markdown
Contributor Author

/ok to test e911d8a

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the Approved All necessary approvals have been made label Mar 17, 2026
@mchrzanowski
mchrzanowski 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/23215212706

@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/23215938659

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 17, 2026
@mchrzanowski
mchrzanowski 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/23219203590

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 17, 2026
@mchrzanowski
mchrzanowski added this pull request to the merge queue Mar 18, 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/23227234166

Merged via the queue into NVIDIA:main with commit 83498ef Mar 18, 2026
84 of 88 checks passed
@mchrzanowski
mchrzanowski deleted the add-lion-optimizer-v2 branch March 18, 2026 03:46
ilml added a commit to ilml/Megatron-LM that referenced this pull request Mar 20, 2026
New files:
  - tests/unit_tests/test_lion_optimizer.py
yangbofun pushed a commit to xlm-research/Megatron-LM that referenced this pull request May 22, 2026
Signed-off-by: Mike Chrzanowski <mchrzanowski@nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: root <root@pool0-0020.cm.cluster>
Co-authored-by: root <root@pool0-0038.cm.cluster>
Co-authored-by: root <root@pool0-0022.cm.cluster>
yhgalaxy pushed a commit to yhgalaxy/Megatron-LM that referenced this pull request Jun 17, 2026
Signed-off-by: Mike Chrzanowski <mchrzanowski@nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: root <root@pool0-0020.cm.cluster>
Co-authored-by: root <root@pool0-0038.cm.cluster>
Co-authored-by: root <root@pool0-0022.cm.cluster>
Signed-off-by: yhgalaxy <yhgalaxy@outlook.com>
jon-barker pushed a commit to jon-barker/Megatron-LM that referenced this pull request Jul 10, 2026
Signed-off-by: Mike Chrzanowski <mchrzanowski@nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: root <root@pool0-0020.cm.cluster>
Co-authored-by: root <root@pool0-0038.cm.cluster>
Co-authored-by: root <root@pool0-0022.cm.cluster>
Signed-off-by: Jon Barker <jbarker@aws-cmh-slurm-1-vscode-02.cm.cluster>
terminator123 pushed a commit to 021ai/Megatron-LM that referenced this pull request Aug 3, 2026
Signed-off-by: Mike Chrzanowski <mchrzanowski@nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: root <root@pool0-0020.cm.cluster>
Co-authored-by: root <root@pool0-0038.cm.cluster>
Co-authored-by: root <root@pool0-0022.cm.cluster>

This branch was previously deployed

1 inactive deployment
test — e911d8ae Deployed Mar 17, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #9984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved All necessary approvals have been made complexity: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants