Starts a save to the given directories. The writes may happen in the background and not finish until wait_until_finished(). Storage implementations should invoke on_commit_callback(ckpt_dir, commit_data) when async write has completed.
(
self,
*,
step: int,
state: NestedTensor,
ckpt_dir: str,
on_commit_callback: StateStorageCommitCallback,
)
| 312 | """Base StateStorage.""" |
| 313 | |
| 314 | def save_to_dir( |
| 315 | self, |
| 316 | *, |
| 317 | step: int, |
| 318 | state: NestedTensor, |
| 319 | ckpt_dir: str, |
| 320 | on_commit_callback: StateStorageCommitCallback, |
| 321 | ): |
| 322 | """Starts a save to the given directories. |
| 323 | |
| 324 | The writes may happen in the background and not finish until wait_until_finished(). |
| 325 | Storage implementations should invoke on_commit_callback(ckpt_dir, commit_data) when async |
| 326 | write has completed. |
| 327 | """ |
| 328 | raise NotImplementedError(type(self)) |
| 329 | |
| 330 | def wait_until_finished(self): |
| 331 | """Waits for async writes to finish.""" |
no outgoing calls