MCPcopy Create free account
hub / github.com/OpenTalker/StyleHEAT / init_dist

Function init_dist

utils/distributed.py:6–12  ·  view source on GitHub ↗

r"""Initialize distributed training

(local_rank, backend='nccl', **kwargs)

Source from the content-addressed store, hash-verified

4
5
6def init_dist(local_rank, backend='nccl', **kwargs):
7 r"""Initialize distributed training"""
8 if dist.is_available():
9 if dist.is_initialized():
10 return torch.cuda.current_device()
11 torch.cuda.set_device(local_rank)
12 dist.init_process_group(backend=backend, init_method='env://', **kwargs)
13
14
15def get_rank():

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected