-
Notifications
You must be signed in to change notification settings - Fork 88
add Muon Optimizer #1165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add Muon Optimizer #1165
Conversation
pls add the test script |
done |
@@ -0,0 +1,236 @@ | |||
"""Modified from https://github.com/MoonshotAI/Moonlight/blob/master/examples/toy_train.py""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add copyright statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add copyright statement
original script does not contain copyright statement
mindone/trainers/muon.py
Outdated
X = X / (mint.norm(X) + 1e-7) | ||
# Perform the NS iterations | ||
for _ in range(steps): | ||
A = X @ X.T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may try mint.matmul explicitly for better performance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated. Yes, change to mint get 15% speed boost
需配合 #1164 保障测试脚本收敛精度
What does this PR do?
Fixes # (issue)
Adds # (feature)
Before submitting
What's New
. Here are thedocumentation guidelines
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@xxx