Yi Pan, Wenbo Qian, Dedong Xie, Ruiyan Hu, Yigong Hu, Baris Kasikci — arXiv preprint (2025) (2025)
Keywords: Energy Efficiency ML Systems Differential Energy Profiling
We are witnessing an explosion in the resource intensity of machine learning (ML). Training a model like GPT-4 consumes an estimated 50 GWh of electricity, and generating a single response from Llama3-405B can use as much energy as lighting a 60W lamp for a minute.
While the community has poured effort into optimizing hardware—tuning GPU frequencies or power-capping—we noticed a massive, overlooked source of inefficiency: software energy waste. This occurs when poor software design or redundant operations consume excess energy without improving performance.
In our latest work, we present Magneton, a differential energy profiler designed to detect and diagnose these invisible inefficiencies.
Why hasn’t this been solved by standard performance profilers? The answer lies in a counter-intuitive observation we made: energy waste does not always look like a performance issue.
For example, we found that while PyTorch and JAX perform float32 matrix multiplications at nearly the same speed for small matrices, PyTorch’s implementation consumes 1.45x more energy. A performance profiler would see these two operations as identical, completely missing the wasted energy.
Furthermore, existing energy profilers like Zeus are often too coarse, requiring measurement windows (e.g., 100ms) that are far too slow to catch inefficiencies happening at the operator level (milliseconds). We realized that to fix software energy waste, we needed a new approach.

We built Magneton based on a simple insight: today’s ML ecosystem is diverse. For almost any task (like LLM inference), there are multiple competing systems (vLLM, SGLang, Hugging Face) performing the same mathematical computations.
If System A consumes significantly more energy than System B to do the exact same job, that difference is a signal. Magneton leverages this by comparing these systems to automatically pinpoint waste—a technique we call differential energy debugging.

To evaluate Magneton, we applied it to 9 widely used ML systems, including PyTorch, TensorFlow, vLLM, and Stable Diffusion. The results confirmed our suspicions:
torch.addmm API was 10% less energy-efficient than using separate add and matmul kernels, despite performance being nearly identical.dist.Join feature forces GPUs to perform useless synchronization work rather than idling when workloads are imbalanced, wasting roughly 23% more energy compared to a manual early-exit strategy.As ML models grow larger, we cannot rely solely on hardware improvements to keep energy costs in check. Our work with Magneton demonstrates that software choices matter. By leveraging the diversity of the ML ecosystem to cross-check and debug energy usage, we can build systems that are not just high-performing, but sustainably designed.