通过等变性加速视觉Transformer,效率提升5倍以上。
Quick ViTs: Speeding up Vision Transformers through Equivariance
- 采用八重对称群的傅里叶域线性层实现旋转与镜像等变性。
- 相较普通线性层减少5.33倍计算量,内存降低8倍。
- 适合追求高效视觉模型的工程师和研究者。
自然图像具有显著的几何规律:边缘、角点、纹理等局部结构在多种方向和镜像配置中出现。由于视觉变压器(ViTs)处理方形图像块,这些变换自然对应于二面体群$Ω_8$(即八重群)。近期工作表明,通过在反射群的傅里叶域实现线性层,可使ViTs具备反射等变性,并同时提高效率。本文将等变性扩展至反射与旋转,并分析其可扩展性。基于八重等变线性层的Quick ViTs,在计算量上相比普通线性层减少5.33倍,内存降低最多8倍。通过分析这些层的算术强度,我们发现现代GPU上计算量节省带来的吞吐量提升存在理论极限,但该极限随嵌入维度增加而消失。得益于计算效率,我们进行了比以往更广泛的实验评估。在ImageNet-1K上进行监督(DeiT-III)和自监督(DINOv2)训练后,Quick ViTs在保持或超越基线精度的同时,实现显著的效率优势。
原文摘要 · Abstract (English)
Natural images exhibit strong geometric regularities: local structures, such as edges, corners, and textures, appear in many orientations and mirror configurations. Since Vision Transformers (ViTs) operate on square image patches, these transformations naturally correspond to the dihedral symmetry group $\mathrm{D}_8$, also known as the octic group. Recent work has shown that ViTs can be made reflection equivariant and more efficient than standard ViTs simultaneously by implementing the linear layers in the Fourier domain of the reflection group. In this work, we extend the equivariance to reflections and rotations and analyze the scalability of the resulting networks. Our Quick ViTs, based on octic equivariant linear layers, achieve 5.33x reductions in FLOPs and up to 8x reductions in memory compared to ordinary linear layers. By analyzing the arithmetic intensity of these layers, we identify theoretical limits on how much the FLOP savings translate into throughput improvements on modern GPUs. However, these limitations disappear as the embedding dimensions increase. Enabled by their computational efficiency, we conduct a broader empirical evaluation of equivariant ViTs than in previous work. Upon training supervised (DeiT-III) and self-supervised (DINOv2) on ImageNet-1K, we find that our Quick ViTs match or exceed baseline accuracy while at the same time providing substantial efficiency gains.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。