[REQUEST] Support RMS-matched Muon updates via adjust_lr_fn configuration
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 54/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- distributed-systems, machine-learning
Hướng nghiên cứu
Start with deepspeed/runtime/zero/muon/original_muon.py and the _MUON_HALF_KEYS configuration handling in deepspeed/runtime/engine.py; trace how Muon settings reach the supported ZeRO and offload update paths. Check the existing Muon tests and configuration documentation before editing. Done means both scaling modes work with standard and gram, the default preserves current behavior, and validation covers overrides, logical matrix shapes, and weight decay.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
DeepSpeed's current Muon implementation does not support RMS-matched update scaling (match_rms_adamw). It uses the original aspect-ratio scaling after Newton–Schulz orthogonalization, with no option to select RMS matching through the DeepSpeed configuration.
At the reviewed commit 0eb3a8b, _aspect_ratio_scale() and muon_update() use the following scaling factor for a matrix of shape (rows, cols):
original_scale = sqrt(max(1, rows / cols))
By comparison, PyTorch's Muon provides adjust_lr_fn="match_rms_adamw", which uses:
rms_match_scale = 0.2 * sqrt(max(rows, cols))
The missing option makes it harder to reproduce RMS-matched Muon training recipes in DeepSpeed. Increasing a single global muon_lr cannot generally reproduce this scaling across matrices with different input dimensions:
| Matrix shape | Current scale | RMS-match scale | RMS-match / current |
|---|---|---|---|
(1024, 1024) |
1.0 | 6.4 | 6.4 |
(4096, 1024) |
2.0 | 12.8 | 6.4 |
(1024, 4096) |
1.0 | 12.8 | 12.8 |
These values are an analytical comparison of the scaling formulas, not training benchmark results. The existing behavior is the original Muon scaling convention; the request is to make RMS matching available as an additional mode.
Describe the solution you'd like
Add an optional adjust_lr_fn setting under optimizer.params, using the same names as PyTorch:
| Value | Behavior |
|---|---|
"original" |
Preserve the existing aspect-ratio scaling. Default when the setting is omitted. |
"match_rms_adamw" |
Enable RMS matching using 0.2 * sqrt(max(rows, cols)). |
For example, the proposed configuration fragment to enable RMS matching would be:
{
"optimizer": {
"type": "Muon",
"params": {
"lr": 0.0003,
"momentum": 0.95,
"weight_decay": 0.01,
"ns_method": "gram",
"adjust_lr_fn": "match_rms_adamw"
}
},
"zero_optimization": {
"stage": 2
}
}
Setting "adjust_lr_fn": "original", or omitting the option, should retain the current behavior. Existing muon_lr and adam_lr overrides should continue to work, and the new option should affect only the Muon parameters.
A rough implementation design:
- Add the option to the engine's
_MUON_HALF_KEYS, preserving config defaults and parameter-group overrides. - Pass it through the Muon optimizer and all supported ZeRO/offload call sites to a shared update-scaling helper. Support both
standardandgramNewton–Schulz methods, and reject unsupported setting values. - Apply the selected factor exactly once, based on the logical matrix shape before ZeRO flattening or partitioning. For per-head or batched expert updates, use the dimensions of each matrix actually being orthogonalized; document the shape convention for flattened convolutional weights.
- Keep decoupled weight decay based on the group's learning rate, applying the shape-dependent factor only to the orthogonalized update.
- Document the new configuration setting and its backward-compatible default.
Describe alternatives you've considered
- Adjusting a global
muon_lr: insufficient when different matrices require different correction factors, as illustrated above. - Using shape-specific parameter groups and learning rates: a possible workaround, but requires manual grouping and care to preserve the intended weight-decay strength.
- Using a separate Muon implementation: provides RMS matching, but does not directly add the option to DeepSpeed's built-in Muon/ZeRO integration.
Additional context
RMS matching here means the shape-based calibration used by PyTorch's match_rms_adamw mode. It targets an approximately AdamW-like update RMS; it does not require maintaining AdamW second moments for Muon parameters or measuring a separate AdamW update at each step. With finite Newton–Schulz iterations, it should not be interpreted as enforcing an exact RMS of 0.2.
Related references:
- Ngôn ngữ chính
- Python
- Star
- 43.3k
- Fork
- 5.1k
- Merge trung bình
- 5 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 85
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của deepspeedai/DeepSpeed
-
[Bug] DeepSpeedEngine.step leaves _running_engine_step=True permanently on exception, corrupting is_gradient_accumulation_boundary()Có thể đã có người làm @its-amann đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
deepspeedai/DeepSpeed#9190 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] PipelineEngine._exec_reduce_grads and _exec_optimizer_step leave _force_grad_boundary=True permanently after any exceptionCó thể đã có người làm @bantianyue đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepspeedai/DeepSpeed#9183 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
deepspeedai/DeepSpeed#9019 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
fp16 `hysteresis: 0` (or negative) makes DynamicLossScaler never lower the loss scale, so every overflowing step is skipped foreverCó thể đã có người làm @damienen đã nhận 26 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
deepspeedai/DeepSpeed#8982 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUG] OneCycle applies the minimum momentum to the first Adam updateCó thể đã có người làm @ai-yang đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepspeedai/DeepSpeed#8951 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của deepspeedai/DeepSpeed
Issue tương tự
-
area/auth comp/agent P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#161417 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Dao-AILab/flash-attention#3251 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[New Check]: sqlserver_public_network_access_disabledCó thể đã có người làm @pouria-l đã nhận hôm nay. Đang mởfeature-request status/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
prowler-cloud/prowler#13607 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
external langchain
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
langchain-ai/docs#8184 ·
Maintainer thường phản hồi trong vòng 1 ngày