GPU Monitoring Callbacks for TensorFlow and PyTorch Lightning
Project description
gpumonitor
gpumonitor
gives you stats about GPU usage during execution of your scripts and trainings,
as TensorFlow or
Pytorch Lightning callbacks.
Installation
Installation can be done directly from this repository:
pip install https://github.com/sicara/gpumonitor/archive/master.zip
Getting started
Option 1: In your scripts
monitor = gpumonitor.GPUStatMonitor(delay=1)
# Your instructions here
# [...]
monitor.stop()
monitor.display_average_stats_per_gpu()
Option 2: Callbacks
Add the following callback to your training loop:
For TensorFlow,
from gpumonitor.callbacks.tf import TFGpuMonitorCallback
model.fit(x, y, callbacks=[TFGpuMonitorCallback(delay=0.5)])
For PyTorch Lightning,
from gpumonitor.callbacks.lightning import PyTorchGpuMonitorCallback
trainer = pl.Trainer(callbacks=[PyTorchGpuMonitorCallback(delay=0.5)])
trainer.fit(model)
Sources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gpumonitor-0.1.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for gpumonitor-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d917cd5db6848613974bc40672f57d9e3c086b45e03ccf5a6be392fa77e37f |
|
MD5 | 1dc9ba51120bd980597ed2a5423527d6 |
|
BLAKE2b-256 | 7a586186128b29ed6fccafa8d4ffd2a66cf8f3dc13a6d7527bf4d8c9d11c9d07 |