Build a prefix for all checkpoint files written by this module.
(self, checkpoints_path, tag)
| 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. """ |
nothing calls this directly
no test coverage detected