Skip to content

Integrate sharded Muon into MaxText. - #5193

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_979432212
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_979432212

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Integrate sharded Muon into MaxText.

  • Implements sharded_muon_utils.py to pair Muon dimension numbers paired with NamedSharding trees.
  • Adds flags for muon_type ('maxtext_muon' vs 'optax_muon') and muon_use_all_to_all.
  • Plumbs mesh through create_training_optimizer in train_utils.py, train_compile.py, and maxtext_engine.py. This is necessary to make sharded muon work.
  • Adds comprehensive unit test coverage.

Reverts 911bc61

- Implements sharded_muon_utils.py to pair Muon dimension numbers paired with NamedSharding trees.
- Adds flags for muon_type ('maxtext_muon' vs 'optax_muon') and muon_use_all_to_all.
- Plumbs mesh through create_training_optimizer in train_utils.py, train_compile.py, and maxtext_engine.py. This is necessary to make sharded muon work.
- Adds comprehensive unit test coverage.

Reverts 911bc61

PiperOrigin-RevId: 979432212
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/optimizers/optimizers.py 66.66% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant