融合深度卷积与逐点卷积以在 GPU 上实现高效推理
Fusing Depthwise and Pointwise Convolutions for Efficient Inference on GPUs
AI总结:
针对 GPU 上深度卷积与逐点卷积内存访问瓶颈,提出 FCM 融合内核及 FusePlanner 规划器,显著降低访存、提升推理速度与能效。
摘要:
与标准卷积相比,深度卷积和逐点卷积具有更少的参数并执行更少的运算。因此,它们越来越多地用于各种紧凑 DNN,包括卷积神经网络(CNN)和视觉 Transformer(ViT)。然而,它们的计算与内存访问比低于标准卷积,导致其内存访问通常成为性能瓶颈。本文探索融合深度卷积和逐点卷积,以克服内存访问瓶颈,重点是在 GPU 上融合这些算子。基于 GPU 的融合现有技术存在以下一个或多个问题:(1)仅融合一个卷积与一个逐元素算子或多个非卷积算子;(2)未显式针对内存访问进行优化;(3)不支持深度卷积。本文提出 Fused Convolutional Modules(FCM,融合卷积模块),这是一组新颖的深度卷积与逐点卷积融合 GPU 内核。FCM 显著减少逐点卷积和深度卷积的内存访问,从而改善执行时间和能效。为评估融合相关的权衡,并确定哪些卷积适合融合以及最优 FCM 参数,我们提出 FusePlanner。FusePlanner 包含成本模型,可根据 GPU 特性估计深度卷积、逐点卷积和 FCM 内核的内存访问。我们在三款 GPU 上使用具有代表性的 CNN 和 ViT 进行实验,结果表明,与 cuDNN 相比,FCM 最多可节省 83% 的内存访问,并实现最高 3.7 倍的加速。使用我们模块实现的多种 CNN 完整模型优于 TVM 的实现,加速最高达 1.8 倍,并节省至多三分之二的能耗。FCM 和 FusePlanner 的实现已开源:https://github.com/fqararyah/Fusing_DW_and_PW_on_GPUs。
英文摘要:
Depthwise and pointwise convolutions have fewer parameters and perform fewer operations than standard convolutions. As a result, they have become increasingly used in various compact DNNs, including convolutional neural networks (CNNs) and vision transformers (ViTs). However, they have a lower compute-to-memory-access ratio than standard convolutions, making their memory accesses often the performance bottleneck. This paper explores fusing depthwise and pointwise convolutions to overcome the memory access bottleneck. The focus is on fusing these operators on GPUs. The prior art on GPU-based fusion suffers from one or more of the following: (1) fusing either a convolution with an element-wise or multiple non-convolutional operators, (2) not explicitly optimizing for memory accesses, (3) not supporting depthwise convolutions. This paper proposes Fused Convolutional Modules (FCMs), a set of novel fused depthwise and pointwise GPU kernels. FCMs significantly reduce pointwise and depthwise convolutions memory accesses, improving execution time and energy efficiency. To evaluate the trade-offs associated with fusion and determine which convolutions are beneficial to fuse and the optimal FCM parameters, we propose FusePlanner. FusePlanner consists of cost models to estimate the memory accesses of depthwise, pointwise, and FCM kernels given GPU characteristics. Our experiments on three GPUs using representative CNNs and ViTs demonstrate that FCMs save up to 83\% of the memory accesses and achieve speedups of up to 3.7x compared to cuDNN. Complete model implementations of various CNNs using our modules outperform TVMs' achieving speedups of up to 1.8x and saving up to two-thirds of the energy. FCM and FusePlanner implementations are open source: https://github.com/fqararyah/Fusing_DW_and_PW_on_GPUs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。