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

Method ckpt_layer_path

deepspeed/runtime/pipe/module.py:583–591  ·  view source on GitHub ↗

Customize a prefix for a specific pipeline module layer.

(self, ckpt_dir, local_layer_idx)

Source from the content-addressed store, hash-verified

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. """
585 idx = local_layer_idx + self._local_start
586 layer_ckpt_path = os.path.join(ckpt_dir, f'layer_{idx:02d}')
587 rank_repr = self._grid._topo.get_rank_repr(rank=self.global_rank)
588 if rank_repr != '':
589 layer_ckpt_path += f'-{rank_repr}'
590 layer_ckpt_path += '-model_states.pt'
591 return layer_ckpt_path
592
593 def ckpt_layer_path_list(self, ckpt_dir, local_layer_idx):
594 """Get all ckpt file list for a specific pipeline module layer. """

Callers 1

save_state_dictMethod · 0.95

Calls 1

get_rank_reprMethod · 0.80

Tested by

no test coverage detected