MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / ckpt_prefix

Method ckpt_prefix

deepspeed/runtime/pipe/module.py:567–581  ·  view source on GitHub ↗

Build a prefix for all checkpoint files written by this module.

(self, checkpoints_path, tag)

Source from the content-addressed store, hash-verified

565 return self._topo.get_dim('pipe')
566
567 def ckpt_prefix(self, checkpoints_path, tag):
568 """Build a prefix for all checkpoint files written by this module. """
569 # All checkpoint files start with this
570 rank_name = 'module'
571
572 # Data parallelism is omitted from the naming convention because we are agnostic
573 # to this in the checkpoint.
574 omit_dims = frozenset(['data'])
575 axes = [a for a in self._grid._topo.get_axis_names() if a not in omit_dims]
576 for dim in axes:
577 rank = getattr(self._grid._topo.get_coord(rank=self.global_rank), dim)
578 rank_name += f'-{dim}_{rank:02d}'
579
580 ckpt_name = os.path.join(checkpoints_path, str(tag), rank_name)
581 return ckpt_name
582
583 def ckpt_layer_path(self, ckpt_dir, local_layer_idx):
584 """Customize a prefix for a specific pipeline module layer. """

Callers

nothing calls this directly

Calls 2

get_axis_namesMethod · 0.80
get_coordMethod · 0.80

Tested by

no test coverage detected