[hotfix] Fixing the bug related to ipv6 support

Co-authored-by: ByteDance <tongping.liu@bytedance.com>
This commit is contained in:
Tongping Liu 2022-12-26 23:42:46 -05:00 committed by GitHub
parent ac85a18043
commit 8e22c38b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,7 +370,7 @@ class ParallelContext(metaclass=SingletonMeta):
port (str): the master port for distributed training
"""
# initialize the default process group
init_method = f'tcp://{host}:{port}'
init_method = f'tcp://[{host}]:{port}'
dist.init_process_group(rank=rank, world_size=world_size, backend=backend, init_method=init_method)
# None will give the default global process group for pytorch dist operations