-
Notifications
You must be signed in to change notification settings - Fork 1
/
arguments.py
54 lines (40 loc) · 2.33 KB
/
arguments.py
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
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--input_dir', default=".", type = str,
help = 'Input data dir' )
parser.add_argument('--train_file',default = 'train_processed.pkl', type=str)
parser.add_argument('--val_file',default = 'val_processed.pkl', type=str)
parser.add_argument('--output_dir', default=".", type = str,
help = 'Input data dir' )
parser.add_argument('--lr', default=2E-5, type = float, required= False,
help = 'Learning Rate')
parser.add_argument('--epochs', default=1, type = int, required=False,
help = 'Number of epochs' )
parser.add_argument('--per_gpu_batch_size',default= 32, type = int )
parser.add_argument('--val_batch_size',default= 64, type = int )
parser.add_argument('--model_type', default = 'mul', type = str,
help = 'Model type from concat, mul or segment')
parser.add_argument('--bert_type', default = 'bert-base-uncased', type = str,
help = 'Bert model type')
parser.add_argument('--gradient_accumulation', default = None, type = int) #not used
parser.add_argument('--sample_limit', default = None, type = int)
#DDP arguments
parser.add_argument('--is_distributed', action='store_true')
parser.add_argument('--world_size', default = None, type = int, help = 'Total number of processes') #needed for spawn to
parser.add_argument('--backend', default = 'gloo', type = str)
parser.add_argument('--master_node', default = 'localhost', type = str)
parser.add_argument('--master_port', default = 12533, type = int)
#SPAWN arguemtns
parser.add_argument('--nprocs', default = 1, type = int, help = 'Number of processes to spawn')
parser.add_argument('--start_rank', default = 0, type = int, help = 'starting rank for this node')
#Explicit
parser.add_argument('--local_rank', default = -1, type = int) #also passed in torch.distrib.launch
parser.add_argument('--global_rank', default = None, type = int)
#horovod
parser.add_argument('--use_horovod', action="store_true", default=False)
#fp16
# https://nvidia.github.io/apex/amp.html
parser.add_argument('--fp16', action="store_true", default=False)
parser.add_argument('--amp_opt_level', default="01", type = str)##00 is FP32
#AML
parser.add_argument('--isaml', action="store_true", default=False) #required for logging into portal