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

grpo 训练deepspeed==0.14.5报错

Open rtz1998 opened this issue 1 year ago • 1 comments

deepspeed=0.14.5

bug:RuntimeError: Inference tensors cannot be saved for backward. To work around you can make a clone to get a normal tensor and use it in autograd.

脚本: nproc_per_node=6

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
NPROC_PER_NODE=$nproc_per_node
swift rlhf
--rlhf_type grpo
--model ******/Qwen2.5-7B-Instruct
--model_type qwen2_5
--external_plugins ******/plugins.py
--reward_funcs ****
--train_type full
--torch_dtype bfloat16
--dataset ******
--split_dataset_ratio 0.05
--max_completion_length 2048
--num_train_epochs 2
--per_device_train_batch_size 1
--learning_rate 1e-6
--gradient_accumulation_steps 2
--eval_steps 100
--save_steps 100
--save_total_limit 2
--logging_steps 1
--max_length 4096
--output_dir ******
--logging_dir ******
--report_to tensorboard
--warmup_ratio 0.05
--dataloader_num_workers 4
--dataset_num_proc 4
--num_generations 6
--temperature 0.9
--deepspeed zero3.json
--attn_impl flash_attn
--truncation_strategy delete
--log_completions true
--greater_is_better true
--use_lmdeploy true
--num_infer_workers 2
--async_generate true \

rtz1998 avatar Feb 24 '25 03:02 rtz1998

参考这个issue哇:https://github.com/modelscope/ms-swift/issues/3237

Jintao-Huang avatar Feb 24 '25 03:02 Jintao-Huang