Customize a prefix for a specific pipeline module layer.
(self, ckpt_dir, local_layer_idx)
| 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. """ |
| 530 | idx = local_layer_idx + self._local_start |
| 531 | layer_ckpt_path = os.path.join(ckpt_dir, f'layer_{idx:02d}') |
| 532 | rank_repr = self._grid._topo.get_rank_repr(rank=self.global_rank) |
| 533 | if rank_repr != '': |
| 534 | layer_ckpt_path += f'-{rank_repr}' |
| 535 | layer_ckpt_path += '-model_states.pt' |
| 536 | return layer_ckpt_path |
| 537 | |
| 538 | def ckpt_layer_path_list(self, ckpt_dir, local_layer_idx): |
| 539 | """Get all ckpt file list for a specific pipeline module layer. """ |
no test coverage detected