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

DS-Net++:动态权重切片,用于CNN和Transformers中的高效推理

DS-Net++: Dynamic Weight Slicing for Efficient Inference in CNNs and Transformers

Monash University(莫纳什大学);Oxford University(牛津大学);Alibaba Group(阿里巴巴集团);Sun Yat-sen University(中山大学);DarkMatter AI Research(暗物质人工智能研究院);Qilu University of Technology(齐鲁工业大学);RMIT University(皇家墨尔本理工大学)

Changlin Li, Guangrun Wang, Bing Wang, Xiaodan Liang, Zhihui Li, Xiaojun Chang

摘要:

动态网络在降低理论计算复杂度方面表现出了很好的能力,它可以在推理过程中根据输入调整其结构。然而,他们的实际运行时间通常落后于理论加速由于效率低下的稀疏。在这里,我们探索了一种硬件高效的动态推理机制,称为动态权重切片,它自适应地对具有不同难度水平的输入的一部分网络参数进行切片,同时保持参数静态和连续地存储在硬件中,以防止稀疏计算的额外负担。在此基础上,分别通过调整CNN的滤波器个数和CNN与Transformers的多个维度,提出了动态可瘦身网络(DS-Net)和动态可切片网络(DS-Net++)。为了保证子网的通用性和路由的公平性,提出了一种两阶段优化方案,分别对超网“与”门进行训练,并采用原地自举(IB)、多视图一致性(MvCo)和三明治门稀疏化(SGS)等训练技术.在4个数据集和3种不同网络架构上的大量实验表明,我们的方法始终优于最先进的静态和动态模型压缩方法的大幅度(高达6.6%)。通常情况下,DS-Net++在MobileNet、ResNet-50和视觉Transformer上实现2- 4倍的计算缩减和1.62倍的真实世界加速,而在ImageNet上的准确率下降最小(0.1-0.3%)。代码发布:https://github.com/changlin31/DS-Net

英文摘要:

Dynamic networks have shown their promising capability in reducing theoretical computation complexity by adapting their architectures to the input during inference. However, their practical runtime usually lags behind the theoretical acceleration due to inefficient sparsity. Here, we explore a hardware-efficient dynamic inference regime, named dynamic weight slicing, which adaptively slice a part of network parameters for inputs with diverse difficulty levels, while keeping parameters stored statically and contiguously in hardware to prevent the extra burden of sparse computation. Based on this scheme, we present dynamic slimmable network (DS-Net) and dynamic slice-able network (DS-Net++) by input-dependently adjusting filter numbers of CNNs and multiple dimensions in both CNNs and transformers, respectively. To ensure sub-network generality and routing fairness, we propose a disentangled two-stage optimization scheme with training techniques such as in-place bootstrapping (IB), multi-view consistency (MvCo) and sandwich gate sparsification (SGS) to train supernet and gate separately. Extensive experiments on 4 datasets and 3 different network architectures demonstrate our method consistently outperforms state-of-the-art static and dynamic model compression methods by a large margin (up to 6.6%). Typically, DS-Net++ achieves 2-4x computation reduction and 1.62x real-world acceleration over MobileNet, ResNet-50 and Vision Transformer, with minimal accuracy drops (0.1-0.3%) on ImageNet. Code release: https://github.com/changlin31/DS-Net

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

↑