added muon optimizer component#449
Open
BlueCrescent wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for a new Muon optimizer component to the Modalities component/registry system, including configuration wiring and unit tests to ensure the optimizer factory constructs the optimizer using the expected parameter groups.
Changes:
- Added
OptimizerFactory.get_muon(...)that builds a Muon optimizer fromget_optimizer_groups(...). - Introduced
MuonOptimizerConfigand registered the"optimizer" / "muon"component variant. - Added unit tests verifying optimizer factory methods construct Adam/AdamW/Muon using computed optimizer groups.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_optimizer_factory.py |
Adds unit tests for Adam/AdamW/Muon factory construction and checkpointed optimizer loading behavior. |
src/modalities/registry/components.py |
Registers the new "muon" optimizer component variant and wires it to MuonOptimizerConfig. |
src/modalities/optimizers/optimizer_factory.py |
Adds get_muon factory method and imports Muon from torch.optim. |
src/modalities/config/config.py |
Adds MuonOptimizerConfig to represent Muon optimizer configuration in the component system. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What does this PR do?
This PR adds muon optimizer component
General Changes
Checklist before submitting final PR
python tests/tests.py)CHANGELOG_DEV.md)