-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add Muon Optimizer to contrib
#1126
base: main
Are you sure you want to change the base?
Conversation
338357f
to
a45f7a0
Compare
contrib
Hi all! How do I restrict the tests to exclude vectors as weights? |
Hello @leloykun, Looks like an interesting contribution thank you!
I don't fully understand your question. Could you give more context? Other questions/remarks: How does this optimizer treat vector-shaped values? The"muon_iterator" could run on vectors but not return what you want, so how do you make the distinction? Should it take a mask to only apply on matrices? Should it raise value error? Also could you add the mathematical description in the doc string? That would greatly help. Finally, put references at the end of the docstring (we'll adopt this format with #1129) Thank you! |
Hi @vroulet, Muon is only defined for matrix-shaped values. I'm thinking of raising an error when the input is vector-shaped, but where's the best place to put it? If there are other optimizers here that does this, can you point me to them? |
Hello @leloykun
Thanks again and sorry for the delay! |
Adds support for @KellerJordan Muon optimizer detailed here: https://github.com/KellerJordan/modded-nanogpt
The Muon optimizer does steepest descent under approximately Spectral norm--or more accurately, under Schatten-p norm for some large p (with Schatten-infty norm = Spectral norm).