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

Method _create_checkpoint_file

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

Source from the content-addressed store, hash-verified

5457 self.checkpoint_engine.save(saveable_state_dict, save_path)
5458
5459 def _create_checkpoint_file(self, save_dir, tag, zero_checkpoint):
5460 name_function = (self._get_zero_ckpt_name if zero_checkpoint else self._get_ckpt_name)
5461 try:
5462 checkpoint_name = name_function(save_dir, tag)
5463 path = os.path.dirname(checkpoint_name)
5464 self.checkpoint_engine.makedirs(path, exist_ok=True)
5465 except OSError:
5466 logger.error(f"Failed saving model checkpoint to {save_dir} with tag {tag}")
5467 return False
5468
5469 return True
5470
5471 def _create_zero_checkpoint_files(self, save_dir, tag):
5472 success = True

Callers 2

save_checkpointMethod · 0.95

Calls 1

makedirsMethod · 0.80

Tested by

no test coverage detected