Fix examples

This commit is contained in:
allegroai
2020-08-27 15:00:42 +03:00
parent 838c9cb0d2
commit 0d533e9013
6 changed files with 95 additions and 94 deletions

View File

@@ -154,6 +154,10 @@ if __name__ == "__main__":
# otherwise, the `rank` will always be set to the original value.
task = Task.init("examples", "test torch distributed", auto_connect_arg_parser={'rank': False})
if not dist.is_available():
print("torch.distributed is not supported for this platform")
exit(0)
if os.environ.get('MASTER_ADDR'):
dist.init_process_group(backend='gloo', rank=args.rank, world_size=args.nodes)
run(args.workers_in_node)