Conversation
Totoro97
approved these changes
Aug 18, 2025
Contributor
Totoro97
left a comment
There was a problem hiding this comment.
Excited to see such a performance boost using Muon!! 🚀 🚀 🚀 🚀 (Leave some minor comments)
| # AdamW Optimizer Settings | ||
| max_lr: 0.0001 # Maximum learning rate for AdamW optimizer | ||
| min_lr: 0.00001 # Minimum learning rate for cosine decay schedule | ||
| adam_max_lr: 0.0001 # Maximum learning rate for AdamW optimizer |
Contributor
There was a problem hiding this comment.
adam_max_lr-> adamw_max_lr?
| # Optimizer Settings | ||
| adam_max_lr: 0.0003 # Maximum learning rate for AdamW optimizer | ||
| adam_betas: [ 0.9, 0.95 ] # Beta coefficients for AdamW momentum terms [beta1, beta2] | ||
| use_muon: true |
Comment on lines
+21
to
+22
| matched_param_names: list[str] | ||
| matched_params: list[nn.Parameter] |
Contributor
There was a problem hiding this comment.
Is it better to directly define a dictionary of parameters, such as matched_params_dict: Dict[str, nn.Parameter]?
Properly handle grad scale in the case of gradient accumulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original Muon write-up
Muon has been shown to be scalable for LLM training. We support this optimizer in the DiT training context under FSDP2 implementation. The Muon implementation is borrowed from the dion repo with some modifications to force bfloat16 dtype in NewtonSchulz5 iterations.
Early signals seem very positive by training the FLUX tiny model on imagenet, where Muon leads to more rapid drop in validation loss than Adam.
