forked from THUDM/GLM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ds_finetune_seq2seq.sh
41 lines (36 loc) · 1.21 KB
/
ds_finetune_seq2seq.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
DATA_ROOT=/root/data
CHECKPOINT_PATH="/dataset/c07bd62b/finetune_checkpoints"
SAVE_PATH=/root/data/finetune_checkpoints
DATESTR=$(date +"%m-%d-%H-%M")
source $1 # Model
source $2 # Task
NUM_WORKERS=2
NUM_GPUS_PER_WORKER=8
HOST_FILE_PATH="./hostfile"
MP_SIZE=1
MASTER_PORT=$(shuf -n 1 -i 10000-65535)
OPTIONS_NCCL="NCCL_DEBUG=info NCCL_IB_DISABLE=0 NCCL_NET_GDR_LEVEL=2"
DISTRIBUTED_ARGS="${OPTIONS_NCCL} deepspeed --hostfile ${HOST_FILE_PATH} --master_port ${MASTER_PORT} --num_nodes ${NUM_WORKERS} --num_gpus ${NUM_GPUS_PER_WORKER}"
EXPERIMENT_NAME=${EXPERIMENT_NAME}_${DATESTR}
mkdir logs
run_cmd="${DISTRIBUTED_ARGS} finetune_glm.py \
--deepspeed \
--deepspeed_config config_tasks/config_blocklm_10B_cnndm.json \
--finetune \
--experiment-name ${EXPERIMENT_NAME} \
--task ${TASK_NAME} \
--data-dir ${DATA_PATH} \
--save ${SAVE_PATH} \
--checkpoint-activations \
--num-workers 1 \
--no-load-lr-scheduler \
$MODEL_ARGS \
$TRAIN_ARGS \
$COMMON_ARGS \
$TASK_ARGS \
--fp16 \
--model-parallel-size ${MP_SIZE} \
--overwrite \
2>&1 | tee logs/log-${EXPERIMENT_NAME}.txt"
echo ${run_cmd}
eval ${run_cmd}