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
- SoftwareX-style reproducible software contributions
- PyTorch and TensorFlow support
- Fully in-memory profiling (no files required by default)
- Optional export for reproducibility
- High-resolution time-series sampling (NVML-based)
- Rich, selectable visual analytics
- Uniform API across frameworks
- SoftwareX-ready outputs (figures + summaries)
Clone the repository and install in editable mode:
git clone https://github.com/your-repo/powerdl.git
cd powerdl
pip install -e .- Python ≥ 3.9
- NVIDIA GPU with NVML support
- PyTorch or TensorFlow
- numpy, pandas, matplotlib
from powerdl.highlevel_torch 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.plot(all=True, out_dir="results/torch_figs")from powerdl.highlevel import profile_tf
with profile_tf(out_dir=None, device_index=0, interval_s=0.02, verbose=1) as prof:
prof.fit(model, dataset, epochs=10)
prof.infer_keras(model, x_inf, batch_size=512)
rep = prof.report()
rep.plot(all=True, out_dir="results/tf_figs")PowerDL always collects measurements in memory:
- GPU power (W)
- GPU utilization (%)
- Memory utilization (%)
- Time stamps
- Phase markers (training / inference / epochs)
No files are written unless explicitly requested.
Optional export:
rep.export("runs/experiment_export")After profiling, a unified Report object is returned:
rep = prof.report()The report contains:
samples– time-series measurementsmarks– phase and event markerssummary– aggregated scalar metrics
PowerDL includes a registry-based visualization system.
Users can list, select, or generate all available figures.
rep.list_figures()power_time– GPU power vs time (phase-shaded)gpu_util_time– GPU utilization vs timemem_util_time– memory utilization vs timerolling_power– smoothed power tracerolling_util– smoothed utilization trace
cumulative_energy– cumulative energy over timeenergy_rate– instantaneous energy ratephase_energy_bar– training vs inference energy breakdownepoch_energy– energy per epoch (if epoch markers exist)
power_hist– power histogramutil_hist– utilization histogrampower_ecdf– empirical CDF of powerutil_ecdf– empirical CDF of utilization
power_boxplot_phase– power by phaseutil_boxplot_phase– utilization by phasephase_time_bar– time spent per phase
power_util_scatter– power vs GPU utilizationpower_util_hexbin– density-based power–utilization relation
throughput_window– instantaneous throughputefficiency_curve– energy–performance trade-off
rep.plot(all=True, out_dir="results/figs", show=False)rep.plot(
figs=[
"power_time",
"cumulative_energy",
"power_util_hexbin",
"phase_energy_bar"
],
out_dir="results/figs",
show=True,
smooth=5,
shade_phases=True
)rep.plot_one("power_ecdf", show=True)All figures are:
- Consistently sized
- Grid-aligned with clean axes
- Top/right spines removed
- Publication-ready
- Saved as PNG and PDF
rep.export("runs/experiment_01")Produces:
summary.jsonsamples.csvmarks.csvfigures/*.pngfigures/*.pdf
This enables full reproducibility without enforcing disk I/O.
PowerDL separates:
- Measurement
- Analysis
- Visualization
It focuses on temporal and phase-aware energy behavior, rather than only scalar energy metrics.
The toolkit supports both interactive workflows and reproducible research.
- Energy-aware deep learning research
- Green AI benchmarking
- Training vs inference energy comparison
- GPU efficiency and saturation analysis
- Software reproducibility studies
MIT License