Repository navigation
Conversation
|
Well coded. We need muon optimizer for sure. |
SunMarc
left a comment
There was a problem hiding this comment.
Thanks for the PR @kadirnar ! Definitely intestered in having this in transformers. Can we directly use muon library for this instead of re-coding them ? I saw that there were 4 classes that we might want to have : SingleDeviceMuon, Muon, MuonWithAuxAdam and SingleDeviceMuonWithAuxAdam. Right now in this PR, we deal with the case SingleDeviceMuon. Also, if you can add a couple of tests that we have for all optimizers, that would be great !
SunMarc
left a comment
There was a problem hiding this comment.
Thanks for iterating, left a couple of comments
|
@SunMarc Is there any obstacle to adding a Muon optimizer? |
|
@ArthurZucker Could you provide feedback on this PR? Are you planning to merge it? Is there any obstacle? |
|
Ooo exciting! 🔥 sorry did not see until now! |
|
Hello @kadirnar, was running the 4 tests and it seems to fail ! |
Could you check it again? |
|
The implementation in the original repo of Muon is not distributed friendly, can we do something about that? If the parameters of the linear layers are sharded this will either fail or produce incorrect results (been a while since I tried that). For an initial implementation it's fine IMO, though we should warn/raise correctly |
Actually, after this optimization, I also want to add the flash-muon and Dion repositories. How would Dion be? |
I don't think adding multiple repositories just for one optimizer (not familiar with flash-muon) is a good approach. I think we should make the optimizer work with distributed settings too. For Dion you'd be facing the same approach, as the low rank orthogonalization needs to be distributed aware as well. I propose either rolling our own implementation (that's distributed aware) or finding a repo that does it. Afaik there's a repo from microsoft research with both Muon and Dion which are DTensor compatible for starters, we'd need to hack something for our TP integration later. |
https://github.com/samsja/muon_fsdp_2 ? They've tested it with multi-GPU. Do you think this is suitable? |
|
@S1ro1 https://github.com/pytorch/pytorch/blob/main/torch/optim/_muon.py PyTorch support has been added. |
|
@kadirnar is there any update on this (using the pytorch Muon itself)? I would really like to use Muon to finetune my model. Is there any fork/branch I can use? |
I have the same question. Is there a great repo to reproduce Muon and use Muon to fine-tune a pre-trained model. |
|
Closing this since Muon is now available in PyTorch. |
#39537
cc @muellerzr @SunMarc