[论文解读] Escoin: Efficient Sparse Convolutional Neural Network Inference on GPUs
本文提出 Escort,一种针对 GPU 的直接稀疏卷积方法,通过绕过矩阵乘法降级来提升推理速度。通过针对不规则稀疏计算优化并行度与数据局部性,Escort 在 NVIDIA GPU 上相较 CUSPARSE 实现 3.07× 的加速,相较 CUBLAS 实现 1.60× 的加速,无需硬件或框架改动即可将稀疏性转化为性能提升。
Deep neural networks have achieved remarkable accuracy in many artificial intelligence applications, e.g. computer vision, at the cost of a large number of parameters and high computational complexity. Weight pruning can compress DNN models by removing redundant parameters in the networks, but it brings sparsity in the weight matrix, and therefore makes the computation inefficient on GPUs. Although pruning can remove more than 80% of the weights, it actually hurts inference performance (speed) when running models on GPUs. Two major problems cause this unsatisfactory performance on GPUs. First, lowering convolution onto matrix multiplication reduces data reuse opportunities and wastes memory bandwidth. Second, the sparsity brought by pruning makes the computation irregular, which leads to inefficiency when running on massively parallel GPUs. To overcome these two limitations, we propose Escort, an efficient sparse convolutional neural networks on GPUs. Instead of using the lowering method, we choose to compute the sparse convolutions directly. We then orchestrate the parallelism and locality for the direct sparse convolution kernel, and apply customized optimization techniques to further improve performance. Evaluation on NVIDIA GPUs show that Escort can improve sparse convolution speed by 2.63x and 3.07x, and inference speed by 1.43x and 1.69x, compared to CUBLAS and CUSPARSE respectively.
研究动机与目标
- 为解决权重剪枝导致的稀疏卷积神经网络在 GPU 上推理性能下降的问题。
- 克服将稀疏卷积降级为矩阵乘法所导致的低效问题,避免内存带宽浪费与数据重用率降低。
- 通过优化并行度与内存访问模式,直接计算稀疏卷积以提升 GPU 性能。
- 证明在现代 GPU 架构中,稀疏性可被用于实现加速而非性能损失。
- 提供一种纯软件解决方案,无需修改模型训练、剪枝过程或底层硬件。
提出的方法
- 提出一种直接稀疏卷积核,无需将卷积降级为矩阵乘法,避免冗余数据复制与内存带宽浪费。
- 协调线程级与数据级并行,以最大化 GPU 占用率并隐藏内存延迟。
- 通过合并内存访问与组织线程块以访问连续数据段,提升数据局部性。
- 采用与稀疏权重结构对齐的自定义内核布局,以最小化不规则内存访问模式。
- 应用循环分块与寄存器分块技术,提升算术强度并减少全局内存事务。
- 在 CUDA 中实现该方案,并在 Tesla P100 与 GTX 1080Ti GPU 上,使用 AlexNet、GoogLeNet 与 ResNet 等标准 CNN 模型进行评估。
实验结果
研究问题
- RQ1在剪枝的 DNN 上,直接稀疏卷积是否能在 GPU 上超越基于矩阵乘法的方法?
- RQ2避免降级步骤是否能减轻稀疏卷积中的内存带宽压力并提升数据重用率?
- RQ3通过定制内核设计,不规则稀疏计算能否被高效映射到 GPU 的数据并行架构上?
- RQ4在 GPU 上,稀疏性在多大程度上可被用于提升推理速度而非导致性能下降?
- RQ5是否可能在不修改硬件或高层框架的前提下,实现稀疏 CNN 的显著加速?
主要发现
- 在 NVIDIA GPU 上,Escort 对稀疏推理的几何平均加速比 CUBLAS 高 1.38×,比 CUSPARSE 高 1.60×。
- 在 Tesla P100 上,Escort 相较 CUBLAS 与 CUSPARSE 分别实现 2.63× 与 3.07× 的稀疏卷积速度提升。
- 在 GTX 1080Ti 上,Escort 相较 CUBLAS 对 AlexNet、GoogLeNet 与 ResNet 分别实现 1.74×、1.34× 与 1.43× 的加速。
- 性能提升在各类模型中保持一致,其中 AlexNet 的加速最大,因其卷积层具有更高的稀疏性。
- 即使排除其他层的影响,Escort 在 Tesla P100 上对稀疏卷积本身仍保持 1.47× 的加速,证实其在稀疏卷积上的有效性。
- 该方法无需修改模型训练、剪枝或硬件,是一种实用且可移植的现有深度学习流水线优化方案。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。