PowerDL is a lightweight, framework-agnostic toolkit for GPU energy, power, and utilization profiling of deep learning workloads.
It supports PyTorch and TensorFlow, operates fully in-memory by default, and provides rich, publication-ready visual analytics with optional artifact export.
The toolkit is designed for:
- Interactive experimentation (no mandatory file I/O)
- Energy-aware deep learning research
- Reproducible benchmarking
- Software-oriented scientific contributions
- Unified high-level API: profile_torch, profile_tf
- Fully in-memory profiling (no files required by default)
- Optional export for reproducibility
- High-resolution time-series sampling (NVML-based)
- Phase-aware analysis (training / inference / warmup / session)
- Batch-level and epoch-level energy breakdown
- Optional visualization layer
- Clean separation between measurement and plotting
- Research-ready structured outputs (CSV + JSON)
pip install powerdl
pip install powerdl[viz]
pip install powerdl[examples-torch]
pip install powerdl[examples-tf]
git clone https://github.com/your-repo/powerdl.git cd powerdl pip install -e .[viz]
The following dependencies are required for full functionality:
- Python ≥ 3.9
- NVIDIA GPU
- NVIDIA driver with NVML support
- pandas
- matplotlib
- SciencePlots
- nvidia-ml-py
Optional (depending on framework):
- torch
- tensorflow
If you are using the repository version, install the package first:
pip install -e .
Then run examples from the project root:
python -m examples.run_torch_example
or
python -m examples.run_tf_example
Do NOT run scripts directly using:
python examples/run_torch_example.py
This may result in import errors because Python cannot locate the powerdl module.
Using the "-m" option ensures correct module resolution and avoids the need for manual sys.path modifications.
from powerdl.highlevel import profile_torch
with profile_torch( out_dir=None, interval_s=0.02, verbose=1 ) as prof:
prof.train(model, trainloader, optimizer, loss_fn, epochs=3)
prof.infer_tensor(model, batch_size=256, n_samples=20000)
rep = prof.report() rep.export("results/torch_run")
from powerdl.highlevel import profile_tf
with profile_tf( out_dir=None, interval_s=0.02, verbose=1 ) as prof:
prof.fit(model, dataset, epochs=3)
prof.infer_keras(model, x_inf, batch_size=512)
rep = prof.report() rep.export("results/tf_run")
PowerDL collects all measurements in memory first.
Collected signals:
- GPU power (W)
- GPU utilization (%)
- Memory utilization (%)
- Precise timestamps
- Phase markers (training, inference, epochs, warmup)
No files are written unless explicitly requested.
Optional export: rep.export("runs/experiment_export")
rep = prof.report()
The unified Report object contains:
- samples_df – full time-series measurements
- marks_df – event and phase markers
- summary – structured scalar metrics
Visualization is lazy-loaded and requires matplotlib only when plotting is used.
pip install powerdl[viz]
rep.list_figures()
Time-Series:
- power_time
- gpu_util_time
- mem_util_time
- util_time_dual
- energy_rate
- power_derivative
- cumulative_energy
Distribution-Based:
- power_hist
- util_hist
- power_ecdf
- util_ecdf
Phase-Aware Statistics:
- power_boxplot_phase
- util_boxplot_phase
- phase_energy_bar
- phase_time_bar
Correlation & Density:
- power_util_scatter
- power_util_hexbin
Plot all figures:
rep.plot( all=True, out_dir="results/figs", show=False, smooth=5, shade_phases=True )
Plot selected figures:
rep.plot( figs=[ "power_time", "cumulative_energy", "power_util_hexbin", "phase_energy_bar" ], out_dir="results/figs", show=True )
Plot single figure:
rep.plot_one("power_ecdf", show=True)
rep.export("runs/experiment_01")
Produces:
- summary.json
- samples.csv
- marks.csv
- batches.csv
- epochs.csv
PowerDL separates:
- Measurement (NVML sampling)
- Aggregation (energy integration and phase pairing)
- Visualization (registry-based plotting)
Focus:
- temporal analysis
- phase-aware energy behavior
- reproducible research
- Green AI benchmarking
- Training vs inference energy comparison
- GPU saturation analysis
- Phase-wise energy profiling
- Deep learning energy efficiency studies
MIT License
Yasin SANCAR
Computer Engineer
Energy-Aware Deep Learning Research