Once for Both: Single Stage of Importance and Sparsity Search for Vision Transformer Compression
School of Information Science and Technology, Fudan University(复旦大学信息科学与技术学院);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Academy for Engineering and Technology, Fudan University(复旦大学工程技术学院);Shanghai Jiao Tong University(上海交通大学);Tsinghua University(清华大学)
Hancheng Ye, Chong Yu, Peng Ye, Renqiu Xia, Yansong Tang, Jiwen Lu, Tao Chen, Bo Zhang
备注:
Accepted by CVPR 2024. Our code will be available at www.github.com/HankYe/Once-for-Both
近期的视觉Transformer压缩(VTC)工作主要遵循两阶段方案,首先在每个子模块中评估或预设每个模型单元的重要性分数,随后根据目标稀疏性约束评估稀疏性分数。这种分离的评估过程导致重要性分数与稀疏性分数分布之间产生差距,从而给VTC造成高昂的搜索成本。在本工作中,我们首次研究如何将重要性分数与稀疏性分数的评估整合到单一阶段中,以高效的方式搜索最优子网。具体而言,我们提出OFB,一种同时评估重要性分数和可微稀疏性分数的成本高效方法,称为Once for Both(OFB),用于VTC。首先,通过将重要性分数与可微稀疏性分数纠缠以共同决定每个单元的剪枝潜力(prunability),开发出双掩码方案。这种双掩码搜索策略进一步与提出的自适应独热损失结合使用,以实现最重要子网的渐进且高效的搜索。最后,提出渐进式掩码图像建模(PMIM),在搜索过程中对特征空间进行正则化使其更具代表性,因为特征空间可能因维度降低而退化。大量实验表明,OFB在各种视觉Transformer架构下能够实现优于基于搜索和基于剪枝的最先进方法的压缩性能,同时显著提升搜索效率,例如在ImageNet-1K上压缩DeiT-S仅需一个GPU搜索日。
英文摘要:
Recent Vision Transformer Compression (VTC) works mainly follow a two-stage scheme, where the importance score of each model unit is first evaluated or preset in each submodule, followed by the sparsity score evaluation according to the target sparsity constraint. Such a separate evaluation process induces the gap between importance and sparsity score distributions, thus causing high search costs for VTC. In this work, for the first time, we investigate how to integrate the evaluations of importance and sparsity scores into a single stage, searching the optimal subnets in an efficient manner. Specifically, we present OFB, a cost-efficient approach that simultaneously evaluates both importance and sparsity scores, termed Once for Both (OFB), for VTC. First, a bi-mask scheme is developed by entangling the importance score and the differentiable sparsity score to jointly determine the pruning potential (prunability) of each unit. Such a bi-mask search strategy is further used together with a proposed adaptive one-hot loss to realize the progressive-and-efficient search for the most important subnet. Finally, Progressive Masked Image Modeling (PMIM) is proposed to regularize the feature space to be more representative during the search process, which may be degraded by the dimension reduction. Extensive experiments demonstrate that OFB can achieve superior compression performance over state-of-the-art searching-based and pruning-based methods under various Vision Transformer architectures, meanwhile promoting search efficiency significantly, e.g., costing one GPU search day for the compression of DeiT-S on ImageNet-1K.
Exploiting Kernel Sparsity and Entropy for Interpretable CNN Compression
Fujian Key Laboratory of Sensing and Computing for Smart City, Department of Cognitive ScienceSchool of Information Science and Engineering, Xiamen University(厦门大学信息科学与技术学院认知科学系智能城市感知与计算福建省重点实验室);Beihang University(北京航空航天大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);University at Buffalo(布法罗大学);BestImage, Tencent Technology (Shanghai) Co.,Ltd(腾讯科技(上海)有限公司);Peng Cheng Laboratory(鹏城实验室)
A Novel Compression Framework for YOLOv8: Achieving Real-Time Aerial Object Detection on Edge Devices via Structured Pruning and Channel-Wise Distillation
Malek Ashtar University of Technology(马利克·阿什塔尔理工大学)
Boost Vision Transformer with GPU-Friendly Sparsity and Quantization
Academy for Engineering and Technology, Fudan University(复旦大学工程与应用技术研究院);NVIDIA Corporation(英伟达公司);School for Information Science and Technology, Fudan University(复旦大学信息科学与工程学院)