Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deepspeed zero2/zero3 训练报错:KeyError: 'use_muon' #6

Closed
Jintao-Huang opened this issue Feb 24, 2025 · 1 comment
Closed

deepspeed zero2/zero3 训练报错:KeyError: 'use_muon' #6

Jintao-Huang opened this issue Feb 24, 2025 · 1 comment

Comments

@Jintao-Huang
Copy link

感谢moonlight如此优秀模型的开源,swift借助examples/toy_train.py的实现集成了muon优化器:modelscope/ms-swift#3234

shell可以参考这里:https://github.com/modelscope/ms-swift/blob/main/examples/train/optimizer/muon.sh

但是在进行deepspeed zero2/zero3训练时,遇到报错:KeyError: 'use_muon',后续会兼容zero2/zero3的训练嘛

Image

复现脚本:

NPROC_PER_NODE=2 \
CUDA_VISIBLE_DEVICES=0,1 \
swift sft \
    --model Qwen/Qwen2.5-7B-Instruct \
    --train_type lora \
    --dataset 'AI-ModelScope/alpaca-gpt4-data-zh#500' \
              'AI-ModelScope/alpaca-gpt4-data-en#500' \
              'swift/self-cognition#500' \
    --optimizer muon \
    --torch_dtype bfloat16 \
    --num_train_epochs 1 \
    --per_device_train_batch_size 1 \
    --per_device_eval_batch_size 1 \
    --learning_rate 1e-4 \
    --lora_rank 8 \
    --lora_alpha 32 \
    --target_modules all-linear \
    --gradient_accumulation_steps 16 \
    --eval_steps 50 \
    --save_steps 50 \
    --save_total_limit 5 \
    --logging_steps 5 \
    --max_length 2048 \
    --output_dir output \
    --system 'You are a helpful assistant.' \
    --warmup_ratio 0.05 \
    --dataloader_num_workers 4 \
    --model_author swift \
    --model_name swift-robot \
    --deepspeed zero2
@toothacher17
Copy link
Collaborator

Hi, thanks for trying to migrate it to Deepspeed. However, maintaining a code in Deepseed is not in our roadmap, but we do plan to support for Megatron-LM

Please see an example PR here: NVIDIA/Megatron-LM#1428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants