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

grpo 训练grad_norm = 0

Open 1006927966 opened this issue 1 year ago • 4 comments

'loss': -0.0, 'grad_norm': 0.0, 'learning_rate': 2.6e-07, 'reward': 0.34375, 'reward_std': 0.4397946, 'frac_reward_zero_std': 0.0, 'rewards/StructureInfoFormatReward/mean': 0.34375, 'rewards/StructureInfoFormatReward/std': 0.43979461, 'completions/mean_length': 357.5, 'completions/min_length': 323.75, 'completions/max_length': 401.75, 'completions/clipped_ratio': 0.0, 'kl': 0.0, 'clip_ratio/low_mean': 0.0, 'clip_ratio/low_min': 0.0, 'clip_ratio/high_mean': 0.0, 'clip_ratio/high_max': 0.0, 'clip_ratio/region_mean': 0.0, 'epoch': 0.0, 'global_step/max_steps': '5/3766', 'percentage': '0.13%', 'elapsed_time': '1m 29s', 'remaining_time': '18h 37m 22s', 'memory(GiB)': 56.74, 'train_speed(iter/s)': 0.056099}

1006927966 avatar Aug 27 '25 13:08 1006927966

Could you provide a script to reproduce the issue?

hjh0119 avatar Aug 28 '25 02:08 hjh0119

--rlhf_type grpo
--model ./qwen3_8b_v1/
--dataset ./source_gspo_train.jsonl
--external_plugins ${CODE_PATH}/examples/train/grpo/plugin/plugin.py
--reward_funcs external_structure_info_format
--torch_dtype bfloat16
--num_train_epochs 2
--per_device_train_batch_size 1
--gradient_accumulation_steps 8
--num_generations 8
--train_type lora
--lora_rank 8
--lora_alpha 32
--target_modules all-linear
--use_vllm true
--vllm_mode colocate
--vllm_gpu_memory_utilization 0.5
--vllm_max_model_len 2048
--max_completion_length 1408
--offload_optimizer true
--offload_model true
--sleep_level 1
--save_steps 400
--learning_rate 1e-5
--save_total_limit 2
--logging_steps 5
--warmup_ratio 0.05
--output_dir ./qwen8b_gspo1
--temperature 1.
--top_p 0.99
--top_k 50
--dataloader_num_workers 8
--deepspeed zero3
--log_completions true
--report_to wandb
--use_hf true

Could you provide a script to reproduce the issue?

1006927966 avatar Aug 28 '25 02:08 1006927966

Could you provide a script to reproduce the issue?

1006927966 avatar Aug 28 '25 02:08 1006927966

Could you provide a script to reproduce the issue?

--rlhf_type grpo --model ./qwen3_8b_v1/ --dataset ./source_gspo_train.jsonl --external_plugins ${CODE_PATH}/examples/train/grpo/plugin/plugin.py --reward_funcs external_structure_info_format --torch_dtype bfloat16 --num_train_epochs 2 --per_device_train_batch_size 1 --gradient_accumulation_steps 8 --num_generations 8 --train_type lora --lora_rank 8 --lora_alpha 32 --target_modules all-linear --use_vllm true --vllm_mode colocate --vllm_gpu_memory_utilization 0.5 --vllm_max_model_len 2048 --max_completion_length 1408 --offload_optimizer true --offload_model true --sleep_level 1 --save_steps 400 --learning_rate 1e-5 --save_total_limit 2 --logging_steps 5 --warmup_ratio 0.05 --output_dir ./qwen8b_gspo1 --temperature 1. --top_p 0.99 --top_k 50 --dataloader_num_workers 8 --deepspeed zero3 --log_completions true --report_to wandb --use_hf true

1006927966 avatar Aug 28 '25 02:08 1006927966