Skip to main content

GPU Monitoring Callbacks for TensorFlow and PyTorch Lightning

Project description


gpumonitor gives you stats about GPU usage during execution of your scripts and trainings, as TensorFlow or Pytorch Lightning callbacks.


Installation can be done directly from this repository:

pip install

Getting started

Option 1: In your scripts

monitor = gpumonitor.GPUStatMonitor(delay=1)

# Your instructions here
# [...]


Option 2: Callbacks

Add the following callback to your training loop:

For TensorFlow,

from import TFGpuMonitorCallback, y, callbacks=[TFGpuMonitorCallback(delay=0.5)])

For PyTorch Lightning,

from gpumonitor.callbacks.lightning import PyTorchGpuMonitorCallback

trainer = pl.Trainer(callbacks=[PyTorchGpuMonitorCallback(delay=0.5)])


  • Built on top of GPUStat
  • Separate thread loop coming from gputil

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gpumonitor, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size gpumonitor-0.1.0.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View
Filename, size gpumonitor-0.1.0-py3-none-any.whl (4.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page