Browse Source

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

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

5
colossalai/initialize.py

@ -45,7 +45,10 @@ def launch(
backend = cur_accelerator.communication_backend backend = cur_accelerator.communication_backend
# init default process group # 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) dist.init_process_group(rank=rank, world_size=world_size, backend=backend, init_method=init_method)
# set cuda device # set cuda device

Loading…
Cancel
Save