"nproc_per_node=7
CUDA_VISIBLE_DEVICES=7,6,5,4,3,2,1 \
torchrun \
    --nproc_per_node=$nproc_per_node \
    --master_port 29500 \
    /mnt/10101/staryea/aigc/modelscope_tuning/swift-main/examples/pytorch/llm/llm_sft.py \
    --model_id_or_path qwen/Qwen-1_8B-Chat \
    --model_revision master \
    --sft_type lora \
    --lora_target_modules ALL \
    --template_type qwen \
    --dtype AUTO \
    --output_dir output/mix \
    --ddp_backend nccl \
    --train_dataset_sample -1 \
    --val_dataset_sample -1 \
    --num_train_epochs 3 \
    --max_length -1 \
    --check_dataset_strategy warning \
    --gradient_checkpointing true \
    --batch_size 1 \
    --weight_decay 0.01 \
    --learning_rate 1e-4 \
    --gradient_accumulation_steps $(expr 16 / $nproc_per_node) \
    --max_grad_norm 0.5 \
    --warmup_ratio 0.1 \
    --eval_steps 100 \
    --save_steps 100 \
    --save_only_model true \
    --save_total_limit 2 \
    --logging_steps 10 \
    --train_dataset_mix_ratio 3.0 \
    --resume_from_checkpoint output/mix/qwen-1_8b-chat/v22-20240305-065252/checkpoint-11300 \
    --dataset jd-sentiment-zh \
    --custom_train_dataset_path /mnt/10101/staryea/aigc/modelscope_tuning/data/qwen_intent_data.jsonl \
    --custom_val_dataset_path /mnt/10101/staryea/aigc/modelscope_tuning/data/qwen_intent_val_data.jsonl \
    --lora_target_modules ALL  现在训练还是会出现某一个卡显存不够的情况,导致训练中止, ModelScope参数里面有没有可调的,能更节省显存?"
ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352