E-RNN: Design Optimization for Efficient Recurrent Neural Networks in FPGAs

Zhe Li, Caiwen Ding, Siyue Wang, Wujie Wen, Youwei Zhuo, Chang Liu, Qinru Qiu, Wenyao Xu, Xue Lin, Xuehai Qian, Yanzhi Wang

Abstract

Recurrent Neural Networks (RNNs), such as LSTMs and GRUs, are essential for time-series tasks but present significant challenges for hardware implementation due to high computational demands and irregular memory access patterns. This paper introduces E-RNN, a cross-layer framework that optimizes RNNs for FPGA deployment. By employing block-circulant matrices and an ADMM-based training approach, E-RNN reduces storage and computational complexity while maintaining high accuracy. Experimental results on the TIMIT dataset demonstrate that E-RNN achieves up to a 37.4× energy efficiency improvement over state-of-the-art pruning methods and a 2× improvement over previous structured compression techniques.

Introduction

Recurrent Neural Networks are the standard for sequence-to-sequence tasks like speech recognition. However, deploying them on FPGAs is hindered by two primary factors:

  1. Computational Intensity: Massive matrix-vector multiplications and complex non-linear activation functions (e.g., tanh, sigmoid) require significant resources.
  2. Irregularity: Traditional weight pruning leads to sparse, irregular matrices that are difficult to parallelize, resulting in underutilized hardware resources.

Existing solutions like ESE (Efficient Speech Recognition Engine) suffer from irregularity, while others like C-LSTM lack a systematic approach to balance block size optimization with hardware constraints. E-RNN addresses these gaps by jointly optimizing the algorithm and hardware layers.

Methodology

The core of E-RNN is the use of block-circulant matrices to represent network weights. In this structure, a weight matrix is partitioned into square blocks where each row is a cyclic shift of the preceding row.

Comparison of block-circulant and unstructured weight matrices. The block-circulant approach significantly reduces the number of parameters required to represent the same network structure.

This representation offers two major advantages:

  • Storage Efficiency: Complexity is reduced from $O(n^2)$ to $O(n)$.
  • Computational Efficiency: Matrix-vector multiplications are transformed into Fast Fourier Transforms (FFT), reducing complexity from $O(n^2)$ to $O(n \log n)$.

ADMM-Based Training

To prevent accuracy loss during compression, E-RNN employs the Alternating Direction Method of Multipliers (ADMM). Unlike simple post-training quantization, ADMM treats the block-circulant structure as a constraint during the training process, allowing the weights to naturally converge to the desired format without sacrificing performance.

Systematic Optimization Framework

The E-RNN framework follows a multi-step optimization process to find the best balance between model size, accuracy, and hardware performance.

  1. Phase I (Algorithm): Determines the optimal model architecture (LSTM vs. GRU), layer sizes, and the largest possible block size that satisfies accuracy requirements.
  2. Phase II (Hardware): Optimizes Processing Elements (PEs), implements 12-bit fixed-point quantization, and uses High-Level Synthesis (HLS) for efficient activation function deployment.

Key Insights

  • Block Size vs. Network Width: The authors discovered that increasing the block size (compression ratio) is more accuracy-efficient than reducing the number of hidden neurons. This suggests that designers should favor aggressive block-circulant compression over shrinking the network's overall width.
  • Exploiting Symmetry: Since RNN weights and inputs are real-valued, their FFT representations are symmetric. E-RNN exploits this property to halve the storage and multiplication requirements for intermediate FFT results.
  • Model Selection: The framework facilitates easy switching between LSTM and GRU cells. GRUs often provide better performance-per-area due to having fewer gates and less internal state.

Experimental Results

E-RNN was evaluated on the TIMIT dataset for Automatic Speech Recognition (ASR) using Xilinx Kintex UltraScale and Virtex-7 FPGAs.

  • Throughput: On the Virtex-7 (7V3) platform, E-RNN achieved over 382,000 Frames Per Second (FPS), a significant leap over ESE's ~17,500 FPS.
  • Energy Efficiency: E-RNN demonstrated a 37.4× improvement over ESE and a 2× improvement over C-LSTM.
  • Accuracy: With a block size of 16 (16× parameter reduction), the Phone Error Rate (PER) increased by only ~0.3%, proving the framework's practical viability.

Conclusion

E-RNN provides a robust, cross-layer framework for deploying high-performance RNNs on FPGAs. By combining block-circulant matrix representations with ADMM-based training and hardware-aware optimization, it overcomes the traditional trade-offs between compression and efficiency. Future work includes extending the framework to training phases and exploring its performance on a broader range of RNN-based tasks beyond speech recognition.

Summary updated

BibTeX
@inproceedings{li2019e,
  author = {Zhe Li and Caiwen Ding and Siyue Wang and Wujie Wen and Youwei Zhuo and Chang Liu and Qinru Qiu and Wenyao Xu and Xue Lin and Xuehai Qian and Yanzhi Wang},
  title = {{E-RNN: Design Optimization for Efficient Recurrent Neural Networks in FPGAs}},
  booktitle = {HPCA},
  year = {2019},
  doi = {10.1109/hpca.2019.00028},
}
Figure