MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / distributed_init

Function distributed_init

test/debug_deepspeed_init.py:27–37  ·  view source on GitHub ↗

Initialize distributed training environment.

(args)

Source from the content-addressed store, hash-verified

25
26
27def distributed_init(args):
28 """Initialize distributed training environment."""
29 world_size = int(os.getenv('WORLD_SIZE', '1'))
30 rank = int(os.getenv('RANK', '0'))
31 local_rank = args.local_rank
32
33 # Set environment variables for distributed training
34 os.environ['MASTER_ADDR'] = os.getenv('MASTER_ADDR', 'localhost')
35 os.environ['MASTER_PORT'] = str(args.master_port)
36
37 return world_size, rank, local_rank
38
39
40if __name__ == '__main__':

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected