Created
December 8, 2019 01:07
-
-
Save giacaglia/a61f8fc02a3c1d2bb4393bbbc0c7be8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-n', '--nodes', default=1, | |
type=int, metavar='N') | |
parser.add_argument('-g', '--gpus', default=1, type=int, | |
help='number of gpus per node') | |
parser.add_argument('-nr', '--nr', default=0, type=int, | |
help='ranking within the nodes') | |
parser.add_argument('--epochs', default=2, type=int, | |
metavar='N', | |
help='number of total epochs to run') | |
args = parser.parse_args() | |
######################################################### | |
args.world_size = args.gpus * args.nodes # | |
os.environ['MASTER_ADDR'] = '10.57.23.164' # | |
os.environ['MASTER_PORT'] = '8888' # | |
mp.spawn(train, nprocs=args.gpus, args=(args,)) # | |
######################################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment