MCPcopy Create free account
hub / github.com/togethercomputer/OpenChatKit / default_init

Function default_init

training/comm/comm_utils.py:68–81  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

66
67
68def default_init(args):
69 import datetime
70 import time
71 try:
72 dist.destroy_process_group()
73 # the first time will raise exception, so the following code is skipped.
74 print('destroy comm, increase port for 1. (this could cause problem)')
75 url = ':'.join(args.dist_url.split(':')[:-1])
76 port = int(args.dist_url.split(':')[-1]) + 1
77 args.dist_url = f"{url}:{port}"
78 print(f"new master url: {args.dist_url}")
79 except:
80 pass
81 dist.init_process_group(backend='gloo', timeout=datetime.timedelta(seconds=5*60), init_method=args.dist_url, world_size=args.world_size, rank=args.rank)
82
83
84def init_communicators(args):

Callers 2

init_communicatorsFunction · 0.85
reinit_dp_communicatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected