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

LPViT: 面向视觉Transformer的低功耗半结构化剪枝

LPViT: Low-Power Semi-structured Pruning for Vision Transformers

College of Computing and Data Science (CCDS), Nanyang Technological University (NTU)(南洋理工大学计算与数据科学学院)

Kaixin Xu, Zhe Wang, Chunyun Chen, Xue Geng, Jie Lin, Mohamed M. Sabry Aly, Xulei Yang, Min Wu, Xiaoli Li, Weisi Lin

AI总结:

针对视觉Transformer(ViT)的资源密集问题,本文提出块结构化剪枝方法LPViT,通过硬件感知学习目标和轻量级训练后剪枝算法,在ImageNet实验中实现精度与功耗/加速比的平衡,DeiT-B在专用硬件和GPU上获3.93倍加速比,GPU功耗降1.4倍。

摘要:

视觉Transformer(ViT)已成为卷积神经网络在各类图像分析任务中的有力替代方案,性能相当或更优。然而,ViT的一大显著缺点是资源密集性,导致内存占用、计算复杂度和功耗增加。为普及这一高性能技术并提升其环保性,压缩ViT模型、降低资源需求同时保持高性能至关重要。本文提出一种新的块结构化剪枝方法,解决ViT的资源密集问题,在精度与硬件加速间实现平衡权衡。与非结构化剪枝或通道级结构化剪枝不同,块剪枝利用线性层的块结构,实现更高效的矩阵乘法。为优化该剪枝方案,本文提出新颖的硬件感知学习目标,在推理时同时最大化加速比并最小化功耗,且针对块稀疏结构进行定制。该目标无需经验查找表,仅专注于减少参数化层连接。此外,本文提供轻量级算法实现ViT的训练后剪枝,利用二阶泰勒近似和经验优化求解所提硬件感知目标。在ImageNet上对DeiT-B和DeiT-S等多种ViT架构开展大量实验,结果表明,该方法与其他剪枝方法性能相当,在精度保留与功耗节省间实现出色平衡。特别地,DeiT-B在专用硬件和GPU上分别实现3.93倍加速比,在GPU上功耗降低1.4倍。代码已发布至https://github.com/Akimoto-Cris/LPViT。

英文摘要:

Vision transformers have emerged as a promising alternative to convolutional neural networks for various image analysis tasks, offering comparable or superior performance. However, one significant drawback of ViTs is their resource-intensive nature, leading to increased memory footprint, computation complexity, and power consumption. To democratize this high-performance technology and make it more environmentally friendly, it is essential to compress ViT models, reducing their resource requirements while maintaining high performance. In this paper, we introduce a new block-structured pruning to address the resource-intensive issue for ViTs, offering a balanced trade-off between accuracy and hardware acceleration. Unlike unstructured pruning or channel-wise structured pruning, block pruning leverages the block-wise structure of linear layers, resulting in more efficient matrix multiplications. To optimize this pruning scheme, our paper proposes a novel hardware-aware learning objective that simultaneously maximizes speedup and minimizes power consumption during inference, tailored to the block sparsity structure. This objective eliminates the need for empirical look-up tables and focuses solely on reducing parametrized layer connections. Moreover, our paper provides a lightweight algorithm to achieve post-training pruning for ViTs, utilizing second-order Taylor approximation and empirical optimization to solve the proposed hardware-aware objective. Extensive experiments on ImageNet are conducted across various ViT architectures, including DeiT-B and DeiT-S, demonstrating competitive performance with other pruning methods and achieving a remarkable balance between accuracy preservation and power savings. Especially, we achieve 3.93x speedup on dedicated hardware and GPUs respectively for DeiT-B, and a power reduction by 1.4x on GPUs. Code released to https://github.com/Akimoto-Cris/LPViT.

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

↑