composer.callbacks#

Callbacks that run at each training loop Event.

Each callback inherits from the Callback base class. See detailed description and examples for writing your own callbacks at the Callback base class.

Classes

ActivationMonitor

Logs stats of activation inputs and outputs.

CheckpointSaver

Callback to save checkpoints.

EarlyStopper

Track a metric and halt training if it does not improve within a given interval.

EvalOutputLogging

Logs eval outputs for each sample of each ICL evaluation dataset.

ExportForInferenceCallback

Callback to export model for inference.

FreeOutputs

Free train metrics on AFTER_LOSS to reduce peak memory usage if not using train metrics.

Generate

Periodically log generations from a set of prompts.

ImageVisualizer

Logs image inputs and optionally outputs.

LRMonitor

Logs the learning rate.

MLPerfCallback

Create compliant results file for MLPerf Training benchmark.

MemoryMonitor

Logs the memory usage of the model.

MemorySnapshot

Logs the memory snapshot of the model.

NaNMonitor

Catches NaNs in the loss and raises an error if one is found.

OOMObserver

Generate visualizations of the state of allocated memory during an OutOfMemory exception.

OptimizerMonitor

Computes and logs the L2 norm of gradients as well as any optimizer-specific metrics implemented in the optimizer's report_per_parameter_metrics method.

RuntimeEstimator

Estimates total training time.

SpeedMonitor

Logs the training throughput and utilization.

SystemMetricsMonitor

Track system metrics.

ThresholdStopper

Halt training when a metric value reaches a certain threshold.