[launch] Support IPv4 host initialization in launch (#5822)

pull/5835/head
Kai Lv 5 months ago committed by GitHub
parent 639394b0d4
commit 0adca5b688
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,7 +45,10 @@ def launch(
backend = cur_accelerator.communication_backend
# init default process group
init_method = f"tcp://[{host}]:{port}"
if ":" in host: # IPv6
init_method = f"tcp://[{host}]:{port}"
else: # IPv4
init_method = f"tcp://{host}:{port}"
dist.init_process_group(rank=rank, world_size=world_size, backend=backend, init_method=init_method)
# set cuda device

Loading…
Cancel
Save