Shortcuts

AsyncCheckpointIO

class pytorch_lightning.plugins.io.AsyncCheckpointIO(checkpoint_io=None)[source]

Bases: pytorch_lightning.plugins.io.wrapper._WrappingCheckpointIO

AsyncCheckpointIO enables saving the checkpoints asynchronously in a thread.

Warning

This is currently an experimental plugin/feature and API changes are to be expected.

Parameters:

checkpoint_io (Optional[CheckpointIO]) – A checkpoint IO plugin that is used as the basis for async checkpointing.

save_checkpoint(*args, **kwargs)[source]

Uses the ThreadPoolExecutor to save the checkpoints using the base checkpoint_io.

Return type:

None

teardown()[source]

This method is called to close the threads.

Return type:

None