Data-driven power modeling and monitoring via hardware performance counter tracking

Sergio Mazzola, Gabriele Ara, Thomas Benz, Björn Forsberg, Tommaso Cucinotta, Luca Benini

Abstract

Modern embedded systems require high energy efficiency, yet real-time power monitoring remains a challenge due to the limitations of analog sensors and the complexity of existing software models. This paper presents Runmeter, an open-source framework designed to estimate the power consumption of heterogeneous systems (CPUs and GPUs) in real-time. By integrating frequency-aware linear models directly into the Linux kernel, Runmeter achieves a Mean Absolute Percentage Error (MAPE) of 7.5% with a negligible performance overhead of less than 0.7%. This approach enables the operating system to make informed, energy-aware scheduling decisions without the need for specialized hardware or computationally expensive machine learning models.

Introduction

In the era of mobile and embedded computing, the balance between performance and energy consumption is critical. Operating systems typically manage this balance through Dynamic Voltage and Frequency Scaling (DVFS). However, to optimize these transitions effectively, the system requires instantaneous, fine-grained power data.

Existing power monitoring solutions generally fall into two categories, both of which possess significant drawbacks. Analog sensors, while accurate for total board power, often suffer from low sampling rates and lack the granularity to attribute power consumption to specific software tasks or hardware sub-systems. Conversely, existing software-based models often rely on "bottom-up" architectural knowledge that is frequently proprietary, or "black-box" machine learning techniques that are too resource-intensive to run within an operating system kernel.

To address these gaps, we introduce a "top-down," data-driven methodology that utilizes Hardware Performance Counters (PMCs) to provide accurate, responsive, and lightweight power tracking within the Linux kernel.

Methodology

The Modeling Strategy

Our approach treats hardware sub-systems, such as CPU islands and GPUs, as independent power-consuming components. Rather than employing a single complex equation, we utilize a Lookup Table (LUT) of simple linear models. This acknowledges that hardware behavior and power characteristics change fundamentally across different DVFS states.

For each frequency state, we identify specific PMCs—such as instructions retired, cache misses, or cycles—that correlate most strongly with power consumption. We then apply Non-Negative Least Squares (NNLS) regression to determine the model weights. The use of NNLS ensures that the resulting weights are physically meaningful; for instance, it prevents a model from suggesting that increased hardware activity could result in negative power consumption.

The Runmeter Framework

Runmeter is implemented as a Linux kernel module that hooks directly into the task scheduler. Key features include:

  • Moving-Window Sampling: The framework uses a sliding window to sample PMCs, providing "synthetic" samples that balance stability for accuracy with high responsiveness to workload changes.
  • Fixed-Point Arithmetic: To ensure safety and performance within the kernel environment, where floating-point operations are generally avoided, the model uses fixed-point arithmetic.
  • Low Overhead: By design, the framework minimizes its footprint on the system it monitors, ensuring that the act of measurement does not significantly alter the performance profile of the applications being tracked.

Experimental Setup

Hardware and Workloads

The framework was validated using the NVIDIA Jetson AGX Xavier, a high-end embedded platform featuring an 8-core ARM CPU and a 512-core Volta GPU. To ensure a comprehensive evaluation, we utilized the Rodinia 3.1 benchmark suite, covering a variety of compute and memory-bound patterns across both OpenMP (CPU) and CUDA (GPU) implementations. Synthetic stress tests, such as memcpy, were also included to test edge cases.

Ground Truth

Ground truth power data was collected using the board's onboard INA3221 power monitors. This data served as the training target for our statistical models and the baseline for accuracy validation.

Results and Discussion

Accuracy and Efficiency

The Runmeter framework demonstrated high precision, achieving a MAPE of 7.5% for instantaneous power estimation. When integrated over time, the error for total energy estimation dropped to a remarkably low 1.3%.

Crucially, this accuracy does not come at the cost of performance. Even under intense task-switching scenarios, the framework's overhead remained below 0.7% of CPU time. Furthermore, the transition from floating-point to fixed-point arithmetic introduced a negligible error of only 0.015%, confirming the robustness of the mathematical approach.

Digital vs. Analog Responsiveness

A significant finding of this research is that PMC-based models can be more responsive than traditional analog sensors. While analog sensors are subject to "electrical inertia" and transients, PMCs reflect changes in digital activity almost instantaneously. This makes Runmeter particularly well-suited for capturing the power spikes associated with rapid workload transitions.

Conclusion and Future Work

Runmeter provides a viable path for bringing energy awareness to the Linux kernel. By assuming sub-system independence and utilizing frequency-specific linear models, we have created a system that is both accurate and lightweight enough for real-world deployment.

Future research will focus on addressing the limitations of the current model, particularly in scenarios where the CPU and GPU interact heavily, leading to non-linear power behaviors. Additionally, we aim to extend the framework to cover deep idle states and explore predictive modeling, which would allow the operating system to anticipate and mitigate power spikes before they occur. Finally, we plan to automate this methodology to ensure its applicability across a broader range of hardware architectures.

Summary updated

BibTeX
@article{mazzola2025data,
  author = {Sergio Mazzola and Gabriele Ara and Thomas Benz and Björn Forsberg and Tommaso Cucinotta and Luca Benini},
  title = {{Data-driven power modeling and monitoring via hardware performance counter tracking}},
  journal = {J. Syst. Archit.},
  year = {2025},
  doi = {10.1016/j.sysarc.2025.103504},
}
Figure