-
Notifications
You must be signed in to change notification settings - Fork 80
/
configs.yml
306 lines (271 loc) · 7.02 KB
/
configs.yml
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
#----------------------------------------------------------------------------------
defaults: &defaults
byteio: False
random_seed: 42
dataloader_workers: 64
ipus_per_replica: 4
synthetic_data: False
optimizer: SGD
auto_loss_scaling: False
weight_decay: 0.0
recompute_checkpoint_every_layer: True
attention_probs_dropout_prob: 0.0
hidden_dropout_prob: 0.1
layer_norm_eps: 1e-6
resume_training_from_checkpoint: False
enable_rts: True
optimizer_state_offchip: False
prefetch_depth: 2
precision: "16.16"
stochastic_rounding: True
wandb: False
representation_size: null
pretrain: False
mixup: False
loss: CELoss
extra_aug: null
reduction_type: "mean"
recompute_mid_layers: [1, 4, 7, 10]
#----------------------------------------------------------------------------------
b16_cifar10: &b16_cifar10
<<: *defaults
# Execution
micro_batch_size: 17
rebatched_worker_size: 128
training_steps: 2000
device_iterations: 1
replication_factor: 4
gradient_accumulation: 128
layers_per_ipu: [3,3,3,3]
enable_rts: True
wandb_project_name: "torch-vit-cifar10"
# Model
hidden_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 10
# Optimizer
optimizer: SGD
warmup_steps: 500
lr_schedule: cosine
learning_rate: 0.03
loss_scaling: 1.0
weight_decay: 0.0
momentum : 0.9
first_order_type: "fp16"
# Dataset
dataset: cifar10
dataset_path: "./data/cifar10"
pretrained_checkpoint: "google/vit-base-patch16-224-in21k"
checkpoint_output_dir: "./output/b16_cifar10"
checkpoint_save_steps: 500
#----------------------------------------------------------------------------------
b16_cifar10_valid: &b16_cifar10_valid
<<: *defaults
# Execution
micro_batch_size: 1
device_iterations: 1
replication_factor: 1
gradient_accumulation: 8
layers_per_ipu: [3,3,3,3]
# Model
hidden_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 10
# Dataset
dataset: cifar10
dataset_path: "./data/cifar10"
pretrained_checkpoint: "./output/b16_cifar10/step_1000"
#----------------------------------------------------------------------------------
b16_imagenet1k: &b16_imagenet1k
<<: *defaults
# Execution
micro_batch_size: 17
rebatched_worker_size: 256
training_steps: 625
device_iterations: 8
replication_factor: 4
gradient_accumulation: 30
layers_per_ipu: [3,3,3,3]
enable_rts: True
wandb_project_name: "torch-vit-in1k"
# Model
hidden_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 1000
# Optimizer
optimizer: SGD
warmup_steps: 100
lr_schedule: cosine
learning_rate: 0.08
loss_scaling: 0.25
weight_decay: 0.00001
momentum : 0.9
first_order_type: "fp16"
# Dataset
dataset: imagenet1k
dataset_path: "./data/imagenet1k/"
pretrained_checkpoint: "google/vit-base-patch16-224-in21k"
checkpoint_output_dir: "./output/b16_imagenet1k"
checkpoint_save_steps: 100
#----------------------------------------------------------------------------------
b16_imagenet1k_ALS:
<<: *b16_imagenet1k
# Optimizer
loss_scaling: 1.0
auto_loss_scaling: True
#----------------------------------------------------------------------------------
b16_imagenet1k_valid: &b16_imagenet1k_valid
<<: *defaults
# Execution
micro_batch_size: 8
device_iterations: 1
replication_factor: 1
gradient_accumulation: 1
layers_per_ipu: [3,3,3,3]
# Model
hidden_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 1000
# Dataset
dataset: imagenet1k
dataset_path: "./data/imagenet1k/"
pretrained_checkpoint: "./output/b16_imagenet1k/step_625"
#----------------------------------------------------------------------------------
b16_in1k_pretrain: &b16_in1k_pretrain
<<: *defaults
# Execution
micro_batch_size: 8
# When rebatching with mixup enabled, global batch size needs to be divisible by rebatched_worker_size needs
rebatched_worker_size: 256
epochs: 300
device_iterations: 1
replication_factor: 4
gradient_accumulation: 128
layers_per_ipu: [3,3,3,3]
enable_rts: True
wandb: False
wandb_project_name: "torch-vit-pretrain"
checkpoint_save_steps: 500
pretrain: True
mixup: True
extra_aug: "imagenet_policy"
reduction_type: "sum"
# Model
hidden_size: 768
representation_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 1000
attention_probs_dropout_prob: 0.1
drop_path_rate: 0.0
# Loss
alpha: 0.5
# Optimizer
optimizer: Adam
warmup_steps: 10000
lr_schedule: cosine
learning_rate: 0.001
loss_scaling: 128
weight_decay: 0.004
momentum : 0.9
# Dataset
dataset: imagenet1k
dataset_path: "./data/imagenet1k/"
pretrained_checkpoint: ""
checkpoint_output_dir: "./output/ckpt-in1k-pretrain"
#----------------------------------------------------------------------------------
b16_in1k_pretrain_lamb: &b16_in1k_pretrain_lamb
<<: *defaults
# Execution
micro_batch_size: 8
rebatched_worker_size: 2048
training_steps: 11730
epochs: 600
device_iterations: 1
replication_factor: 4
gradient_accumulation: 2048
layers_per_ipu: [3,3,3,3]
enable_rts: True
wandb: False
wandb_project_name: "torch-vit-pretrain"
checkpoint_save_steps: 40
pretrain: True
mixup: True
extra_aug: "imagenet_policy"
reduction_type: "sum"
# Model
hidden_size: 768
representation_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 1000
attention_probs_dropout_prob: 0.1
drop_path_rate: 0.0
# Loss
alpha: 0.5
# Optimizer
optimizer: LAMB
warmup_steps: 1200
lr_schedule: cosine
learning_rate: 0.006
loss_scaling: 1024
weight_decay: 0.01
momentum: 0.9
adam_betas: [0.9, 0.999]
adam_eps: 1e-6
bias_correction: True
accum_type: "fp32"
first_order_type: "fp32"
second_order_type: "fp32"
max_norm: 65535
max_norm_bias: 0
# Dataset
dataset: imagenet1k
dataset_path: "./data/imagenet1k/"
pretrained_checkpoint: ""
checkpoint_output_dir: "./output/ckpt-in1k-pretrain"
#----------------------------------------------------------------------------------
b16_in1k_pretrain_valid: &b16_in1k_pretrain_valid
<<: *defaults
# Execution
micro_batch_size: 8
device_iterations: 1
replication_factor: 1
gradient_accumulation: 1
layers_per_ipu: [3,3,3,3]
pretrain: True
# Model
hidden_size: 768
representation_size: 768
num_hidden_layers: 12
num_attention_heads: 12
matmul_proportion: [0.3, 0.3, 0.3, 0.3]
mlp_dim: 3072
patches_size: 16
num_labels: 1000
# Dataset
dataset: imagenet1k
dataset_path: "./data/imagenet1k/"
pretrained_checkpoint: "./output/ckpt-in1k-pretrain/step_93599"