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

Method _create_checkpoint_file

deepspeed/runtime/engine.py:5140–5150  ·  view source on GitHub ↗
(self, save_dir, tag, zero_checkpoint)

Source from the content-addressed store, hash-verified

5138 self.checkpoint_engine.save(saveable_state_dict, save_path)
5139
5140 def _create_checkpoint_file(self, save_dir, tag, zero_checkpoint):
5141 name_function = (self._get_zero_ckpt_name if zero_checkpoint else self._get_ckpt_name)
5142 try:
5143 checkpoint_name = name_function(save_dir, tag)
5144 path = os.path.dirname(checkpoint_name)
5145 self.checkpoint_engine.makedirs(path, exist_ok=True)
5146 except OSError:
5147 logger.error(f"Failed saving model checkpoint to {save_dir} with tag {tag}")
5148 return False
5149
5150 return True
5151
5152 def _create_zero_checkpoint_files(self, save_dir, tag):
5153 success = True

Callers 2

save_checkpointMethod · 0.95

Calls 1

makedirsMethod · 0.80

Tested by

no test coverage detected