Skip to main content
QUICK REVIEW

[论文解读] C-LSTM: Enabling Efficient LSTM using Structured Compression Techniques on FPGAs

Shuo Wang, Zhe Li|arXiv (Cornell University)|Mar 14, 2018
Music and Audio ProcessingComputer Science参考文献 25被引用 21
一句话总结

本文提出 C-LSTM,一种利用块循环矩阵压缩和基于 FFT 的计算来实现在 FPGA 上高效 LSTM 推理的框架。通过将非结构化的稀疏权重替换为结构化的密集块循环矩阵,该方法消除了不规则的内存访问和计算,与最先进的 FPGA 实现相比,性能最高提升 18.8 倍,能效提高 33.5 倍,且精度损失极小。

ABSTRACT

Recently, significant accuracy improvement has been achieved for acoustic recognition systems by increasing the model size of Long Short-Term Memory (LSTM) networks. Unfortunately, the ever-increasing size of LSTM model leads to inefficient designs on FPGAs due to the limited on-chip resources. The previous work proposes to use a pruning based compression technique to reduce the model size and thus speedups the inference on FPGAs. However, the random nature of the pruning technique transforms the dense matrices of the model to highly unstructured sparse ones, which leads to unbalanced computation and irregular memory accesses and thus hurts the overall performance and energy efficiency. In contrast, we propose to use a structured compression technique which could not only reduce the LSTM model size but also eliminate the irregularities of computation and memory accesses. This approach employs block-circulant instead of sparse matrices to compress weight matrices and reduces the storage requirement from $\mathcal{O}(k^2)$ to $\mathcal{O}(k)$. Fast Fourier Transform algorithm is utilized to further accelerate the inference by reducing the computational complexity from $\mathcal{O}(k^2)$ to $\mathcal{O}(k ext{log}k)$. The datapath and activation functions are quantized as 16-bit to improve the resource utilization. More importantly, we propose a comprehensive framework called C-LSTM to automatically optimize and implement a wide range of LSTM variants on FPGAs. According to the experimental results, C-LSTM achieves up to 18.8X and 33.5X gains for performance and energy efficiency compared with the state-of-the-art LSTM implementation under the same experimental setup, and the accuracy degradation is very small.

研究动机与目标

  • 解决由于非结构化剪枝导致的 LSTM 模型在 FPGA 上的不规则内存访问和计算不平衡问题。
  • 通过块循环矩阵压缩,将 LSTM 权重存储从 O(k²) 减少到 O(k),克服 FPGA 片上内存限制。
  • 通过结合结构化压缩与 FFT 加速的矩阵乘法,实现在 FPGA 上高性能、高能效的 LSTM 部署。
  • 开发一个自动框架,以最小的手动工作量优化并综合多种 LSTM 变体的 FPGA 部署。
  • 在保持高模型精度的前提下,显著提升与现有基于 FPGA 的 LSTM 加速器相比的性能和能效。

提出的方法

  • 将密集的 LSTM 权重矩阵替换为块循环矩阵,通过每个块仅用一个向量表示,将存储复杂度从 O(k²) 降低到 O(k)。
  • 应用快速傅里叶变换(FFT)以加速块循环矩阵乘法,将计算复杂度从 O(k²) 降低到 O(k log k)。
  • 将激活函数量化为 16 位定点表示,并使用 22 段分段线性逼近,相比查找表可显著降低资源使用。
  • 设计硬件友好的、规则的数据流,支持流水线并行执行循环卷积,避免不规则的内存访问模式。
  • 集成基于高层次综合(HLS)的自动框架,为多种 LSTM 架构生成优化的、可综合的 C++ 代码。
  • 采用带结构化稀疏性的迭代训练,在压缩过程中保持模型精度,平衡压缩率与推理性能。

实验结果

研究问题

  • RQ1使用块循环矩阵的结构化压缩能否消除非结构化稀疏剪枝在 FPGA 上 LSTM 模型中固有的不规则计算与内存访问模式?
  • RQ2基于 FFT 的循环矩阵乘法加速在 FPGA 加速的 LSTM 中,能在多大程度上提升计算效率并减少资源使用?
  • RQ3与最先进的基于 FPGA 的 LSTM 加速器相比,所提出的 C-LSTM 框架在性能、能效和精度方面表现如何?
  • RQ4该框架能否在无需手动调优的情况下,自动为多种 LSTM 变体生成高性能、资源高效的 FPGA 实现?
  • RQ5在 LSTM 中使用块循环压缩时,模型压缩、计算效率与精度损失之间的权衡关系如何?

主要发现

  • 在 KU060 FPGA 平台,C-LSTM 对 Small LSTM 模型的性能最高提升 19.3 倍,能效提升 35.9 倍,相比 ESE 基线。
  • 在 ADM-7V3 平台,C-LSTM 实现了 17.5 倍的性能提升和 31.9 倍的性能提升,分别对应 34.2 倍和 59.4 倍的能效增益。
  • Small LSTM 模型的精度损失仅为 0.29%(FFT8)和 1.16%(FFT16),表明对模型质量的影响极小。
  • 在相同条件下,C-LSTM 框架相比最先进的 FPGA LSTM 实现,性能最高提升 18.8 倍,能效提高 33.5 倍。
  • 基于 FFT 的循环卷积将计算复杂度从 O(k²) 降低到 O(k log k),实现了更快的推理速度和更低的资源利用率。
  • 该框架的自动综合流水线成功为多种 LSTM 变体生成了优化的、可综合的 C++ 代码,显著减少了开发时间和人工工作量。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。