ray.train.lightning.LightningConfigBuilder.checkpointing#

LightningConfigBuilder.checkpointing(**kwargs) ray.train.lightning.lightning_trainer.LightningConfigBuilder[source]#

Set up the configurations of pytorch_lightning.callbacks.ModelCheckpoint.

LightningTrainer creates a subclass instance of the ModelCheckpoint callback with the kwargs. It handles checkpointing and metrics logging logics.

Specifically, the callback periodically reports the latest metrics and checkpoint via ray.train.report(). The report frequency matches the checkpointing frequency here. You have to make sure that the target metrics (e.g. metrics defined in TuneConfig or CheckpointConfig) are ready when a new checkpoint is being saved.

Note that this method is not a replacement for the ray.train.CheckpointConfig. You still need to specify your checkpointing strategy in CheckpointConfig. Otherwise, AIR stores all the reported checkpoints by default.

Parameters

kwargs – For valid arguments to pass, please refer to: https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.callbacks.ModelCheckpoint.html