arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.06004cs.CVcs.AIstat.ML
收藏

内存高效的视觉Transformer:一种激活感知的混合秩压缩策略

Memory-Efficient Vision Transformers: An Activation-Aware Mixed-Rank Compression Strategy

University of Southern California(南加利福尼亚大学)

Seyedarmin Azizi, Mahdi Nazemi, Massoud Pedram

AI总结:

针对ViT内存占用大的问题,提出激活感知混合秩压缩策略,通过低秩分解和逐层误差补偿,在ImageNet上将DeiT-B参数减少60%且精度损失小于1%,并可将大模型压缩至小模型尺寸同时提升精度。

摘要:

随着Vision Transformers(ViTs)在计算机视觉领域不断刷新基准,它们在实际推理引擎上的部署常常受到其显著的内存带宽和(片上)内存占用需求的阻碍。本文通过引入一种激活感知的模型压缩方法来解决这一内存限制,该方法利用不同层的选择性低秩权重张量近似来减少ViTs的参数数量。关键思想是将权重张量分解为两个参数高效张量之和,同时最小化输入激活与原始权重张量的乘积和输入激活与近似张量和的乘积之间的误差。这种近似通过采用一种高效的逐层误差补偿技术进一步细化,该技术利用层输出损失的梯度。这些技术的结合取得了优异的结果,同时避免了在优化过程早期陷入浅层局部最小值,并在模型压缩和输出精度之间取得了良好的平衡。值得注意的是,所提出的方法在ImageNet数据集上将DeiT-B的参数数量显著减少了60%,精度下降不到1%,克服了低秩近似中常见的精度退化问题。此外,所提出的压缩技术可以将大型DeiT/ViT模型压缩到与较小的DeiT/ViT变体大致相同的模型大小,同时获得高达1.8%的精度提升。这些结果凸显了我们方法的有效性,为在内存受限环境中嵌入ViTs而不损害其性能提供了一种可行的解决方案。

英文摘要:

As Vision Transformers (ViTs) increasingly set new benchmarks in computer vision, their practical deployment on inference engines is often hindered by their significant memory bandwidth and (on-chip) memory footprint requirements. This paper addresses this memory limitation by introducing an activation-aware model compression methodology that uses selective low-rank weight tensor approximations of different layers to reduce the parameter count of ViTs. The key idea is to decompose the weight tensors into a sum of two parameter-efficient tensors while minimizing the error between the product of the input activations with the original weight tensor and the product of the input activations with the approximate tensor sum. This approximation is further refined by adopting an efficient layer-wise error compensation technique that uses the gradient of the layer's output loss. The combination of these techniques achieves excellent results while it avoids being trapped in a shallow local minimum early in the optimization process and strikes a good balance between the model compression and output accuracy. Notably, the presented method significantly reduces the parameter count of DeiT-B by 60% with less than 1% accuracy drop on the ImageNet dataset, overcoming the usual accuracy degradation seen in low-rank approximations. In addition to this, the presented compression technique can compress large DeiT/ViT models to have about the same model size as smaller DeiT/ViT variants while yielding up to 1.8% accuracy gain. These results highlight the efficacy of our approach, presenting a viable solution for embedding ViTs in memory-constrained environments without compromising their performance.

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

↑