End-to-End Learning of Energy-Constrained Deep Neural Networks

Haichuan Yang, Yuhao Zhu, Ji LiuarXiv 2018 · OpenReview

TL;DR

This paper introduces the first end-to-end training framework that guarantees a Deep Neural Network (DNN) will stay within a specific, user-defined energy budget. By modeling hardware energy consumption directly and treating the energy budget as a hard constraint during optimization, the authors achieve higher accuracy than traditional "energy-agnostic" pruning methods.

Introduction

As Deep Neural Networks (DNNs) migrate from massive data centers to resource-constrained edge devices like autonomous drones and wearables, energy consumption has become a primary bottleneck. Most existing compression techniques—such as pruning or quantization—are energy-agnostic. They reduce parameters or operations, but these metrics do not always translate linearly to actual battery savings. Furthermore, existing methods lack quantitative guarantees; a developer cannot easily predict if a 50% pruned model will fit a strict 100mJ-per-inference energy budget. This research shifts the paradigm from "prune and see" to "set a budget and optimize."

Methods

The authors propose a framework that integrates a hardware-aware energy model directly into the training loop. Their approach consists of four main pillars:

  1. Quantitative Energy Modeling: They develop a model based on the popular systolic array hardware architecture (used in Google’s TPU and many modern NPUs). This model accounts for both computation energy (MAC operations) and data access energy (moving data between DRAM, Cache, and Register Files).
Energy modeling framework for a systolic array architecture, accounting for data movement and computation.
  1. Trainable Input Masking: While most methods only prune weights, this paper introduces a trainable binary mask for layer inputs. This allows the network to learn which parts of the incoming data are least important, enabling the hardware to skip unnecessary data fetches and computations.
  2. Constrained Optimization via Knapsack Projection: The training is formulated as an optimization problem: minimize loss subject to an energy constraint ($E \leq E_{budget}$). To solve this, the authors prove that the "projection" step (finding the closest valid model to the current one) can be mapped to a 0/1 Knapsack Problem. They provide an efficient greedy approximation algorithm to solve this during training.
  3. Knowledge Distillation (KD): To prevent the sparse model from losing too much accuracy, they use a pre-trained dense model as a "teacher" to guide the training of the energy-constrained "student" model.

Datasets

The framework was evaluated on three diverse datasets:

  • ImageNet: The gold standard for large-scale image classification.
  • MNIST: A classic handwritten digit dataset used for initial validation.
  • MS-Celeb-1M: A large-scale face recognition dataset, chosen because face images have regular patterns that are highly amenable to the proposed input masking technique.

Key Insights and Ideas

  • Weight Sparsity ≠ Energy Efficiency: A model with fewer non-zero weights isn't necessarily more energy-efficient than a denser one if the data movement patterns are suboptimal.
  • Input Sparsity is an Untapped Resource: By masking inputs, the framework can save energy in scenarios where data has predictable spatial importance (e.g., the center of a face in an aligned image).
  • The Knapsack Connection: Mapping the energy-constrained projection to a knapsack problem allows the use of well-studied combinatorial optimization techniques to solve a deep learning problem.

Key Results

The proposed method consistently outperformed state-of-the-art pruning techniques across various architectures. As shown in the trade-off analysis below, the proposed method (solid lines) achieves a better Pareto frontier (lower accuracy drop at lower energy consumption) compared to Magnitude Pruning (MP), Structured Sparsity Learning (SSL), and Energy-Aware Pruning (EAP).

Accuracy drop vs. normalized energy consumption for various DNN architectures and pruning methods. The proposed method (solid lines) consistently outperforms baselines.
  • AlexNet on ImageNet: Under a 26% energy budget, the proposed method achieved a 0.5% accuracy drop, significantly better than NetAdapt (4.4% drop) or EAP (0.8% drop at a higher 27% energy).
  • SqueezeNet & MobileNetV2: The method proved effective even on models already hand-crafted for efficiency. On SqueezeNet, it achieved a mere 0.4% accuracy drop while hitting a 38% energy budget.
  • Face Recognition: On MS-Celeb-1M, input masking was particularly effective, allowing the model to meet energy budgets with minimal impact on accuracy by focusing on central facial features.

Limitations and Future Work

  • Hardware Specificity: The current energy model is tailored to systolic arrays. Adapting to different architectures, like GPUs with different memory hierarchies, would require new energy formulations.
  • Static Budgets: The budget is set at training time. Dynamic energy requirements (e.g., a "low battery mode") would currently require storing multiple pre-trained models.
  • Input Masking Constraints: This technique works best on datasets with regular spatial structures; its utility on unaligned or chaotic data may be lower.

Future work could involve extending the model to handle other energy-saving techniques like quantization simultaneously or adapting the framework for dynamic, run-time energy constraints.

Summary updated

BibTeX
@misc{yang2018end,
  author = {Haichuan Yang and Yuhao Zhu and Ji Liu},
  title = {{End-to-End Learning of Energy-Constrained Deep Neural Networks}},
  year = {2018},
  url = {https://openreview.net/forum?id=mxmBvsGCjM},
}
Figure