-
Notifications
You must be signed in to change notification settings - Fork 188
/
train_hqq_bench.sh
150 lines (140 loc) · 3.41 KB
/
train_hqq_bench.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Full vs QLORA vs HQQ, batch size = 64
# Full
# max batch size / gpu = 8 (38/40 GB)
# 8 * 2 gpus * 4 grad accum = 64
export CUDA_VISIBLE_DEVICES=4,5
python train.py \
--world_size 2 \
--master_port 12356 \
--model_name meta-llama/Llama-2-7b-hf \
--gradient_accumulation_steps 4 \
--batch_size 8 \
--context_length 512 \
--precision bf16 \
--train_type full \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to wandb \
--dataset alpaca \
--verbose true
# BnB (QLORA)
# max batch size / gpu = 16 (28/40 GB)
# 16 * 2 gpus * 2 grad accum = 64
export CUDA_VISIBLE_DEVICES=4,5
python train.py \
--world_size 2 \
--master_port 12356 \
--model_name meta-llama/Llama-2-7b-hf \
--gradient_accumulation_steps 2 \
--batch_size 16 \
--context_length 512 \
--precision bf16 \
--train_type custom_qlora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to wandb \
--dataset alpaca \
--verbose true
# HQQ (QLORA)
# max batch size / gpu = 32 (28/40 GB)
# 32 * 2 gpus = 64
export CUDA_VISIBLE_DEVICES=4,5
python train.py \
--world_size 2 \
--master_port 12356 \
--model_name meta-llama/Llama-2-7b-hf \
--gradient_accumulation_steps 1 \
--batch_size 32 \
--context_length 512 \
--precision bf16 \
--train_type hqq_lora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to wandb \
--dataset alpaca \
--verbose true
# DORA: max batch size / gpu = 32 (28/40 GB)
# 32 * 2 gpus = 64
export CUDA_VISIBLE_DEVICES=6,7
python train.py \
--world_size 2 \
--master_port 12357 \
--model_name meta-llama/Llama-2-7b-hf \
--gradient_accumulation_steps 1 \
--batch_size 32 \
--context_length 512 \
--precision bf16 \
--train_type hqq_dora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to stdout \
--dataset alpaca \
--verbose true
# 32 * 2 gpus = 64
export CUDA_VISIBLE_DEVICES=2,6
python train.py \
--world_size 2 \
--master_port 12356 \
--model_name meta-llama/Llama-2-7b-hf \
--gradient_accumulation_steps 1 \
--batch_size 32 \
--context_length 512 \
--precision bf16 \
--train_type hqq_lora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to stdout \
--dataset dummy \
--verbose true \
--save_model true \
--output_dir /weka/home-keremturgutlu/models/hqq_lora_dummy
export CUDA_VISIBLE_DEVICES=2,6
python train.py \
--lr 1e-3 \
--world_size 2 \
--master_port 12356 \
--model_name meta-llama/Llama-2-7b-hf \
--gradient_accumulation_steps 1 \
--batch_size 32 \
--context_length 512 \
--precision bf16 \
--train_type custom_qlora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to stdout \
--dataset dummy \
--verbose true \
--save_model true \
--output_dir /weka/home-keremturgutlu/models/qlora_dummy
# BNB 70B
export CUDA_VISIBLE_DEVICES=4,5,6,7
python train.py \
--world_size 4 \
--master_port 12356 \
--model_name meta-llama/Llama-2-70b-hf \
--gradient_accumulation_steps 4 \
--batch_size 2 \
--context_length 512 \
--precision bf16_buffers_autocast \
--train_type custom_qlora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to stdout \
--dataset alpaca \
--verbose true
# HQQ 70B
export CUDA_VISIBLE_DEVICES=4,5,6,7
python train.py \
--world_size 4 \
--master_port 12356 \
--model_name meta-llama/Llama-2-70b-hf \
--gradient_accumulation_steps 4 \
--batch_size 2 \
--context_length 512 \
--precision bf16_buffers_autocast \
--train_type hqq_lora \
--use_gradient_checkpointing true \
--use_cpu_offload false \
--log_to stdout \
--dataset alpaca \
--verbose true