MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / init_distributed_mode_ssc

Function init_distributed_mode_ssc

util/misc.py:542–551  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

540 torch.save(*args, **kwargs)
541
542def init_distributed_mode_ssc(args):
543 init_dist('pytorch')
544 args.rank, args.world_size = get_dist_info()
545 args.local_rank = args.gpu = int(os.environ['LOCAL_RANK']) # args.rank % world_size
546 args.distributed = True
547 torch.cuda.set_device(args.local_rank)
548 print("Before torch.distributed.barrier()")
549 torch.distributed.barrier()
550 print("End torch.distributed.barrier()")
551 setup_for_distributed(args.rank == 0)
552
553def init_distributed_mode(args):
554 if 'WORLD_SIZE' in os.environ and os.environ['WORLD_SIZE'] != '':

Callers

nothing calls this directly

Calls 2

printFunction · 0.70
setup_for_distributedFunction · 0.70

Tested by

no test coverage detected