ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

rlhf,grpo,qwen30B, Stuck in the initial stage of training

Open helin-wang-zte opened this issue 1 year ago • 9 comments

When training qwen3-14B and -32B with the same script, it can be completed smoothly. But switching to 30B won't work and won't generate any errors. Is it a problem with the model type 'qwen3_moe'? The script is as follows:

#rollout:
CUDA_VISIBLE_DEVICES=0,1,2,3 \
swift rollout \
    --model "$MODEL_PATH" \
    --model_type qwen3_moe \
    --vllm_tensor_parallel_size 2 \
    --vllm_data_parallel_size 2 \
    --port 8099
#traning:
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
NPROC_PER_NODE=8 \
swift rlhf \
    --rlhf_type grpo \
    --model "$MODEL_PATH" \
    --model_type qwen3_moe \
    --dataset /mnt/tenant-home_speed/whl/swift_learn/dataset/numina_math_64#32 \
    --output_dir /mnt/tenant-home_speed/whl/swift_learn/output/grpo-training/qwen30B \
    --importance_sampling_level sequence \
    --reward_funcs accuracy \
    --torch_dtype bfloat16 \
    --beta 0.0 \
    --epsilon 3e-4 \
    --epsilon_high 4e-4 \
    --steps_per_generation 4 \
    --num_train_epochs 1 \
    --per_device_train_batch_size 2 \
    --gradient_accumulation_steps 8 \
    --num_generations 16 \
    --train_type full \
    --use_vllm true \
    --vllm_mode server \
    --vllm_server_host xxxx \
    --vllm_server_port 8099 \
    --vllm_gpu_memory_utilization 0.6 \
    --vllm_max_model_len 4096 \
    --max_completion_length 2048 \
    --learning_rate 1e-6 \
    --save_total_limit 2 \
    --logging_steps 1 \
    --warmup_ratio 0.05 \
    --dataloader_num_workers 4 \
    --log_completions true \
    --deepspeed zero3 \
    --offload_optimizer true \
    --offload_model true \
    --sleep_level 1
Image

helin-wang-zte avatar Sep 25 '25 03:09 helin-wang-zte

same problem, have you fix this?

genagent-oss avatar Sep 28 '25 03:09 genagent-oss

Training optimizations for MoE models will be completed soon

hjh0119 avatar Sep 28 '25 03:09 hjh0119

Training optimizations for MoE models will be completed soon

May I ask where I can stay informed in a timely manner after the optimization is completed?

helin-wang-zte avatar Sep 28 '25 03:09 helin-wang-zte

We’ll update this issue once it’s done, stay tuned

hjh0119 avatar Sep 28 '25 03:09 hjh0119

We’ll update this issue once it’s done, stay tuned

is the optimization done?

genagent-oss avatar Sep 30 '25 07:09 genagent-oss

We’ll update this issue once it’s done, stay tuned

is this doen?

genagent-oss avatar Oct 11 '25 03:10 genagent-oss

work in progress, will be completed within a few days.

https://github.com/modelscope/ms-swift/pull/5773 https://github.com/modelscope/ms-swift/pull/6025

hjh0119 avatar Oct 11 '25 08:10 hjh0119

weight synchronization is optimized in https://github.com/modelscope/ms-swift/pull/5773

please retry with main branch

some moe grpo script can be found in here https://github.com/modelscope/ms-swift/tree/main/examples/train/grpo

hjh0119 avatar Oct 17 '25 09:10 hjh0119

Megatron GRPO is supported

hjh0119 avatar Nov 14 '25 13:11 hjh0119