基于LLaMA-Factory,用4个V100的GPU,如下命令训练ChatGLM3:
deepspeed --num_gpus 4 --master_port=9901 src/train_bash.py \
--deepspeed ds_config.json \
--stage sft \
--model_name_or_path models/chatglm3-6b \
--do_train \
--dataset aaa,bbb\
--template chatglm3 \
--finetuning_type lora \
--lora_target query_key_value \
--output_dir output/aaabbbccc/ \
--overwrite_cache \
--per_device_train_batch_size 4 \
--gradient_accumulation_steps 4 \
--lr_scheduler_type cosine \
--logging_steps 10 \
--save_steps 200 \
--learning_rate 5e-5 \
--num_train_epochs 200 \
--plot_loss \
--overwrite_output_dir True \
--fp16
其中,ds_config.json用的是LLaMA-Factory的github中给出的默认配置。但一直报错:Caught signal 7 (Bus error: nonexistent physical address)。
最终在这里看到别人的讨论(https://github.com/huggingface/transformers-bloom-inference/issues/16),得到启发,用df -h查看,确实是/dev/shm内存太小。因为笔者是用docker im

文章讲述了作者在使用LLaMA-Factory的默认配置训练ChatGLM3时遇到BusError,经排查发现是由于/dev/shm内存不足。通过在Docker容器中增大shm-size至6G,解决了内存问题并成功执行了多GPU训练命令。
4662

被折叠的 条评论
为什么被折叠?



