PyTorch Lightning
See the Quick Start Guide on how to install and configure the profiler.
To profile PyTorch Lightning training and inference, use a callback. Only some of the training, validation and test batches will be profiled; the profiler decides which batches to profile for optimal statistics and low overhead.
Profile training, validation and prediction:
from graphsignal.profilers.pytorch_lightning import GraphsignalCallback
trainer = Trainer(..., callbacks=GraphsignalCallback()])
Note: avoid using other PyTorch Lightning profilers simultaneously.
Examples
The PyTorch Lightning MNIST example illustrates how to add the profiler callback.
Distributed workloads
Graphsignal provides built-in support for distributed training and inference. It is only necessary to provide the same run ID to all workers. Refer to Distributed Workloads section for more information.