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