C-LSTM: Enabling Efficient LSTM using Structured Compression Techniques on FPGAs

Shuo Wang, Zhe Li, Caiwen Ding, Bo Yuan, Yanzhi Wang, Qinru Qiu, Yun Liang

Introduction

Long Short-Term Memory (LSTM) networks have become the standard for sequence-based tasks such as speech recognition and machine translation. However, as these models grow in complexity to achieve higher accuracy, they become increasingly difficult to deploy on resource-constrained hardware like FPGAs. The C-LSTM framework introduces a novel approach to this problem by utilizing structured compression via block-circulant matrices, significantly reducing computational and memory overhead while maintaining high performance.

The Challenge of Hardware Deployment

LSTMs are computationally intensive due to their multiple gating mechanisms and recurrent connections. In a typical FPGA deployment, the large weight matrices often exceed the available on-chip memory (BRAM), necessitating frequent and slow accesses to off-chip DRAM. This memory bottleneck severely limits throughput.

Standard LSTM cell architecture with multiple gates and memory blocks.

Previous attempts to mitigate this issue relied on unstructured pruning—randomly removing weights to create sparse matrices. While this reduces the total number of parameters, it introduces irregular data structures that are difficult for hardware to process efficiently. Irregular sparsity leads to unbalanced workloads across parallel processing units and complex memory indexing, which often negates the theoretical performance gains of pruning.

Structured Compression with Block-Circulant Matrices

The core innovation of C-LSTM is the use of block-circulant matrices for weight representation. Instead of a dense $k \times k$ matrix, the weight matrix is divided into blocks where each block is a circulant matrix. In a circulant matrix, each row is a cyclic shift of the previous one, meaning an entire $k \times k$ block can be represented by a single vector of size $k$.

Comparison between an unstructured weight matrix and the proposed block-circulant weight matrix, showing significant parameter reduction.

This structured approach reduces storage requirements from $O(k^2)$ to $O(k)$. More importantly, it allows for the use of Fast Fourier Transforms (FFT) to perform matrix-vector multiplications. By moving these operations into the frequency domain, the computational complexity is reduced from $O(k^2)$ to $O(k \log k)$.

Hardware Optimization Techniques

Beyond structured compression, the C-LSTM framework employs several hardware-specific optimizations:

  1. DFT-IDFT Decoupling: The authors optimized the accumulation process by moving the Inverse Discrete Fourier Transform (IDFT) outside the accumulation operator. This reduces the number of expensive IDFT calls required during sub-block multiplication.
  2. Quantization and Approximation: To save hardware area, the datapath is quantized to 16-bit fixed-point. Additionally, complex activation functions like sigmoid and tanh are replaced with 22-segment piece-wise linear approximations, which are more efficient to implement in hardware than transcendental functions.
  3. Coarse-Grained Pipelining: Recognizing that circulant convolutions are much heavier than element-wise gate operations, the authors developed a specialized scheduling algorithm. This algorithm balances the computational load across a multi-stage pipeline, ensuring high hardware utilization.

Evaluation and Results

The framework was evaluated using the TIMIT acoustic-phonetic corpus and a standard "Google LSTM" architecture. The primary metric for accuracy was the Phone Error Rate (PER).

Compared to ESE, a previous state-of-the-art pruning-based accelerator, C-LSTM achieved:

  • Performance: Up to 18.8x speedup in frames per second (FPS).
  • Energy Efficiency: Up to 33.5x improvement in FPS per Watt.
  • Compression: Model size reduction of 7.6x to 14.6x with minimal accuracy loss (only 0.3% to 1.2% increase in PER).
  • Throughput: On a Xilinx KU060 FPGA, the system reached over 371,000 FPS for the Google LSTM model.

Conclusion

C-LSTM demonstrates that for hardware acceleration, the structure of data is as important as its volume. By enforcing block-circulant regularity, the framework enables massive parallelism and algorithmic efficiency that unstructured pruning cannot achieve. This approach paves the way for deploying large-scale, high-accuracy LSTMs on edge devices and embedded FPGAs.

Summary updated

BibTeX
@inproceedings{wang2018c,
  author = {Shuo Wang and Zhe Li and Caiwen Ding and Bo Yuan and Yanzhi Wang and Qinru Qiu and Yun Liang},
  title = {{C-LSTM: Enabling Efficient LSTM using Structured Compression Techniques on FPGAs}},
  booktitle = {FPGA},
  year = {2018},
  doi = {10.1145/3174243.3174253},
}
Figure