Unverified Commit 1a4c0240 authored by mohammad minooei's avatar mohammad minooei Committed by GitHub
Browse files

check MASTER_ADDR in the environment variable before assignment (#705)



* check MASTER_ADDR in the environment variable before assignment

* Update dist_utils.py

use MASTER_ADDR in the environment variable if it already exists
Co-authored-by: default avatarmohammad <minooee@vas24.ir>
parent afc35f13
......@@ -64,7 +64,9 @@ def _init_dist_slurm(backend, port=None):
else:
# 29500 is torch.distributed default port
os.environ['MASTER_PORT'] = '29500'
os.environ['MASTER_ADDR'] = addr
# use MASTER_ADDR in the environment variable if it already exists
if 'MASTER_ADDR' not in os.environ:
os.environ['MASTER_ADDR'] = addr
os.environ['WORLD_SIZE'] = str(ntasks)
os.environ['LOCAL_RANK'] = str(proc_id % num_gpus)
os.environ['RANK'] = str(proc_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment