QwenLM / Qwen

The official repo of Qwen (通义千问) chat & pretrained large language model proposed by Alibaba Cloud.
Apache License 2.0
13.59k stars 1.11k forks source link

[BUG] <单机多卡使用finetune_qlora_ds.sh训练生成的/checkpoint-3/global_step3有什么用?/> #1000

Closed WangxuP closed 8 months ago

WangxuP commented 8 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

我使用官方提供的镜像进行单机多卡lora训练,想咨询一下生成的/checkpoint-3/global_step3有什么用? 是否可以删除? 因为这个文件有54G,是否会影响推理?

finetune_qlora_ds.sh内容如下:

#!/bin/bash
export CUDA_DEVICE_MAX_CONNECTIONS=1
DIR=`pwd`

GPUS_PER_NODE=8
NNODES=1
NODE_RANK=0
MASTER_ADDR=localhost
MASTER_PORT=8888

MODEL="/workspace/models/Qwen-14B-Chat/" # Set the path if you do not want to load from huggingface directly
# ATTENTION: specify the path to your training data, which should be a json file consisting of a list of conversations.
# See the section for finetuning in README for more information.
DATA="/workspace/wxp/data/generalization_data_v4.json"
OUT_DATA="/workspace/wxp/out_test_0123"

DISTRIBUTED_ARGS="
    --nproc_per_node $GPUS_PER_NODE \
    --nnodes $NNODES \
    --node_rank $NODE_RANK \
    --master_addr $MASTER_ADDR \
    --master_port $MASTER_PORT
"

torchrun $DISTRIBUTED_ARGS finetune.py \
    --model_name_or_path $MODEL \
    --data_path $DATA \
    --bf16 True \
    --output_dir  $OUT_DATA\
    --num_train_epochs 5 \
    --per_device_train_batch_size 2 \
    --per_device_eval_batch_size 1 \
    --gradient_accumulation_steps 8 \
    --evaluation_strategy "no" \
    --save_strategy "steps" \
    --save_steps 3 \
    --save_total_limit 10 \
    --learning_rate 3e-4 \
    --weight_decay 0.1 \
    --adam_beta2 0.95 \
    --warmup_ratio 0.01 \
    --lr_scheduler_type "cosine" \
    --logging_steps 1 \
    --report_to "none" \
    --model_max_length 512 \
    --lazy_preprocess True \
    --use_lora \
    --lora_r 8 \
    --lora_target_modules "c_attn" \
    --deepspeed finetune/ds_config_zero2.json

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

docker run -it --gpus all --shm-size 4G --rm -v /home:/workspace qwenllm/qwen:cu117 bash

备注 | Anything else?

No response

jklj077 commented 8 months ago

不需要resume的话,可以删。