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

面向视觉Transformer端侧训练的块选择性重编程

Block Selective Reprogramming for On-device Training of Vision Transformers

Universiy of Southern California(南加利福尼亚大学);Intel Labs(英特尔实验室)

Sreetama Sarkar, Souvik Kundu, Kai Zheng, Peter A. Beerel

AI总结:

针对边缘设备端侧训练视觉Transformer内存与算力不足的问题,提出块选择性重编程方法,仅微调部分模型块并结合冻结层注意力分数丢弃token,在保精度的同时显著降低训练内存与计算成本,还适用于多任务MoE模型场景。

摘要:

视觉Transformer(ViTs)在个性化学习等各类边缘应用中的普及,催生了端侧微调的需求。然而,边缘设备的内存与计算能力有限,开展训练仍是一项重大挑战。具体而言,训练所需内存远高于推理,主要原因是为了计算权重更新所需的梯度,需要存储所有层的激活值。已有研究探索了通过冻结权重训练以及以压缩格式存储激活值来降低内存需求,但这些方法因无法提升训练或推理速度而被认为效率低下。本文首先研究了现有旨在降低内存与计算需求的端侧训练方法的局限性,随后提出块选择性重编程(BSR)方法:仅微调预训练模型总块数的一部分,并基于冻结层的自注意力分数选择性丢弃token。为验证BSR的有效性,我们在ViT-B和DeiT-S上结合5个不同数据集开展了大量评估。与现有替代方案相比,我们的方法在保持相近精度的同时,训练内存最多降低1.4倍,计算成本最多降低2倍。我们还展示了在混合专家(MoE)模型上的结果,证明了该方法在多任务学习场景下的有效性。

英文摘要:

The ubiquity of vision transformers (ViTs) for various edge applications, including personalized learning, has created the demand for on-device fine-tuning. However, training with the limited memory and computation power of edge devices remains a significant challenge. In particular, the memory required for training is much higher than that needed for inference, primarily due to the need to store activations across all layers in order to compute the gradients needed for weight updates. Previous works have explored reducing this memory requirement via frozen-weight training as well storing the activations in a compressed format. However, these methods are deemed inefficient due to their inability to provide training or inference speedup. In this paper, we first investigate the limitations of existing on-device training methods aimed at reducing memory and compute requirements. We then present block selective reprogramming (BSR) in which we fine-tune only a fraction of total blocks of a pre-trained model and selectively drop tokens based on self-attention scores of the frozen layers. To show the efficacy of BSR, we present extensive evaluations on ViT-B and DeiT-S with five different datasets. Compared to the existing alternatives, our approach simultaneously reduces training memory by up to 1.4x and compute cost by up to 2x while maintaining similar accuracy. We also showcase results for Mixture-of-Expert (MoE) models, demonstrating the effectiveness of our approach in multitask learning scenarios.

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

↑