Skip to content

Improve testing for Muon and the sharded Muon variant. - #5029

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

Improve testing for Muon and the sharded Muon variant.#5029
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_972054201

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Improve testing for Muon and the sharded Muon variant.

  • Renames and generalizes MuonDimensionNumbers to ShardedMuonDimensionNumbers with optional NamedSharding specification (and preserves backward-compatible alias).
  • Fixes Newton-Schulz coefficient length check in muon.py to raise ValueError when fewer coefficients than steps are provided, and slices trailing coefficients when extra coefficients are provided.
  • Moves muon_test.py and muon_sharding_test.py from src/maxtext/optimizers/ to tests/unit/ to conform to MaxText open-source directory conventions.
  • Adds test cases in muon_test.py for coefficient schedule slicing and insufficient coefficient error handling, and configures muon_sharding_test.py with an isolated subprocess test runner.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/optimizers/muon.py 80.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

- Renames and generalizes MuonDimensionNumbers to ShardedMuonDimensionNumbers with optional NamedSharding specification (and preserves backward-compatible alias).
- Fixes Newton-Schulz coefficient length check in muon.py to raise ValueError when fewer coefficients than steps are provided, and slices trailing coefficients when extra coefficients are provided.
- Moves muon_test.py and muon_sharding_test.py from src/maxtext/optimizers/ to tests/unit/ to conform to MaxText open-source directory conventions.
- Adds test cases in muon_test.py for coefficient schedule slicing and insufficient coefficient error handling, and configures muon_sharding_test.py with an isolated subprocess test runner.

PiperOrigin-RevId: 972054201
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