Skip to content
Snippets Groups Projects
Commit 303b95ce authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Better distributed init

Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/615

Differential Revision: D14933742

Pulled By: myleott

fbshipit-source-id: c2c20425875743c89bbc2ac564a2fbb6ff4958b2
parent de8aeab5
No related branches found
No related tags found
No related merge requests found
......@@ -29,10 +29,7 @@ def infer_init_method(args):
if all(key in os.environ for key in [
'MASTER_ADDR', 'MASTER_PORT', 'WORLD_SIZE', 'RANK'
]):
args.distributed_init_method = 'tcp://{addr}:{port}'.format(
addr=os.environ['MASTER_ADDR'],
port=os.environ['MASTER_PORT'],
)
args.distributed_init_method = 'env://'
args.distributed_world_size = int(os.environ['WORLD_SIZE'])
args.distributed_rank = int(os.environ['RANK'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment