MCPcopy Create free account
hub / github.com/apple/axlearn / save_to_dir

Method save_to_dir

axlearn/common/checkpointer.py:314–328  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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."""

Callers 6

saveMethod · 0.45
_build_ckptMethod · 0.45
test_buildMethod · 0.45
saveMethod · 0.45

Calls

no outgoing calls

Tested by 5

_build_ckptMethod · 0.36
test_buildMethod · 0.36
saveMethod · 0.36