-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_exp.bash
84 lines (76 loc) · 3.18 KB
/
run_exp.bash
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
# -*- coding:utf-8 -*-
echo "Start Running ..."
script=$1
device=$2
read -ra GRADIENT_ACCUMULATION_STEPS <<<"${GRADIENT_ACCUMULATION_STEPS}"
read -ra LR_RATE <<<"${LR_RATE}"
read -ra EPOCHS <<<"${EPOCHS}"
read -ra LORA_TARGET_MODULES <<<"${LORA_TARGET_MODULES}"
read -ra LORA_R <<<"${LORA_R}"
read -ra LORA_ALPHA <<<"${LORA_ALPHA}"
read -ra LORA_DROPOUT <<<"${LORA_DROPOUT}"
read -ra MAX_LENGTH <<<"${MAX_LENGTH}"
read -ra MAX_NUM_INSTANCES_FLAN <<<"${MAX_NUM_INSTANCES_FLAN}"
read -ra MAX_NUM_INSTANCES_IE <<<"${MAX_NUM_INSTANCES_IE}"
read -ra DATA_NAME <<<"${DATA_NAME}"
read -r model_name <<<"${model_name}"
read -r model_type <<<"${model_type}"
read -r exp_name <<<"${exp_name}"
read -r batch_size <<<"${batch_size}"
read -r text_tuning <<<"${text_tuning}"
echo "model_name: " ${model_name}
echo "exp_name: " ${exp_name}
echo "device: " ${device}
for data_name in "${DATA_NAME[@]}"; do
echo "data_name " ${data_name}
for learning_rate in "${LR_RATE[@]}"; do
echo "learning rate " ${learning_rate}
for gradient_accumulation_steps in "${GRADIENT_ACCUMULATION_STEPS[@]}"; do
echo "batch size " $((batch_size * gradient_accumulation_steps))
for epochs in "${EPOCHS[@]}"; do
echo "epochs " ${epochs}
for max_length in "${MAX_LENGTH[@]}"; do
echo "max_length " ${max_length}
for lora_target_modules in "${LORA_TARGET_MODULES[@]}"; do
echo "lora_target_modules " ${lora_target_modules}
for lora_r in "${LORA_R[@]}"; do
echo "lora_r " ${lora_r}
for lora_alpha in "${LORA_ALPHA[@]}"; do
echo "lora_alpha " ${lora_alpha}
for lora_dropout in "${LORA_DROPOUT[@]}"; do
echo "lora_dropout " ${lora_dropout}
for max_num_instances_flan in "${MAX_NUM_INSTANCES_FLAN[@]}"; do
echo "max_num_instances_flan " ${max_num_instances_flan}
for max_num_instances_ie in "${MAX_NUM_INSTANCES_IE[@]}"; do
echo "max_num_instances_ie " ${max_num_instances_ie}
bash ${script} \
-m ${model_name} \
-i ${data_name} \
--model_type ${model_type} \
--epochs ${epochs} \
--device ${device} \
--gradient_accumulation_steps ${gradient_accumulation_steps} \
--exp_name ${exp_name} \
--text_tuning ${text_tuning} \
--lora_target_modules ${lora_target_modules} \
--lora_r ${lora_r} \
--lora_alpha ${lora_alpha} \
--lora_dropout ${lora_dropout} \
--batch ${batch_size} \
--max_num_instances_flan ${max_num_instances_flan} \
--max_num_instances_ie ${max_num_instances_ie} \
--lr ${learning_rate} \
--max_length ${max_length} \
done
done
done
done
done
done
done
done
done
done
done
exit 0