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, exclude_frozen_parameters=False)
| 1297 | raise PipelineError("Only train_batch() is accessible in pipeline mode.") |
| 1298 | |
| 1299 | def module_state_dict(self, exclude_frozen_parameters=False): |
| 1300 | """Override hack to save a pipe model and return the directory path of the save. |
| 1301 | |
| 1302 | This method should only be called by DeepSpeed's ``save_checkpoint()``. The |
| 1303 | recommended way of saving a ``PipelineModule`` outside of ``save_checkpoint()`` |
| 1304 | is ``save_state_dict()``. |
| 1305 | |
| 1306 | Returns: |
| 1307 | None |
| 1308 | """ |
| 1309 | assert isinstance(self.module, PipelineModule) |
| 1310 | assert self._curr_ckpt_path is not None, \ |
| 1311 | "PipelineEngine expects module_state_dict() to be called from save_checkpoint()" |
| 1312 | |
| 1313 | self.module.save_state_dict(self._curr_ckpt_path, |
| 1314 | checkpoint_engine=self.checkpoint_engine, |
| 1315 | exclude_frozen_params=exclude_frozen_parameters) |
| 1316 | return None |
| 1317 | |
| 1318 | def load_module_state_dict(self, |
| 1319 | checkpoint, |
nothing calls this directly
no test coverage detected