Thinking While Leaking: Latency-Costed Unfolded Solvers for Leakage-Aware Power Control

Modern chips waste a large share of their energy as leakage: current that flows through transistors even when they are not switching, and that rises steeply with temperature. On neural accelerators, static power accounts for 30–72% of total energy (ReGate). The best operating point for a processor, meaning its clock frequency, how many cores are on, and where threads run, therefore depends on the die's temperature at that moment. In principle a small optimization problem could choose this point every few tens of milliseconds. In practice three costs undermine it. Solving the problem takes time, and the chip keeps leaking at the old setting until the answer arrives. Running the solver uses energy of its own. And the solver's physical model is usually tuned in a simulator whose power estimates are known to diverge from real silicon. This proposal treats all three costs as one design question: how much computation a power controller should spend, and of what kind, so that the net energy saved on real hardware is largest.

The specific bet is this. A deep-unfolded solver is a fixed-depth network in which each layer is one iteration of a classical algorithm with learned step sizes. We seed it with a fast learned guess and let it refine that guess for a few iterations against a physically grounded leakage model. The model's handful of coefficients can be refit on the target board in minutes. Our claim is that this hybrid crosses the simulation-to-hardware gap better than a pure learned lookup policy, and costs less in latency and energy than a classical solver run to convergence. If it is right, the choice between "table" and "solver" stops being binary. The number of refinement iterations becomes a knob, and we choose it on silicon by measuring net energy, with the controller's own cost included.

Core Claim

Every control period of length $\Delta$, the controller observes temperature, rail power, and performance counters. It then chooses a setting $u$: per-cluster frequency and voltage, number of active cores, and thread mapping. The unfolded controller produces $u_K$ after $K$ refinement layers starting from an amortized guess $u_0$. We define the quantity it should minimize as

$$J(K) = E_{\text{plant}}(u_K;\,\Delta - \tau_K) + E_{\text{plant}}(u_{\text{prev}};\,\tau_K) + E_{\text{ctrl}}(K),$$

where $\tau_K$ is the wall-clock time to compute $K$ layers on the board. The first term is the energy spent under the new setting for the rest of the period. The second is the energy spent under the stale previous setting while the controller computes. $E_{\text{ctrl}}(K)$ is the energy the processor spends running the controller itself.

We make three predictions. First, $J(K)$ is U-shaped on real hardware with its minimum at small $K$ (roughly 2–5). Second, the minimum moves toward larger $K$ when leakage is strongly temperature-coupled, for example under hot ambient conditions or sustained big-core load. Third, and most important, at depth $K>0$ the controller recovers most of the sim-to-silicon decision loss when its leakage coefficients are refit from hardware measurements, without retraining any network weights. A depth-0 policy cannot do this.

Positioning

Three lines of work motivate the proposal by documenting the gap.

On power modeling, Empirical CPU power modelling and estimation in the gem5 simulator replaces bottom-up power tools with counter-based models on an ARM Cortex-A15. It reaches under 10% aggregate error, but only because gem5's per-event counter errors, which exceed 15%, cancel each other out. That cancellation is harmless for averaged energy reports. It is dangerous for a controller, which acts on exactly the fine-grained differences that cancel.

Accurate and stable empirical CPU power modelling shows that anchoring the regression in the $V^2 f$ power relation and adding thermal sensor inputs gives 2.8% MAPE on an ODROID-XU3. It also releases the Powmon and GemStone toolchains. We reuse this physically structured model as the plant model inside our solver layers. Like the gem5 paper, it remains an estimator: it never closes a control loop.

On latency, Air Learning shows that execution latency on embedded boards is itself a sim-to-real gap. Injecting measured latency into training shrank a 37.73% flight-time gap to 0.5%. We borrow the principle that latency must be accounted for, but go further: the controller's latency appears inside its objective, rather than only as noise injected during training.

On solver acceleration, two papers supply the method. Deep FlexQP unfolds ADMM, a splitting method for constrained quadratic programs, inside a sequential quadratic programming loop. It adds an $\ell_1$ "elastic" relaxation so the subproblem is always solvable and reports 4–16x speedups over the OSQP solver. Unfolding WMMSE Using Graph Neural Networks matches classical radio power allocation in 4 layers, at 2 ms versus 16 ms. Neither paper has touched chip power, and both treat the execution engine as free.

The elastic relaxation matters here for a specific reason. A sudden thermal spike can make a frequency target and a temperature cap mutually impossible, and a controller that crashes or stalls at that moment is worse than none.

Leakage-control work constrains the design. Optimal body bias selection shows that pushing transistor thresholds up by reverse biasing eventually raises total leakage through junction tunneling. Leakage minima are therefore interior, which a monotone reactive rule cannot find. Dynamic Fine-Grain Body Biasing shows that runtime adaptation beats static worst-case tables by 28–42% in leakage, using a reactive per-cell counter rather than a solver. Active mode leakage reduction using fine-grained forward body biasing formulates leakage allocation as a linear program, but solves it offline in minutes to hours.

The ODROID-XU3 exposes frequency, voltage, and core on/off control, but not body bias. We are therefore explicit about scope. The hardware study controls frequency, active cores, and mapping. Body bias appears only in a simulated extension on synthetic variation chips, in the style of the dynamic body-biasing paper.

Research Program

We first build the plant model. Powmon is used to fit a Walker-style power model per cluster on the ODROID-XU3, with an explicit temperature-dependent static term. It is coupled to a lumped thermal model fit from step-response experiments. The same model structure is projected into gem5 through GemStone, which gives us a simulator whose leakage coefficients are known to be slightly wrong relative to the board. That mismatch is the gap we want to study.

We then pose the per-period control problem. The objective is energy per unit of work, subject to a throughput floor and a temperature cap, both elastically relaxed. Integer core counts are relaxed to continuous values and rounded afterward.

The controller has three parts. An amortized head, a small network, maps measurements to $u_0$. Then come $K$ unfolded sequential-QP/ADMM layers. Each layer linearizes the physical power and thermal model at the current iterate, using the live temperature reading and the current coefficient estimates. The layers' step sizes are learned, either as static per-layer constants or through a recurrent policy as in Deep FlexQP; comparing the two tests whether the recurrent overhead pays for itself on a small core.

Training happens in simulation and minimizes $J(K)$ directly. To do this, we profile $\tau_K$ and $E_{\text{ctrl}}(K)$ on the board for each depth and inject them into the simulated loop as Air Learning does.

At deployment, the coefficient refit uses about two minutes of rail and temperature data to update the physical model. No network weights change.

Baselines

The naive reference point is the stock Linux governor on the ODROID-XU3: the board's default frequency policy with default core management. It is what users actually get. No reported result was found on Lacuna for net energy of Linux governors on this board, so we measure it ourselves on identical workload traces.

The static-calibration baseline is a per-board table from temperature and utilization bins to settings. It is built offline on the hardware by exhaustive sweep and corresponds to static fine-grain biasing. The reactive baseline adapts the dynamic body-biasing counter scheme to frequency control: the setting steps up or down by one level per period based on a slack signal. Dynamic Fine-Grain Body Biasing reports 28–42% leakage reduction over static tables in simulation, which motivates treating this baseline as a serious competitor rather than a strawman.

The strongest competitor on the latency question is OSQP solving the identical relaxed problem to convergence on a board core. We charge it its true $\tau$ and energy, give it warm starts, and tune its tolerances on the same validation traces. Deep FlexQP reports a 4–16x speedup over OSQP on trajectory problems. Whether that carries over to a problem this small is exactly what we test.

The strongest competitor on the sim-to-silicon question is the depth-0 amortized policy alone. It is trained on the same simulator data with the same latency injection, the same number of training steps, and the same hyperparameter search budget. A further version is fine-tuned on the same two minutes of hardware data that the refit uses, which gives it equal access to real measurements.

The proposal beats these baselines if two conditions hold together. The best-$K$ unfolded controller must lower measured net board energy at an equal throughput floor relative to every baseline, with confidence intervals over repeated runs. And its hardware decision regret, measured against a hindsight oracle that picks the best setting per period from exhaustive replay, must be lower than that of the fine-tuned depth-0 policy.

Three ablations isolate the key ingredients. The first removes the coefficient refit, keeping simulator coefficients. The second removes the controller-cost terms from training. The third swaps learned step sizes for fixed ADMM parameters.

Why not just…?

Why not just use a reactive step controller like dynamic body biasing? It needs no solver and costs nearly nothing to run. However, it moves one level per period along a single slack signal, while the leakage minimum is interior: junction tunneling penalizes over-biasing (Optimal body bias selection). It is also coupled across clusters through shared heat. Our experiments include fast workload phase changes, where step controllers lag, and hot-ambient runs, where the interior optimum moves. If the reactive controller matches us there, the solver is unjustified, and we will report that outcome.

Why not just precompute a table or train a direct policy network? This is the real threat. With two clusters and a few dozen settings, a direct predictor may be nearly optimal in distribution. Its weakness should appear under shift, when the board's leakage coefficients differ from the simulator's, or when ambient temperature leaves the training range. The fine-tuned depth-0 baseline and the refit-free ablation settle this question directly. If depth 0 with equal hardware data matches depth $K$, the conclusion is that refinement layers are unnecessary at this scale. The contribution then narrows to the controller-inclusive accounting and the decision-regret evaluation.

Why not just run OSQP in a background thread? Modern cores have spare cycles, but the cost of those cycles is easy to forget. Every millisecond of solving is a millisecond leaking at the stale setting, plus the solver's own energy. Air Learning documents this staleness effect on a Raspberry Pi. Our $J(K)$ measurement charges OSQP exactly these costs, so the comparison shows directly whether convergence is worth paying for.

Why not just calibrate the simulator better and train any policy in it? Better calibration is necessary, and we adopt the 2.8%-MAPE modeling approach of Accurate and stable empirical CPU power modelling. But low aggregate error can hide large per-event errors that cancel out (Empirical CPU power modelling and estimation in the gem5 simulator). For this reason we report decision regret alongside power MAPE, and test whether the two disagree.

Proposed Experiments

All hardware runs use the ODROID-XU3 and its rail sensors. Workloads are MiBench, LMBench, and Roy Longbottom traces, plus SPEC CPU subsets spliced into phase sequences. Thermal environments vary by fan state and ambient temperature, and include held-out hot conditions never seen in training.

The first decisive check is the shape of $J(K)$, measured on silicon for $K$ from 0 to 20 and for OSQP. The prediction is a U shape with its minimum at small $K$, moving right under hot conditions.

The second check is the transfer test. We compare hardware decision regret against regret in simulation for each controller, both with and without the refit. The hypothesis fails if depth-$K$ controllers show the same sim-to-silicon regret growth as depth 0.

The third check examines error cancellation. We compare power MAPE and decision regret for controllers trained against the uncorrected gem5 counter statistics. The prediction is similar MAPE but clearly worse regret.

The simulated body-bias extension uses geoR-style variation chips. It tests whether the interior leakage optimum makes refinement more valuable than for frequency control alone, since a linearize-and-refine step can find the interior point that a single-shot predictor or a monotone rule tends to miss.