modelscope / ms-swift

Use PEFT or Full-parameter to finetune 400+ LLMs or 100+ MLLMs. (LLM: Qwen2.5, Llama3.2, GLM4, Internlm2.5, Yi1.5, Mistral, Baichuan2, DeepSeek, Gemma2, ...; MLLM: Qwen2-VL, Qwen2-Audio, Llama3.2-Vision, Llava, InternVL2, MiniCPM-V-2.6, GLM4v, Xcomposer2.5, Yi-VL, DeepSeek-VL, Phi3.5-Vision, ...)
https://swift.readthedocs.io/zh-cn/latest/Instruction/index.html
Apache License 2.0
4.46k stars 391 forks source link

qwen2 audio dpo微调报错 #2108

Open zhangfan-algo opened 2 months ago

zhangfan-algo commented 2 months ago

Describe the bug image

Additional context SIZE_FACTOR=8 MAX_PIXELS=602112 torchrun --nproc_per_node ${num_gpu_per_node} --master_port $MASTER_PORT --master_addr $MASTER_ADDR --node_rank $RANK --nnodes $WORLD_SIZE examples/pytorch/llm/llm_rlhf.py \ --model_cache_dir Qwen2-Audio-7B-Instruct \ --model_type qwen2-audio-7b-instruct \ --rlhf_type dpo \ --sft_type full \ --tuner_backend swift \ --template_type AUTO \ --output_dir output/audio-dpo \ --ddp_backend nccl \ --custom_train_dataset_path train-audio-dpo.jsonl \ --dataset_test_ratio 0.01 \ --self_cognition_sample -1 \ --preprocess_num_proc 60 \ --dataloader_num_workers 60 \ --train_dataset_sample -1 \ --dataset_test_ratio 0.01 \ --save_strategy epoch \ --lr_scheduler_type cosine \ --save_total_limit 5 \ --num_train_epochs 5 \ --eval_steps 50 \ --logging_steps 10 \ --max_length 16384 \ --check_dataset_strategy warning \ --gradient_checkpointing true \ --batch_size 1 \ --gradient_accumulation_steps 4 \ --deepspeed_config_path ds_z3_offload_config.json \ --weight_decay 0.01 \ --learning_rate 1e-4 \ --max_grad_norm 0.5 \ --warmup_ratio 0.03 \ --use_flash_attn false \ --save_only_model false \ --save_on_each_node false \ --lazy_tokenize true \ --neftune_noise_alpha 5 \ --dtype AUTO

zhangfan-algo commented 2 months ago

zero3&zero3 offload会报上面的错,zero2会显存溢出