| | |
| | | args = build_args(args, parser, extra_task_params) |
| | | |
| | | if args.local_rank is not None: |
| | | args.distributed = True |
| | | args.simple_ddp = True |
| | | distributed = True |
| | | else: |
| | | args.distributed = False |
| | | args.ngpu = 1 |
| | | distributed = False |
| | | args.local_rank = args.local_rank if args.local_rank is not None else 0 |
| | | local_rank = args.local_rank |
| | | if "CUDA_VISIBLE_DEVICES" in os.environ.keys(): |
| | |
| | | args.batch_type = "length" |
| | | args.oss_bucket = None |
| | | args.input_size = None |
| | | if distributed: |
| | | args.distributed = True |
| | | args.simple_ddp = True |
| | | else: |
| | | args.distributed = False |
| | | args.ngpu = 1 |
| | | if optim is not None: |
| | | args.optim = optim |
| | | if lr is not None: |
| | |
| | | if batch_bins is not None: |
| | | if args.dataset_type == "small": |
| | | args.batch_bins = batch_bins |
| | | args.dataset_conf["batch_conf"]["batch_size"] = batch_bins |
| | | elif args.dataset_type == "large": |
| | | args.dataset_conf["batch_conf"]["batch_size"] = batch_bins |
| | | else: |
| | |
| | | torch.backends.cudnn.deterministic = args.cudnn_deterministic |
| | | |
| | | # ddp init |
| | | os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_id) |
| | | args.distributed = args.ngpu > 1 or args.dist_world_size > 1 |
| | | distributed_option = build_distributed(args) |
| | | |
| | | # for logging |