MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / ckpt_prefix

Method ckpt_prefix

deepspeed/runtime/pipe/module.py:512–526  ·  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

510 return self._topo.get_dim('pipe')
511
512 def ckpt_prefix(self, checkpoints_path, tag):
513 """Build a prefix for all checkpoint files written by this module. """
514 # All checkpoint files start with this
515 rank_name = 'module'
516
517 # Data parallelism is omitted from the naming convention because we are agnostic
518 # to this in the checkpoint.
519 omit_dims = frozenset(['data'])
520 axes = [a for a in self._grid._topo.get_axis_names() if a not in omit_dims]
521 for dim in axes:
522 rank = getattr(self._grid._topo.get_coord(rank=self.global_rank), dim)
523 rank_name += f'-{dim}_{rank:02d}'
524
525 ckpt_name = os.path.join(checkpoints_path, str(tag), rank_name)
526 return ckpt_name
527
528 def ckpt_layer_path(self, ckpt_dir, local_layer_idx):
529 """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