Run-Time Efficient RNN Compression for Inference on Edge Devices

Urmish Thakker, Jesse G. Beu, Dibakar Gope, Ganesh Dasika, Matthew MattinaCVPR 2019 · DOI

Introduction

Deploying Recurrent Neural Networks (RNNs) on edge devices, such as smartphones and IoT sensors, presents significant challenges due to limited memory, low bandwidth, and small caches. While model compression is necessary to fit these constraints, traditional methods often involve detrimental trade-offs. Pruning creates sparse matrices that modern CPUs handle inefficiently, often resulting in slower execution than the original dense model. Low-Rank Matrix Factorization (LMF) speeds up execution but significantly reduces the model's expressive power, leading to sharp accuracy loss. Structured matrices, while theoretically efficient, often require specialized hardware to realize actual speedups on small-to-medium matrices.

To address these issues, researchers at Arm ML Research have developed Hybrid Matrix Decomposition (HMD). This novel technique balances accuracy and execution speed by splitting weight matrices into a "rich" dense section and a "constrained" low-rank section, specifically optimized for standard mobile CPUs.

Hybrid Matrix Decomposition (HMD)

The core innovation of HMD lies in its recognition that not all output features in an RNN layer are equally critical. Instead of applying uniform compression, HMD divides a weight matrix horizontally into two distinct parts:

  1. The Upper Part ($A'$): A standard, fully-parameterized dense matrix that generates high-quality, "rich" features for the output vector.
  2. The Lower Part: A collection of rank-1 blocks (represented by matrices $B, C, D, E$) that generates "constrained" features using significantly fewer parameters.
Hybrid Matrix Decomposition (HMD) visualization showing the split of matrix A into components A', B, C, D, and E.

During inference, HMD avoids reconstructing the original large matrix. Instead, it leverages the associative property of matrix multiplication to perform a series of smaller, hardware-friendly dense matrix-vector products. This approach maintains high performance on standard CPUs, such as the ARM Cortex-A73, by staying within the realm of efficient dense linear algebra.

Experimental Evaluation

The authors evaluated HMD across three distinct benchmarks: Human Activity Recognition (HAR1 and HAR2) using bidirectional LSTMs, and Language Modeling (PTB-LM) using the Penn Treebank dataset.

Key Results

HMD demonstrates a superior trade-off between accuracy and speed compared to existing methods. It achieves "iso-accuracy" (no loss compared to the baseline) at 2x to 3x compression factors, whereas LMF shows significant degradation at similar levels.

Accuracy vs. Speed-up over baseline for various compression techniques. HMD maintains high accuracy while achieving significant speed-up.

On a Hikey 960 board (Cortex-A73), HMD-compressed networks were found to be 2x faster than pruned networks at equivalent compression levels. Furthermore, HMD outperformed Block Circular Decomposition (BCD) techniques by a factor of 30x, as BCD's complex mathematical overhead is poorly suited for general-purpose mobile hardware. In language modeling tasks, HMD was uniquely capable of improving perplexity while simultaneously providing a significant speedup.

Discussion and Conclusion

A key insight from this work is the "Pruning Paradox": reducing parameter counts does not guarantee faster execution on mobile CPUs due to the overhead of sparse data management. HMD bypasses this by prioritizing feature quality and maintaining dense computation.

While HMD shows great promise for RNNs, future work could explore its applicability to fully connected layers in Transformers or CNNs. Additionally, developing automated methods for selecting the optimal split point ($r$) between dense and constrained sections would further enhance the utility of this technique for edge AI deployment.

Summary updated

BibTeX
@inproceedings{thakker2019run,
  author = {Urmish Thakker and Jesse G. Beu and Dibakar Gope and Ganesh Dasika and Matthew Mattina},
  title = {{Run-Time Efficient RNN Compression for Inference on Edge Devices}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/emc249363.2019.00013},
}
Figure