modelscope / modelscope/ms-swift

DeepSpeed with Muon Optimizer

Open
#6,953 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

It seems that using muon alone (zero0) is also not working. I tested deespeed zero1, 2, all lead to the same error. Please consider supporting Muon Optimizer alongside deepseed.

swift sft
    --deepspeed zero0 \
    --optimizer muon \
...
[rank0]:   File "/root/.cache/modelscope/Moonlight/examples/toy_train.py", line 60, in zeropower_via_newtonschulz5
[rank0]:     assert len(G.shape) == 2
[rank0]:            ^^^^^^^^^^^^^^^^^
[rank0]: AssertionError

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the shown swift sft command using --deepspeed zero0 and --optimizer muon, then inspect examples/toy_train.py at zeropower_via_newtonschulz5 line 60. Trace how optimizer parameters are passed under the DeepSpeed configurations and verify completion without the len(G.shape) == 2 assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.