File size: 14,109 Bytes
32b542e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
_BASE_: "base_model_bert_l12_h192.yaml"

SHARED_TARGETS:

  # - 
  #   NAME: 'ImageNet1k'
  #   SHARED_TARGETS_CFG:
  #     FILE_PATH: 'open_source_dataset/imagenet_class_name_CLIP_with_endoftext.pkl'
  #     DISTRIBUTED: False
  
  -
    NAME: 'Vocab_Word'
    SHARED_TARGETS_CFG:
      FILE_PATH: 'open_source_dataset/vocabulary_CLIP_with_endoftext.pkl'
      DISTRIBUTED: True

  # - 
  #   NAME: 'Kinetics400'
  #   SHARED_TARGETS_CFG:
  #     FILE_PATH: 'open_source_dataset/k400_class_name_CLIP_with_endoftext.pkl'
  #     DISTRIBUTED: False



TASKS:

  # - 
  #   NAME: imagenet
  #   DATASETS:
  #     TRAIN: 'ImageNetDataset'
  #     VAL: 'ImageNetDataset'
  #     TASK_TYPE: 'image_classification'
  #     DATASET_NAME: 'ImageNet1k'
  #     TARGET_SET: ['ImageNet1k']
      
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 720
  #     # TEST_BATCH_SIZE: 2
  #     NUM_WORKERS: 4
  #     FEATS_FOLDER: 'cluster2:s3://imagenet'
  #     ANNO_FOLDER:  'open_source_dataset/imagenet/meta'
  #     SAMPLING_WEIGHT: 2.5
  #     CLASS_NAME_FILE: 'open_source_dataset/imagenet_class_name.pkl'
  #     MIXUP: 0.8
  #     CUTMIX: 1.0
  #     MIXUP_PROB: 1.0
  #     MIXUP_SWITCH_PROB: 0.5
  #     MIXUP_MODE: 'batch'
  #     MIXUP_LABEL_SMOOTHING: 0.1
  #   MODEL:
  #     MAX_SEQ_LEN: -1
  #     LABELS_NUM: 1000
  #     TEMP_NAME: logit_scale_img_cls
  #   LOSSES:
  #     NAMES: ['SoftTargetCrossEntropy', 'Accuracy']
  #     LOSS_WEIGHT: 1.0
  #     REDUCTION: 'mean'
  #     # LOSS_FP32: True
  #   INFERENCE:
  #     NAME: 'ImageNetEvaler'
  #     ID_KEY: 'image_id'
  #     VALUE: 'cls_logits'
  #     VAL_ANNFILE: 'open_source_dataset/imagenet/meta/val.txt'
  #     TEST_ANNFILE: ''
  #     GENERATION_MODE: False
  
  # -
  #   NAME: K400_retrieve
  #   DATASETS:
  #     TRAIN: 'VideoDataSet'
  #     VAL: 'VideoDataSet'
  #     TASK_TYPE: 'video_classification'
  #     DATASET_NAME: 'K400'
  #     TARGET_SET: ['Kinetics400']
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 12 # 256
  #     TEST_BATCH_SIZE: 4 # debug
  #     NUM_WORKERS: 4 # debug 4
  #     FEATS_FOLDER: 'open_source_dataset/K400_official'
  #     ANNO_FOLDER:  'open_source_dataset/K400_official'
  #     S3_PATH: 's3://K400/'
  #     FRAMES_PER_CLIP: 8
  #     STRIDE: 32
  #     FILE_EXTENSION: ''
  #     ANNO_FILE: 'annotation.json'
  #     TIMESFORMER_AUG: True
  #     SAMPLING_WEIGHT: 1.0
  #   MODEL:
  #     MAX_SEQ_LEN: -1
  #     TEMP_NAME: logit_scale_video_cls
  #   LOSSES:
  #     NAMES: ['LabelSmoothingCrossEntropy', 'Accuracy']
  #     LABELSMOOTHING: 0.1
  #     LOSS_WEIGHT: 1.0
  #   INFERENCE:
  #     NAME: 'MiTEvaler'
  #     ID_KEY: 'video_name'
  #     VALUE: 'label'
  #     VAL_ANNFILE: 'open_source_dataset/K400_official/annotation.json'
  #     TEST_ANNFILE: ''
  #     GENERATION_MODE: False
  #     NUM_VIEWS: 1
  
  # -
  #   NAME: bookswiki_pretrain
  #   DATASETS:
  #     TRAIN: 'GeneralCorpusDataset'
  #     TASK_TYPE: 'text_mlm'
  #     DATASET_NAME: 'BooksWiki'
  #     TARGET_SET: ['Vocab_Word']
  #     VERSION: 'v2'
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 512
  #     TEST_BATCH_SIZE: 32
  #     NUM_WORKERS: 2
  #     ANNO_FOLDER:  'open_source_dataset/text_corpus' # 'open_source_dataset/bert_pretrain_data/bookswiki'
  #     # ANNO_FOLDER:  'open_source_dataset/bert_pretrain_data/bookswiki'
  #     SEQ_PER_SAMPLE:  1
  #     SAMPLER: NodeDistributed
  #     CACHE_MODE: True
  #     SEQ_PER_SAMPLE: 128
  #     MIN_SEQ_PER_SAMPLE: 128
  #     APPEND_EOS: True
  #     ONE_STREAM: False
  #     SAMPLING_WEIGHT: 3.5
  #     RANDOM_MASK: True
  #   MODEL:
  #     MAX_SEQ_LEN: 128
  #     TEMP_NAME: logit_scale_text_mlm
  #   LOSSES:
  #     NAMES: ['CrossEntropy', 'Accuracy']
  #     LOSS_WEIGHT: 0.33333
  #     REDUCTION: 'mean'
  #   INFERENCE:
  #     VOCAB: 'CLIP'
  #     GENERATION_MODE: False
  # -
  #   NAME: mscoco_retrieve
  #   DATASETS:
  #     TRAIN: 'ImageTextPairDataset'
  #     TEST: 'ImageTextPairDataset'
  #     TASK_TYPE: 'image_retrieval'
  #     DATASET_NAME: 'MSCOCO'
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 100
  #     TEST_BATCH_SIZE: 32
  #     NUM_WORKERS: 1
  #     FEATS_FOLDER: 'open_source_dataset/mscoco_dataset/coco_origin'
  #     ANNO_FOLDER:  'open_source_dataset/mscoco_dataset/new_annotations'
  #     S3_PATH: 's3://coco/'
  #     SEQ_PER_SAMPLE:  1
  #     CACHE_MODE: True
  #     CIRCULAR_CACHE_MODE: False
  #     ZIP_MODE: False
  #     CACHE_ORIGIN_IMAGE: False
  #     RANDOM_CAPTION: False
  #     AS_NUMPY_AS_POSSIBLE: False
  #     SAMPLING_WEIGHT: 1.0
  #     TRANSFORM: 'clip_transforms'
  #   MODEL:
  #     MAX_SEQ_LEN: 50
  #     TEMP_NAME: logit_scale_retrieve
  #   LOSSES:
  #     NAMES: ['LabelSmoothingCrossEntropy', 'Accuracy']
  #     LABELSMOOTHING: 0.1
  #     LOSS_WEIGHT: 1.0
  #     REDUCTION: 'mean'
  #   INFERENCE:
  #     VOCAB: 'CLIP'
  #     ID_KEY: 'image_id'
  #     VALUE: 'caption'
  #     NAME: 'RetrievalEvaler'
  #     VAL_ANNFILE: 'open_source_dataset/flickr30k/all_data_final_val_set0_2014.jsonline'
  #     TEST_ANNFILE: 'open_source_dataset/flickr30k/all_data_final_test_set0_2014.jsonline'
  #     GENERATION_MODE: False

 ########## Image Captioning ########### 


  # -
  #   NAME: cc12m_caption
  #   DATASETS:
  #     TRAIN: 'ImageTextPairDataset'
  #     TASK_TYPE: 'image_caption'
  #     DATASET_NAME: 'CC12M'
  #     TARGET_SET: ['Vocab_Word']
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 300
  #     TEST_BATCH_SIZE: 32
  #     NUM_WORKERS: 2
  #     S3_ANNO_FOLDER:  's3://cc12m/'
      # ANNO_FOLDER:  'open_source_dataset/c12m/'
  #     ANNO_FILENAME: 'train_available.json'
  #     FEATS_FOLDER: 'open_source_dataset/c12m/'
  #     S3_PATH: 's3://cc12m/'
  #     SEQ_PER_SAMPLE:  1
  #     SAMPLER: NodeDistributed
  #     CACHE_MODE: True
  #     CIRCULAR_CACHE_MODE: False
  #     ZIP_MODE: False
  #     CACHE_ORIGIN_IMAGE: False
  #     RANDOM_CAPTION: False
  #     AS_NUMPY_AS_POSSIBLE: False
  #     SAMPLING_WEIGHT: 1.6889
  #     TRANSFORM: 'clip_transforms'
  #   MODEL:
  #     MAX_SEQ_LEN: 50
  #     TEMP_NAME: logit_scale_caption
  #   LOSSES:
  #     NAMES: ['CrossEntropy', 'Accuracy']
  #     LOSS_WEIGHT: 0.33333
  #     REDUCTION: 'mean'
  #   INFERENCE:
  #     VOCAB: 'CLIP'
  #     GENERATION_MODE: False

  # -
  #   NAME: cc3m_caption
  #   DATASETS:
  #     TRAIN: 'ImageTextPairDataset'
  #     TASK_TYPE: 'image_caption'
  #     DATASET_NAME: 'CC3M'
  #     TARGET_SET: ['Vocab_Word']
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 300
  #     TEST_BATCH_SIZE: 32
  #     NUM_WORKERS: 2
  #     ANNO_FOLDER:  's3://cc3m/'
  #     ANNO_FILENAME: 'train_spacy.json'
  #     FEATS_FOLDER: 'open_source_dataset/cc3m/'
  #     S3_PATH: 's3://cc3m/'
  #     SEQ_PER_SAMPLE:  1
  #     SAMPLER: NodeDistributed
  #     CACHE_MODE: True
  #     CIRCULAR_CACHE_MODE: False
  #     ZIP_MODE: False
  #     CACHE_ORIGIN_IMAGE: False
  #     RANDOM_CAPTION: False
  #     AS_NUMPY_AS_POSSIBLE: False
  #     SAMPLING_WEIGHT: 0.8780
  #     TRANSFORM: 'clip_transforms'
  #   MODEL:
  #     MAX_SEQ_LEN: 50
  #     TEMP_NAME: logit_scale_caption
  #   LOSSES:
  #     NAMES: ['CrossEntropy', 'Accuracy']
  #     LOSS_WEIGHT: 0.33333
  #     REDUCTION: 'mean'
  #   INFERENCE:
  #     VOCAB: 'CLIP'
  #     GENERATION_MODE: False

  # -
  #   NAME: vg_caption
  #   DATASETS:
  #     TRAIN: 'ImageTextPairDataset'
  #     TASK_TYPE: 'image_caption'
  #     DATASET_NAME: 'VG'
  #     TARGET_SET: ['Vocab_Word']
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 300
  #     TEST_BATCH_SIZE: 32
  #     NUM_WORKERS: 2
  #     FEATS_FOLDER: 'open_source_dataset/visual_genome/images'
  #     ANNO_FOLDER:  'open_source_dataset/visual_genome/annotations'
  #     S3_PATH: 's3://visual_genome/images'
  #     ANNO_FILENAME: 'vg_captions_128filter.json'
  #     SEQ_PER_SAMPLE:  1
  #     CACHE_MODE: True
  #     CIRCULAR_CACHE_MODE: False
  #     ZIP_MODE: False
  #     CACHE_ORIGIN_IMAGE: False
  #     RANDOM_CAPTION: False
  #     AS_NUMPY_AS_POSSIBLE: False
  #     SAMPLING_WEIGHT: 0.5895
  #     TRANSFORM: 'clip_transforms'
  #   MODEL:
  #     MAX_SEQ_LEN: 30
  #     TEMP_NAME: logit_scale_caption
  #   LOSSES:
  #     NAMES: ['CrossEntropy', 'Accuracy']
  #     LOSS_WEIGHT: 0.33333
  #     REDUCTION: 'mean'
  #   INFERENCE:
  #     VOCAB: 'CLIP'
  #     GENERATION_MODE: True
  
  -
    NAME: mscoco_caption
    DATASETS:
      TRAIN: 'ImageTextPairDataset'
      # VAL: 'ImageTextPairDataset'
      TEST: 'ImageTextPairDataset'
      TASK_TYPE: 'image_caption'
      DATASET_NAME: 'MSCOCO'
      TARGET_SET: ['Vocab_Word']
    DATALOADER:
      TRAIN_BATCH_SIZE: 32
      TEST_BATCH_SIZE: 2
      NUM_WORKERS: 4
      FEATS_FOLDER: 'open_source_dataset/mscoco_dataset/coco_origin'
      ANNO_FOLDER:  'open_source_dataset/mscoco_dataset/new_annotations'
      S3_PATH: 's3://coco/'
      SEQ_PER_SAMPLE:  1
      CACHE_MODE: True
      CIRCULAR_CACHE_MODE: False
      ZIP_MODE: False
      CACHE_ORIGIN_IMAGE: False
      RANDOM_CAPTION: False
      AS_NUMPY_AS_POSSIBLE: False
      SAMPLING_WEIGHT: 0.3817
      TRANSFORM: 'clip_transforms'
      RANDOM_MASK: True
    MODEL:
      MAX_SEQ_LEN: 50
      EVAL_MAX_SEQ_LEN: 21
      TEMP_NAME: logit_scale_caption
    LOSSES:
      NAMES: ['CrossEntropy', 'Accuracy']
      LOSS_WEIGHT: 0.33333
      REDUCTION: 'mean'
    DECODE_STRATEGY:
      NAME: 'CaptionBeamSearcherV3'
      BEAM_SIZE: 2
      # LEN_PENALTY: 2.0
    INFERENCE:
      NAME: 'COCOEvaler'
      VOCAB: 'CLIP'
      ID_KEY: 'image_id'
      VALUE: 'caption'
      VAL_ANNFILE: 'open_source_dataset/mscoco_dataset/new_annotations/captions_val5k.json'
      TEST_ANNFILE: 'open_source_dataset/mscoco_dataset/new_annotations/captions_test5k.json'
      GENERATION_MODE: True

  # -
  #   NAME: sbu_caption
  #   DATASETS:
  #     TRAIN: 'ImageTextPairDataset'
  #     TASK_TYPE: 'image_caption'
  #     DATASET_NAME: 'SBU'
  #     TARGET_SET: ['Vocab_Word']
  #   DATALOADER:
  #     TRAIN_BATCH_SIZE: 300
  #     TEST_BATCH_SIZE: 32
  #     NUM_WORKERS: 1
  #     S3_ANNO_FOLDER: 's3://SBU/annotations'
      # ANNO_FOLDER: 'open_source_dataset/sbucaption/annotations'
  #     ANNO_FILENAME: 'subcaption.json'
  #     FEATS_FOLDER: 'open_source_dataset/sbucaption/'
  #     S3_PATH: 's3://SBU/images'
  #     SEQ_PER_SAMPLE:  1
  #     SAMPLER: NodeDistributed
  #     CACHE_MODE: True
  #     CIRCULAR_CACHE_MODE: False
  #     ZIP_MODE: False
  #     CACHE_ORIGIN_IMAGE: False
  #     RANDOM_CAPTION: False
  #     AS_NUMPY_AS_POSSIBLE: False
  #     SAMPLING_WEIGHT: 0.4618
  #     TRANSFORM: 'clip_transforms'
  #   MODEL:
  #     MAX_SEQ_LEN: 50
  #     TEMP_NAME: logit_scale_caption
  #   LOSSES:
  #     NAMES: ['CrossEntropy', 'Accuracy']
  #     LOSS_WEIGHT: 0.33333
  #     REDUCTION: 'mean'
  #   INFERENCE:
  #     VOCAB: 'CLIP'
  #     GENERATION_MODE: False


ENGINE:
  NAME: 'UnifiedTrainer'
 
MODEL:
  META_ARCHITECTURE: 'MultiTaskTransformerEncoder'
  ENCODER: 'UnifiedBertEncoder'

  IN_TUNING: True # use IN1k instead of 22k
  SHARE_LAYERNORM: True
  BERT:
    NORMALIZE_DECISION: "BERTPre" 
    DROP_PATH_PROB: 0.0
    DROP_PATH_PROB_FIXED: True

  MODEL_EMA: False
  MODEL_EMA_DECAY: 0.9999

  MAEParamsInit: True
  POSEMBEDFIX: True


  IMG_INPUT_SIZE: 224
  PATCH_SIZE: 16

  LAYER_SCALE: True 
  LAYER_SCALE_INIT: 1e-3


  LAYER_SCALE_FP32: True
  GATE_FP32: False
  TAG_TRANSFORM_FP32: False


DATALOADER:
  USE_WEIGHTED_SAMPLER: True
  UNIFIED_DATASET: True 
  NUM_WORKERS: 32
  STRATEGY: 'turn'

  PADDING_TO_MAX: False # True for debugging or token moe with distributed moe 


  
####################################### Optimizer #######################################
SOLVER:
  NAME: 'Adam'
  TORCH_OPTIMIZER: True
  PARAMS_SEPERATE: True
  # PARAMS_GROUP: True
  # EPOCH: 1
  MAX_ITER: 150000
  CHECKPOINT_PERIOD: 5000
  EVAL_PERIOD: 500000
  BASE_LR: 0.001
  BIAS_LR_FACTOR: 1.0
  WEIGHT_DECAY: 0.05
  WEIGHT_DECAY_NORM: 0.0
  WEIGHT_DECAY_BIAS: 0.0
  WEIGHT_DECAY_EMBEDDING: 0.0
  MOMENTUM: 0.9
  DAMPENING: 0.0
  NESTEROV: 0.0
  BETAS: [0.9, 0.95]
  EPS: 1e-6
  GRAD_CLIP: 0.1
  GRAD_CLIP_TYPE: 'norm'
  ACCUM_ITER: 0
  AMP_FP16: True
  APEX_FP16: False # dangerous

  WRITE_PERIOD: 50
  MIN_LOSS_SCLE: 2048.0
  # BF16: False # True
  # ZEROSTAGE: 2

  LOSS_SCALE_WINDOW: 200



  FORCE_SOFTMAX_FP16: True
  FORCE_LN_FP16: True
  FORCE_NORM_FP16: True
  # FORCE_TEMP_FP16: True
  FORCE_EMBED_FP16: True





  
####################################### lr scheduler ####################################### 
LR_SCHEDULER:
  NAME: 'WarmupCosine'
  WARMUP: 5000
  MIN_LR: 0.000001




####################################### evaluation ####################################### 
INFERENCE:

  VOCAB: 'CLIP'
  ITER_BASED: True


find_unused_parameters: true

# ENCODERS:
#   -
#     NAME: VisualEncoder
#     TYPE: VisualEncoder
#     DROP_PATH_PROB: 0.0
#     HIDDEN_SIZE: 192
#     HIDDEN_DROPOUT_PROB: 0.
#     HIDDEN_ACT: "gelu"
#     NUM_ATTENTION_HEADS: 3
#     INTERMEDIATE_SIZE: 768
#     INTERMEDIATE_DROP: 0.
#     FFN_DROPOUT_PROB: 0.
#     ATTENTION_PROBS_DROPOUT_PROB: 0.
#     NUM_HIDDEN_LAYERS: 6
#     NUM_GENERATION_LAYERS: 0
#     DROP_PATH_PROB_FIXED: True

#   -
#     NAME: TextEncoder
#     TYPE: TextEncoder
#     DROP_PATH_PROB: 0.0
#     HIDDEN_SIZE: 192
#     HIDDEN_DROPOUT_PROB: 0.
#     HIDDEN_ACT: "gelu"
#     NUM_ATTENTION_HEADS: 3
#     INTERMEDIATE_SIZE: 768
#     INTERMEDIATE_DROP: 0.
#     FFN_DROPOUT_PROB: 0.
#     ATTENTION_PROBS_DROPOUT_PROB: 0.
#     NUM_HIDDEN_LAYERS: 6
#     NUM_GENERATION_LAYERS: 0
#     DROP_PATH_PROB_FIXED: True 

MOE: 
  MOE: True 
  MOE_TYPE: 'attribute'
  TAG_Transform: True
  ATTRIBUTE_LENGTH: 8
  EP_WORLD_SIZE: 1 # tag moe only 
  NUM_EXPERTS: 8
  TOP_K: 2
  CAPACITY_FACTOR: 3.0 
  EVAL_MIN_CAPACITY: 4.0
  MIN_CAPACITY: 4
  NOISY_GATE_POLICY: 'vmoe'
  MOE_PARAM_GROUP: True 
  MOE_EXPERT_TYPE: 'FFN,SA'
  SA_LINEAR_OUT_MOE: True
  MOE_EXPERT_LOCATION: 'all' # 'odd'
  # MOE_LAYER_START_IDX: 3
  # MOE_LAYER_END_IDX: 21
  # MOE_LAYER_START_IDX: 18
  # MOE_LAYER_END_IDX: 12 
  BATCH_PRIO: True 
  USE_TUTEL: True
  FFN_SHARE_GATE_DECISION: True