[论文解读] FLightNNs: Lightweight Quantized Deep Neural Networks for Fast and Accurate Inference
FLightNNs 在轻量级量化神经网络中引入了一种可微的、按滤波器的 k 值选择机制,实现了对每个卷积滤波器的移位-累加操作(k ∈ {1,2})的动态优化。该方法实现了连续的精度-延迟-能耗权衡,在仅造成 0.1% 精度下降的情况下,相比固定 k 值的 LightNN,FPGA 和 ASIC 平台上实现了最高 2 倍的加速,且在速度和精度上均优于 4 位定点量化。
To improve the throughput and energy efficiency of Deep Neural Networks (DNNs) on customized hardware, lightweight neural networks constrain the weights of DNNs to be a limited combination (denoted as $k\in\{1,2\}$) of powers of 2. In such networks, the multiply-accumulate operation can be replaced with a single shift operation, or two shifts and an add operation. To provide even more design flexibility, the $k$ for each convolutional filter can be optimally chosen instead of being fixed for every filter. In this paper, we formulate the selection of $k$ to be differentiable, and describe model training for determining $k$-based weights on a per-filter basis. Over 46 FPGA-design experiments involving eight configurations and four data sets reveal that lightweight neural networks with a flexible $k$ value (dubbed FLightNNs) fully utilize the hardware resources on Field Programmable Gate Arrays (FPGAs), our experimental results show that FLightNNs can achieve 2$ imes$ speedup when compared to lightweight NNs with $k=2$, with only 0.1\% accuracy degradation. Compared to a 4-bit fixed-point quantization, FLightNNs achieve higher accuracy and up to 2$ imes$ inference speedup, due to their lightweight shift operations. In addition, our experiments also demonstrate that FLightNNs can achieve higher computational energy efficiency for ASIC implementation.
研究动机与目标
- 为解决现有轻量级量化网络(如 LightNN-1 和 LightNN-2)存在的离散帕累托前沿问题,该问题限制了精度、延迟和能效之间的细粒度权衡。
- 实现对每个滤波器的移位-累加操作数量(k ∈ {1,2})的优化,以实现更灵活、连续的硬件资源权衡。
- 开发一种可微训练方法,使网络权重和 k 值能够使用标准 SGD 进行端到端联合优化。
- 在 FPGA 和 ASIC 平台上,与固定 k 值和 4 位量化模型相比,展示出更高的推理速度、能效和精度。
提出的方法
- 将每个卷积滤波器的 k 值选择建模为可微优化问题,支持使用随机梯度下降(SGD)进行端到端训练。
- 为每个滤波器引入一组可学习的离散 k 值 {k₁, ..., k_F},其中每个 k_i ∈ {1,2},用于控制用于替代乘法的移位-累加操作次数。
- 使用对离散 k 选择过程的可微松弛,以在反向传播中实现梯度流动,从而实现权重和 k 值的联合优化。
- 在 FPGA 和 ASIC 上实现最终的 FLightNN 模型,采用流水线化、硬件友好的设计,配备基于移位的计算单元。
- 在八个配置和四个数据集上开展广泛的 FPGA 实验,以评估吞吐量、精度和资源利用率。
- 使用 65nm 标准单元库进行 ASIC 仿真,以评估计算能耗与精度的权衡。
实验结果
研究问题
- RQ1在轻量级量化网络中,按滤波器的 k 值选择能否实现更连续、更灵活的精度-延迟-能耗帕累托前沿?
- RQ2可微训练方法能否有效实现网络权重和 k 值(k ∈ {1,2})的端到端联合优化?
- RQ3FLightNN 在 FPGA 和 ASIC 平台上是否相比固定 k 值的 LightNN 和 4 位定点量化模型,实现了更高的推理速度和能效?
- RQ4FLightNN 是否在保持硬件效率的同时,优于 LightNN-1 和 LightNN-2 的精度和能效表现?
主要发现
- 在 FPGA 上,FLightNN 相比固定 k 值的 LightNN-2 实现了最高 2 倍的加速,仅造成 0.1% 的精度下降,证明了其优越的推理效率。
- 在 FPGA 上,FLightNN 的吞吐量高于 4 位定点量化,最高实现 2 倍加速,且精度更优。
- FLightNN 在精度与能耗/延迟之间提供了更连续的帕累托前沿,在所有测试数据集和网络架构上均优于 LightNN-1 和 LightNN-2。
- ASIC 仿真结果表明,FLightNN 的计算能耗低于 LightNN-1 和 LightNN-2,在某些情况下精度更高。
- FLightNN 将精度-存储帕累托前沿推至超过 LightNN-1 和 LightNN-2 的范围,表明其具备更大的有效设计空间。
- 可微训练方法实现了高效、端到端的优化,无需迭代或启发式搜索,显著降低了训练开销。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。