[Feature] Per-Head Muon: per-head Newton-Schulz orthogonalization for attention projections
Maintainers usually reply within 3 days
@0z5a is already working on this.
Since Sep 18, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
Research direction
Start by reading deepspeed/runtime/zero/muon/original_muon.py and muon_optimizer.py to understand muon_update and its Newton–Schulz paths, then inspect the ZeRO call site in deepspeed/runtime/zero/stage_1_and_2.py. Trace how existing use_muon metadata and AutoTP attention structure are propagated. Done means an opt-in per-head mode works through ZeRO and is covered by synthetic orthogonalization and small-model convergence tests.
Written by the indexing model from the issue text.
Description
Motivation
DeepSpeed now supports the Muon optimizer across ZeRO stages 1/2/3. In 2026, two frontier labs independently converged on the same refinement for attention projections: orthogonalizing per attention head rather than over the full projection matrix.
- Kimi K3 (arXiv:2607.24653, §2.5, "Per-Head Muon"): partitions the momentum of Q/K/V projections along the head dimension and orthogonalizes each head's block separately. Their motivation: full-matrix orthogonalization treats all heads as a single coupled block, so heads with larger gradient/momentum scales dominate the shared update direction while smaller-scale heads receive insufficiently normalized updates. Per-head orthogonalization equalizes update scale across heads, improves stability at larger scales, and is cheaper (Newton–Schulz on tall per-head blocks costs less than on the full projection).
- Zhipu GLM-5 "Muon Split" (arXiv:2602.15763): the same idea applied to MLA up-projection matrices (split by attention head, orthogonalize each head independently), closing the performance gap between MLA and GQA under Muon.
Today in DeepSpeed, muon_update() (deepspeed/runtime/zero/muon/original_muon.py) applies Newton–Schulz to the full 2D parameter matrix — i.e., the "coupled block" behavior both papers describe.
Proposal
- Optimizer kernel: add a per-head mode to
muon_update— reshape the update/momentum to[..., num_heads, head_dim]and run the existing bmm-based Newton–Schulz on the batched per-head blocks (the NS implementations already support batched inputs, so this is mostly a view/reshape branch). Apply the existingmax(1, m/n)**0.5scaling per head block. - Parameter metadata pipeline: tag attention projection parameters with head structure (
num_heads,head_dim, fused-vs-split QKV layout), similar to the existinguse_muontagging. The AutoTP model scan / presets already identify attention head structure, so this metadata can be sourced from there. - ZeRO integration: the engine call site (post-unflatten, per-parameter
muon_update) stays unchanged — just pass the head shape so the update can be viewed per-head and reshaped back before being applied to the flat buffer. - Config surface: opt-in switch, e.g.
optimizer.params.per_head_muon: true(or per param-group), following the precedent of separatemuon_lr/adam_lr. - Tests: unit tests for per-head vs full-matrix orthogonalization equivalence on synthetic attention-shaped params, plus convergence sanity on a small model.
References
- Kimi K3 technical report §2.5: https://arxiv.org/abs/2607.24653
- Muon Split (GLM): https://arxiv.org/abs/2602.15763
- Current Muon implementation:
deepspeed/runtime/zero/muon/original_muon.py,deepspeed/runtime/zero/muon/muon_optimizer.py, ZeRO call site indeepspeed/runtime/zero/stage_1_and_2.py
Happy to help implement this.
- Dominant language
- Python
- Stars
- 43.3k
- Forks
- 5.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 66
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepspeedai/DeepSpeed
-
[BUG] Universal checkpoint resume puts CPU `step` into fused/capturable optimizer statePossibly taken @ArjunPakhan claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
deepspeedai/DeepSpeed#8884 · 1 comment ·
Maintainers usually reply within 3 days
-
init_inference rejects dtype=torch.int8 on every acceleratorMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepspeedai/DeepSpeed#8577 ·
Maintainers usually reply within 3 days
-
[BUG] AutoTP checkpoint load raises AttributeError on a model containing nn.InstanceNorm1dPossibly taken @vineethsaivs claimed this 42 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
deepspeedai/DeepSpeed#8514 ·
Maintainers usually reply within 3 days
-
[BUG] Python checkpoint writers fail to reload full ZeRO-3 state with default torch.loadPossibly taken @ai-yang claimed this 43 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepspeedai/DeepSpeed#8500 ·
Maintainers usually reply within 3 days
-
[BUG] set_norm_for_param_grad_in_gpu's grad_accum fallback is dead in both accumulation modesPossibly taken @LOGO127 claimed this 52 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
deepspeedai/DeepSpeed#8371 ·
Maintainers usually reply within 3 days
All issues in deepspeedai/DeepSpeed
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
UKGovernmentBEIS/optstop#10 ·
-
maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pollen-robotics/reachy_mini#1508 ·
Maintainers usually reply within 1 day
-
[BUG] `cloud-keys.env` values retain enclosing quotes causing 401 Unauthorized, and missing utf-8 encoding crashes on WindowsPossibly taken @divyanshu07-code claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
open-jarvis/OpenJarvis#1192 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sylvainmetayer/homelab#851 ·
Maintainers usually reply within 1 day