Add standalone distributed Muon optimizer - #4034
Draft
weifengpy wants to merge 1 commit into
Draft
Conversation
weifengpy
force-pushed
the
weifeng/distributed-muon-standalone
branch
7 times, most recently
from
July 31, 2026 18:49
b4023f7 to
bda57dd
Compare
weifengpy
force-pushed
the
weifeng/distributed-muon-standalone
branch
19 times, most recently
from
August 1, 2026 19:32
36e6530 to
f1276f2
Compare
weifengpy
force-pushed
the
weifeng/distributed-muon-standalone
branch
6 times, most recently
from
August 3, 2026 18:31
0a2d554 to
0e7805d
Compare
weifengpy
force-pushed
the
weifeng/distributed-muon-standalone
branch
4 times, most recently
from
August 3, 2026 21:30
19645aa to
3787193
Compare
weifengpy
force-pushed
the
weifeng/distributed-muon-standalone
branch
from
August 3, 2026 21:47
3787193 to
93f15a5
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.
Stack from ghstack (oldest at bottom):
Summary
DistributedMuonthat owns momentum and Newton-Schulz math without depending ontorch.optim.Muoncomponents/distributed_optimizers/with a generic bucketed redistribution runtime, Muon state/math, and parameter-view preparationBucketSpeccarries its exact 1DDeviceMesh, owner ranks are mesh-local, and each bucket may use a different participant setBucketConfig(mesh_axis=...)entries against named DTensor storage meshes after model parallelizationShardon either matrix dimension; Support TP-sharded matrices in DistributedMuon #4051 adds named 2DShard(0)/Shard(1)storageMuonComputeSharding(view_before_placement=..., placement=...); Muon supplies compute requirements and math but no process groups, storage blocks, or collectivesspmd_typesrecipe; projection matrices use Muon whilewo, embeddings,lm_head, and unsupported parameters remain in foreach AdamWThis is a standalone PR based on
main; it has no dependency on the earlier FlexShard/MuonAdapter stack or PyTorch Muon changes.Test plan
PYTHONPATH=/tmp/pytorch-optimizer-step-test:$PWD python -m pytest tests/unit_tests/test_bucketed_optimizer_redistribution.py tests/unit_tests/test_muon_parameter_prep.py tests/unit_tests/test_deepseek_v3_distributed_muon_config.py -q(13 passed,11 subtests passed)2 passedon two GPUs)Shard(1)parity/writeback test (1 passedon two GPUs)1 passedon four GPUs)spmd_types, local batch size 1, sequence length 128; loss12.05116, grad norm8.4805, memory24.14 GiBper GPU