MCPcopy
hub / github.com/deepspeedai/DeepSpeed / _create_checkpoint_file

Method _create_checkpoint_file

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

Source from the content-addressed store, hash-verified

4415 self.checkpoint_engine.save(saveable_state_dict, save_path)
4416
4417 def _create_checkpoint_file(self, save_dir, tag, zero_checkpoint):
4418 name_function = (self._get_zero_ckpt_name if zero_checkpoint else self._get_ckpt_name)
4419 try:
4420 checkpoint_name = name_function(save_dir, tag)
4421 path = os.path.dirname(checkpoint_name)
4422 self.checkpoint_engine.makedirs(path, exist_ok=True)
4423 except Exception:
4424 logger.error(f"Failed saving model checkpoint to {save_dir} with tag {tag}")
4425 return False
4426
4427 return True
4428
4429 def _create_zero_checkpoint_files(self, save_dir, tag):
4430 success = True

Callers 2

save_checkpointMethod · 0.95

Calls 1

makedirsMethod · 0.80

Tested by

no test coverage detected