composer.callbacks

Note

To write a custom callback, see composer.Callback.

Composer contains built-in callbacks, which can be added via the --callbacks CLI flag:

python examples/run_mosaic_trainer.py -f my_model.yaml --callbacks lr_monitor grad_monitor

Callbacks

Benchmarker

Fast-forward the training loop to record throughput for specific epochs and/or steps.

GradMonitor

Logs the L2 norm.

LRMonitor

Logs the learning rate.

SpeedMonitor

Logs the training throughput.

TorchProfiler

Profile the execution using torch.profiler.profile.

Callback Hyperparameters

BenchmarkerHparams

Benchmarker hyperparameters.

GradMonitorHparams

GradMonitor hyperparamters.

LRMonitorHparams

LRMonitor hyperparameters.

SpeedMonitorHparams

SpeedMonitor hyperparameters.

TorchProfilerHparams

TorchProfiler hyperparameters.