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

Method module_state_dict

deepspeed/runtime/pipe/engine.py:1240–1255  ·  view source on GitHub ↗

Override hack to save a pipe model and return the directory path of the save. This method should only be called by DeepSpeed's ``save_checkpoint()``. The recommended way of saving a ``PipelineModule`` outside of ``save_checkpoint()`` is ``save_state_dict()``. Return

(self)

Source from the content-addressed store, hash-verified

1238 f'current cache={new_cached:0.4f}GB (delta={delta_cached:0.4f}GB max={max_cached:0.4f}GB)')
1239
1240 def module_state_dict(self):
1241 """Override hack to save a pipe model and return the directory path of the save.
1242
1243 This method should only be called by DeepSpeed's ``save_checkpoint()``. The
1244 recommended way of saving a ``PipelineModule`` outside of ``save_checkpoint()``
1245 is ``save_state_dict()``.
1246
1247 Returns:
1248 None
1249 """
1250 assert isinstance(self.module, PipelineModule)
1251 assert self._curr_ckpt_path is not None, \
1252 "PipelineEngine expects module_state_dict() to be called from save_checkpoint()"
1253
1254 self.module.save_state_dict(self._curr_ckpt_path, checkpoint_engine=self.checkpoint_engine)
1255 return None
1256
1257 def load_module_state_dict(self, checkpoint, strict=True, custom_load_fn=None):
1258 """Override hack to instead use a directory path.

Callers

nothing calls this directly

Calls 1

save_state_dictMethod · 0.80

Tested by

no test coverage detected