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

Method ckpt_layer_path

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

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. """

Callers 1

save_state_dictMethod · 0.95

Calls 1

get_rank_reprMethod · 0.80

Tested by

no test coverage detected