Hugging Face

See the Quick Start Guide on how to install and configure the profiler.

To profile Hugging Face training use a callback. Only some of the training steps will be profiled; the profiler decides which steps to profile for optimal statistics and low overhead.

Profile PyTorch training:

from graphsignal.profilers.huggingface import GraphsignalPTCallback

trainer = Trainer(..., callbacks=[GraphsignalPTCallback()])

Alternatively, trainer.add_callback method can be used:

trainer.add_callback(GraphsignalPTCallback())

Profile TensorFlow training:

from graphsignal.profilers.huggingface import GraphsignalTFCallback

trainer = Trainer(..., callbacks=[GraphsignalTFCallback()])

Examples

The Hugging Face BERT 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.