arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.14047cs.DCcs.ARcs.CV
收藏

通过静态与动态剪枝在FPGA上加速ViT推理

Accelerating ViT Inference on FPGA through Static and Dynamic Pruning

University of Southern California(南加州大学);DEVCOM Army Research Office(DEVCOM陆军研究办公室)

Dhruv Parikh, Shouyi Li, Bingyi Zhang, Rajgopal Kannan, Carl Busart, Viktor Prasanna

AI总结:

针对ViT计算复杂度高、静态与动态剪枝简单整合会导致计算不规则且准确率下降的问题,提出算法-硬件协同设计方案,结合硬件感知结构化块剪枝与动态token剪枝并设计训练算法恢复精度,同时开发带负载均衡的多级并行FPGA加速器及实时token剪枝硬件机制,实现高效推理加速。

摘要:

视觉Transformer(ViTs)已在多种计算机视觉任务上取得了当前最优的准确率。然而,其极高的计算复杂度导致它们无法应用于众多现实场景。权重剪枝和token剪枝是两种公认的降低复杂度的方法:权重剪枝可缩减模型规模及相应的计算需求,而token剪枝则能根据输入进一步动态减少计算量。将这两种技术结合本应大幅降低计算复杂度与模型规模,但简单直接地整合二者会产生不规则的计算模式,进而导致准确率显著下降,且难以进行硬件加速。\n针对上述挑战,我们提出了一种算法-硬件协同设计的综合方案,通过同步剪枝——结合静态权重剪枝与动态token剪枝——在FPGA上加速ViT。在算法设计方面,我们系统地结合了一种面向硬件的结构化块剪枝方法(用于剪枝模型参数)与一种动态token剪枝方法(用于移除不重要的token向量)。此外,我们设计了一种全新的训练算法以恢复模型准确率。在硬件设计方面,我们开发了一款新型硬件加速器来执行剪枝后的模型。所提出的硬件设计采用带负载均衡策略的多级并行机制,可高效应对两种剪枝方法带来的不规则计算模式。此外,我们还开发了一种高效的硬件机制,用于高效执行实时token剪枝。

英文摘要:

Vision Transformers (ViTs) have achieved state-of-the-art accuracy on various computer vision tasks. However, their high computational complexity prevents them from being applied to many real-world applications. Weight and token pruning are two well-known methods for reducing complexity: weight pruning reduces the model size and associated computational demands, while token pruning further dynamically reduces the computation based on the input. Combining these two techniques should significantly reduce computation complexity and model size; however, naively integrating them results in irregular computation patterns, leading to significant accuracy drops and difficulties in hardware acceleration. Addressing the above challenges, we propose a comprehensive algorithm-hardware codesign for accelerating ViT on FPGA through simultaneous pruning -combining static weight pruning and dynamic token pruning. For algorithm design, we systematically combine a hardware-aware structured block-pruning method for pruning model parameters and a dynamic token pruning method for removing unimportant token vectors. Moreover, we design a novel training algorithm to recover the model's accuracy. For hardware design, we develop a novel hardware accelerator for executing the pruned model. The proposed hardware design employs multi-level parallelism with load balancing strategy to efficiently deal with the irregular computation pattern led by the two pruning approaches. Moreover, we develop an efficient hardware mechanism for efficiently executing the on-the-fly token pruning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑