Skip to main content
QUICK REVIEW

[论文解读] Mix and Match: A Novel FPGA-Centric Deep Neural Network Quantization Framework

Sung-En Chang, Yanyu Li|arXiv (Cornell University)|Dec 8, 2020
Advanced Neural Network Applications参考文献 75被引用 7
一句话总结

本文提出了一种新颖的面向FPGA的DNN量化框架Mix and Match,该框架在权重矩阵的不同行上应用混合量化方案——幂次和(SP2)与定点量化,以充分利用异构FPGA资源。通过将量化方案与权重分布特性相匹配,该方法在保持或提升精度的同时,相较于仅使用DSP的实现,性能提升了2.1×–4.1×。

ABSTRACT

Deep Neural Networks (DNNs) have achieved extraordinary performance in various application domains. To support diverse DNN models, efficient implementations of DNN inference on edge-computing platforms, e.g., ASICs, FPGAs, and embedded systems, are extensively investigated. Due to the huge model size and computation amount, model compression is a critical step to deploy DNN models on edge devices. This paper focuses on weight quantization, a hardware-friendly model compression approach that is complementary to weight pruning. Unlike existing methods that use the same quantization scheme for all weights, we propose the first solution that applies different quantization schemes for different rows of the weight matrix. It is motivated by (1) the distribution of the weights in the different rows are not the same; and (2) the potential of achieving better utilization of heterogeneous FPGA hardware resources. To achieve that, we first propose a hardware-friendly quantization scheme named sum-of-power-of-2 (SP2) suitable for Gaussian-like weight distribution, in which the multiplication arithmetic can be replaced with logic shifter and adder, thereby enabling highly efficient implementations with the FPGA LUT resources. In contrast, the existing fixed-point quantization is suitable for Uniform-like weight distribution and can be implemented efficiently by DSP. Then to fully explore the resources, we propose an FPGA-centric mixed scheme quantization (MSQ) with an ensemble of the proposed SP2 and the fixed-point schemes. Combining the two schemes can maintain, or even increase accuracy due to better matching with weight distributions.

研究动机与目标

  • 为解决在FPGA上对所有DNN权重行统一应用量化方案所导致的效率低下问题。
  • 通过将量化方案与权重分布特性相匹配,充分利用FPGA中的异构资源——LUT与DSP。
  • 开发一种硬件感知的量化框架,以优化FPGA上DNN推理的精度、性能与资源利用率。
  • 实现高效、可参数化的GEMM架构,利用LUT与DSP支持混合精度计算。
  • 在多种DNN模型与FPGA平台下评估该框架,验证其在性能与精度方面的优越性。

提出的方法

  • 提出一种新型硬件友好的量化方案——幂次和(SP2),适用于高斯分布型权重,通过位移与加法操作实现高效的LUT基乘法。
  • 对均匀分布型权重使用定点量化,该方案可通过FPGA的DSP块高效实现。
  • 设计一种具有两个异构核心的可参数化GEMM架构:一个使用LUT处理SP2权重,另一个使用DSP处理定点权重。
  • 开发一种MSQ(混合方案量化)训练算法,基于FPGA资源特性,联合优化量化比例与模型精度。
  • 采用一种分区策略,根据权重分布特性与硬件效率,将不同权重行分配给SP2或定点量化方案。
  • 集成一种资源感知的训练循环,以最小化量化误差,同时满足FPGA资源约束并最大化吞吐量。
Figure 1: Quantization levels by fixed-point, power-of-2, and SP2 in 4-bit weight representation precision, and weight probability distribution of the 4th layer in MobileNet-V2.
Figure 1: Quantization levels by fixed-point, power-of-2, and SP2 in 4-bit weight representation precision, and weight probability distribution of the 4th layer in MobileNet-V2.

实验结果

研究问题

  • RQ1与统一量化方案相比,在DNN权重矩阵的不同行上应用不同量化方案,是否能提升FPGA推理性能?
  • RQ2如何有效利用SP2量化在FPGA实现中提升LUT资源利用率,以处理高斯分布型权重?
  • RQ3在FPGA上,SP2与定点量化方案在精度、性能与资源利用率之间应如何权衡以达到最优?
  • RQ4混合方案量化框架是否能在显著提升推理吞吐量的同时,保持或改善精度?
  • RQ5所提出的MSQ训练算法如何适应不同的权重分布与FPGA硬件约束?

主要发现

  • 所提出的Mix and Match框架在Zynq XC7Z020与XC7Z045 FPGA上相较仅使用DSP的实现,性能最高提升2.1×–4.1×。
  • 由于更优地匹配了权重分布特性,MSQ方案在精度上保持或优于基线量化方法。
  • 在XC7Z045与XC7Z020上,吞吐量分别达到549.3 FPS与493 GOPS,对应最优SP2/定点比例。
  • 在XC7Z045上,框架实现了5.747 GOPS/kLUT的LUT资源利用效率,展现出优异的LUT利用率。
  • 所提出的SP2量化方案实现了高效的LUT基乘法,降低了对DSP的依赖,提升了资源利用率。
  • 具有异构核心的可参数化GEMM架构支持灵活、高吞吐量的推理,适用于多种DNN模型。
Figure 2: Resource ratio of different FPGA devices. For each device, LUT, FF, and BRAM numbers are all normalized with respect to DSP number.
Figure 2: Resource ratio of different FPGA devices. For each device, LUT, FF, and BRAM numbers are all normalized with respect to DSP number.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。