forked from deepspeedai/DeepSpeedExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
42 lines (35 loc) · 768 Bytes
/
run.sh
File metadata and controls
42 lines (35 loc) · 768 Bytes
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
42
OOO=output
MASTER_PORT=12345
GPU=0
for TSK in qnli #stsb mrpc cola wnli sst2 rte qnli qqp mnli
do
if [ $TSK == wnli ] || [ $TSK == mrpc ]
then
EPOCH_NUM=5
else
EPOCH_NUM=3
fi
if [ $TSK == qqp ] || [ $TSK == mnli ]
then
TEST_JSON=test_long.json
else
TEST_JSON=test.json
fi
PORT=$((MASTER_PORT+GPU))
rm -rvf ./$OOO/${TSK}
CUDA_VISIBLE_DEVICES=$GPU python -m torch.distributed.launch \
--master_port $PORT \
--nproc_per_node 1 run_glue.py \
--model_name_or_path bert-base-cased \
--task_name $TSK \
--do_train \
--do_eval \
--max_seq_length 128 \
--per_device_train_batch_size 32 \
--learning_rate 2e-5 \
--num_train_epochs $EPOCH_NUM \
--output_dir ./$OOO/$TSK/ \
--fp16 \
--warmup_steps 2 \
--deepspeed test.json
done