arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.09708cs.CVcs.LG
收藏

ELSA:利用逐层N:M稀疏性实现视觉Transformer加速

ELSA: Exploiting Layer-wise N:M Sparsity for Vision Transformer Acceleration

National Yang Ming Chiao Tung University(国立阳明交通大学);University of Texas at Austin(德克萨斯大学奥斯汀分校)

Ning-Chi Huang, Chi-Chih Chang, Wei-Cheng Lin, Endri Taka, Diana Marculescu, Kai-Chiang Wu

AI总结:

针对视觉Transformer逐层定制N:M稀疏配置方法匮乏的问题,提出ELSA方法,兼顾加速器支持的稀疏等级与吞吐量,以极小精度损失实现ViT的内存与推理效率提升,在ImageNet上使Swin-B、DeiT-B的FLOPs降低2.9倍。

摘要:

N:M稀疏性是一种新兴的模型压缩方法,正得到越来越多加速器的支持,用于加速深度神经网络中的稀疏矩阵乘法。现有大多数N:M稀疏性方法对网络中所有层采用统一设置来压缩神经网络,或是通过考量每层的参数量启发式地确定逐层配置。然而,针对视觉Transformer(ViTs)获取逐层定制化N:M稀疏配置的方法仍十分匮乏,而ViT通常由参数量相同的Transformer块构成。为解决在支持N:M稀疏性的加速器上为ViT选择合适稀疏配置的难题,本文提出ELSA(Exploiting Layer-wise N:M Sparsity for ViTs,面向视觉Transformer的逐层N:M稀疏性利用方法)。该方法不仅考虑给定加速器支持的所有N:M稀疏等级,还兼顾预期的吞吐量提升,通过以可忽略的精度损失换取ViT模型的内存占用与推理时间降低,充分发挥支持混合稀疏性的加速器的优势。例如,该方法在ImageNet数据集上,使Swin-B和DeiT-B的浮点运算量(FLOPs)均实现了显著的2.9倍降低,而精度仅出现边际下降。本文代码将在论文录用后公开。

英文摘要:

$N{:}M$ sparsity is an emerging model compression method supported by more and more accelerators to speed up sparse matrix multiplication in deep neural networks. Most existing $N{:}M$ sparsity methods compress neural networks with a uniform setting for all layers in a network or heuristically determine the layer-wise configuration by considering the number of parameters in each layer. However, very few methods have been designed for obtaining a layer-wise customized $N{:}M$ sparse configuration for vision transformers (ViTs), which usually consist of transformer blocks involving the same number of parameters. In this work, to address the challenge of selecting suitable sparse configuration for ViTs on $N{:}M$ sparsity-supporting accelerators, we propose ELSA, Exploiting Layer-wise $N{:}M$ Sparsity for ViTs. Considering not only all $N{:}M$ sparsity levels supported by a given accelerator but also the expected throughput improvement, our methodology can reap the benefits of accelerators supporting mixed sparsity by trading off negligible accuracy loss with both memory usage and inference time reduction for ViT models. For instance, our approach achieves a noteworthy 2.9$\times$ reduction in FLOPs for both Swin-B and DeiT-B with only a marginal degradation of accuracy on ImageNet. Our code will be released upon paper acceptance.

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

↑