RayTrainReportCallback#

class ray.train.lightning.RayTrainReportCallback(*args: Any, **kwargs: Any)[source]#

Bases: Callback

A simple callback that reports checkpoints to Ray on train epoch end.

This callback is a subclass of lightning.pytorch.callbacks.Callback.

It fetches the latest trainer.callback_metrics and reports together with the checkpoint on each training epoch end.

Checkpoints will be saved in the following structure:

checkpoint_00000*/      Ray Train Checkpoint
└─ checkpoint.ckpt      PyTorch Lightning Checkpoint

You can also provide the following arguments to the callback:

  • checkpoint_upload_mode: The manner in which to upload the checkpoint.

    See Checkpoint upload modes for more details.

  • validation: Whether to asynchronously validate the checkpoint.

    See Validating checkpoints asynchronously for more details.

  • checkpoint_frequency: Only report a checkpoint and metrics every

    checkpoint_frequency. Defaults to 1, which is checkpoints on every epoch. If max_epochs is not a multiple of checkpoint_frequency, it will not be reported.

For customized reporting and checkpointing logic, implement your own lightning.pytorch.callbacks.Callback following this user guide: Saving and Loading Checkpoints.

PublicAPI (beta): This API is in beta and may change before becoming stable.

Methods

Attributes