feat: add Muon optimizer support#78122
Open
xxyux wants to merge 1 commit intoPaddlePaddle:developfrom
Open
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (20.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #78122 +/- ##
==========================================
Coverage ? 20.00%
==========================================
Files ? 1
Lines ? 35
Branches ? 0
==========================================
Hits ? 7
Misses ? 28
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
65f5619 to
1e75080
Compare
Contributor
Author
|
/re-run all-failed |
1 similar comment
Contributor
Author
|
/re-run all-failed |
50097f4 to
e9dfa92
Compare
…ding MP parallel support - Add Muon optimizer (python/paddle/optimizer/muon.py) with Newton-Schulz orthogonalisation and per-head QKV split support - Add _create_accumulators for checkpoint-resume compatibility under AMP O2 - Add muon_comm_utils for distributed Muon gradient communication - Update DygraphShardingOptimizer to support Muon optimizer integration - Add sharding MP parallel test with both standard and qkv_split models - Update CMakeLists.txt with test_parallel_dygraph_sharding_mp_parallel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e9dfa92 to
7eb8579
Compare
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.
PR Category
Execute Infrastructure
PR Types
New features
Description
Summary
This PR introduces the Muon optimizer and wires it into PaddleFleet's DygraphShardingOptimizerV2 pipeline.
Muon applies orthogonal gradient updates (via Newton-Schulz iteration) to 2-D weight matrices, and falls back to standard AdamW for embeddings, biases, and other non-matrix parameters. It is designed for large-scale distributed training with Sharding Stage1 V2 parameter sharding and Tensor Parallelism.
Key changes
paddle/optimizer/muon.py(new)paddle/distributed/fleet/utils/muon_comm_utils.py(new)DygraphShardingOptimizerV2.step()Tests
hybrid_parallel_sharding_mp_model.py+test_hybrid_parallel_sharding_mp_logic: end-to-end accuracy test that runs a 4-GPU sharding=2 × mp=2 job, compares Muon-updated MP model parameters against a single-process reference, and verifies correctness through the full annotation → gather → orthogonalise → scatter pipeline.是否引起精度变化
否