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

Callback to log the L2 norm of all the parameters in the model, and optionally, the L2 norm of the parameters by each layer.

LRMonitor

Callback to log the learning rate.

SpeedMonitor

Callback to monitor the training throughput.

TorchProfiler

Profile the execution using torch.profiler.profile.

Callback Hyperparameters