[Feature] Per-Head Muon: per-head Newton-Schulz orthogonalization for attention projections
Los mantenedores suelen responder en 3 días
@0z5a ya está trabajando en esto.
Desde el 18/9/2026.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
Línea de trabajo
Empieza leyendo deepspeed/runtime/zero/muon/original_muon.py y muon_optimizer.py para entender muon_update y sus rutas de Newton–Schulz; después, inspecciona el punto de llamada de ZeRO en deepspeed/runtime/zero/stage_1_and_2.py. Traza cómo se propagan los metadatos existentes de use_muon y la estructura de atención de AutoTP. Se considera terminado cuando un modo opt-in por cabeza funciona a través de ZeRO y está cubierto por pruebas de ortogonalización sintética y de convergencia con modelos pequeños.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 43.3k
- Forks
- 5.1k
- Merge medio
- 4 d 17 h
- PR fusionados (30 d)
- 63
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de deepspeedai/DeepSpeed
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
deepspeedai/DeepSpeed#8925 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
[BUG] Universal checkpoint resume puts CPU `step` into fused/capturable optimizer statePosiblemente ocupada @ArjunPakhan la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
deepspeedai/DeepSpeed#8884 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
init_inference rejects dtype=torch.int8 on every acceleratorQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepspeedai/DeepSpeed#8577 ·
Los mantenedores suelen responder en 3 días
-
[BUG] AutoTP checkpoint load raises AttributeError on a model containing nn.InstanceNorm1dPosiblemente ocupada @vineethsaivs la tomó hace 43 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
deepspeedai/DeepSpeed#8514 ·
Los mantenedores suelen responder en 3 días
-
[BUG] Python checkpoint writers fail to reload full ZeRO-3 state with default torch.loadPosiblemente ocupada @ai-yang la tomó hace 44 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepspeedai/DeepSpeed#8500 ·
Los mantenedores suelen responder en 3 días
Todos los issues de deepspeedai/DeepSpeed
Issues similares
-
parse names a key after a top-level multi() threshold Bitcoin Core v31.1 refuses as not validAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
btclib-org/btclib-wallet#587 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Judgment-Pack/judgment-pack-spec#275 ·
Los mantenedores suelen responder en 1 día
-
ai-generated
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
documentation good first issue priority: low size: XS
Dificultad 1/5 1-3 horas Aptitud para principiantes 92/100
yeongseon/azure-functions-doctor-python#651 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Changaco/python-libarchive-c#146 ·