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 gpumonitor
Getting started
Option 1: In your scripts
monitor = gpumonitor.GPUStatMonitor(delay=1)
# Your instructions here
# [...]
monitor.stop()
monitor.display_average_stats_per_gpu()
It keeps track of the average of GPU statistics. To reset the average and start from fresh, you can also reset the monitor:
monitor = gpumonitor.GPUStatMonitor(delay=1)
# Your instructions here
# [...]
monitor.display_average_stats_per_gpu()
monitor.reset()
# Some other instructions
# [...]
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)
Display Format
You can customize the display format according to the gpustat options. For example, display of watts consumption,
fan speed are available. To know which options you can change, refer to:
Sources
Release files for gpumonitor 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gpumonitor-0.1.2.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gpumonitor-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / gpumonitor-0.1.2.tar.gz
| Download URL | gpumonitor-0.1.2.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21789d0a2eb7057dfcffa94adfbacf5eee581823a079850afdd6b6a3e60ac1b5
|
|
BLAKE2b-256 checksum How to use checksums |
a6eda89f99a0d8f04c35d6a1928264b86ce6b5ac17fb1fb5b1378d12dfa3459d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|
Release files / gpumonitor-0.1.2-py3-none-any.whl
| Download URL | gpumonitor-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0c7fa98b0f1f59e0b3f5643cc825afcfffcc198d8c0f450c5f056fa2c24ed85
|
|
BLAKE2b-256 checksum How to use checksums |
826c19421a9e60046ee3a79a26553845cfee974d6a5b65c76a3b4a520c6bcb86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7
|