MCPcopy Create free account
hub / github.com/modelscope/modelscope / _init_dist_pytorch

Function _init_dist_pytorch

modelscope/utils/torch_utils.py:65–69  ·  view source on GitHub ↗
(backend: str, **kwargs)

Source from the content-addressed store, hash-verified

63
64
65def _init_dist_pytorch(backend: str, **kwargs) -> None:
66 # rank = int(os.environ['RANK'])
67 local_rank = int(os.environ['LOCAL_RANK'])
68 torch.cuda.set_device(local_rank)
69 dist.init_process_group(backend=backend, **kwargs)
70
71
72def _init_dist_mpi(backend: str, **kwargs) -> None:

Callers 1

init_distFunction · 0.85

Calls 1

set_deviceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…