MCPcopy Create free account
hub / github.com/MoonshotAI/checkpoint-engine / init_process_group

Method init_process_group

checkpoint_engine/ps.py:502–523  ·  view source on GitHub ↗

Initialize the process group for the ranks. This global group can be easily destroyed by calling dist.destroy_process_group. Args: master_port: The specified port of the master node. If not set, will use _get_master_port to get the port. timeout: The timeout

(
        self,
        *,
        timeout: timedelta = timedelta(minutes=10),
    )

Source from the content-addressed store, hash-verified

500 )
501
502 def init_process_group(
503 self,
504 *,
505 timeout: timedelta = timedelta(minutes=10),
506 ):
507 """
508 Initialize the process group for the ranks. This global group can be easily destroyed by calling dist.destroy_process_group.
509
510 Args:
511 master_port: The specified port of the master node. If not set, will use _get_master_port to get the port.
512 timeout: The timeout of the process group.
513 """
514 self._store_counter += 1
515 sub_store = torch.distributed.PrefixStore(f"prefix-{self._store_counter}", self._store)
516 dist.init_process_group(
517 backend=self.device_manager.backend,
518 world_size=self._world_size,
519 rank=self._rank,
520 timeout=timeout,
521 store=sub_store,
522 )
523 logger.info(f"[rank{self._rank}] init process group successfully.")
524
525 def store_based_barrier(self, timeout: timedelta = timedelta(minutes=5)) -> None:
526 """

Callers 4

gather_metasMethod · 0.95
updateMethod · 0.95
update_weightsFunction · 0.45
joinFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected