计算机科学
瓶颈
矩阵乘法
延迟(音频)
移动设备
计算机工程
推论
乘法(音乐)
分布式计算
人工智能
嵌入式系统
操作系统
物理
量子
电信
量子力学
声学
作者
Abdelrahman Shaker,Muhammad Maaz,Hanoona Rasheed,Salman Khan,Ming–Hsuan Yang,Fahad Shahbaz Khan
标识
DOI:10.1109/iccv51070.2023.01598
摘要
Self-attention has become a defacto choice for capturing global context in various vision applications. However, its quadratic computational complexity with respect to image resolution limits its use in real-time applications, especially for deployment on resource-constrained mobile devices. Although hybrid approaches have been proposed to combine the advantages of convolutions and self-attention for a better speed-accuracy trade-off, the expensive matrix multiplication operations in self-attention remain a bottleneck. In this work, we introduce a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations with linear element-wise multiplications. Our design shows that the key-value interaction can be replaced with a linear layer without sacrificing any accuracy. Unlike previous state-of-the-art methods, our efficient formulation of self-attention enables its usage at all stages of the network. Using our proposed efficient additive attention, we build a series of models called "SwiftFormer" which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Our small variant achieves 78.5% top-1 ImageNet-1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2× faster compared to MobileViT-v2. Our code and models: https://tinyurl.com/5ft8v46w
科研通智能强力驱动
Strongly Powered by AbleSci AI