Shfl-BW:通过Tensor-Core感知权重修剪加速深度神经网络推理
Shfl-BW: Accelerating Deep Neural Network Inference with Tensor-Core Aware Weight Pruning
摘要:
深度神经网络(DNN)中的权重修剪可以降低存储和计算成本,但难以为模型推理时间带来实际加速。张量核可以显著提高GPU在密集计算上的吞吐量,但将张量核用于稀疏DNN是非常具有挑战性的。与现有的CUDA核相比,张量核需要更高的数据重用和矩阵形状的指令粒度,这两者都难以从稀疏DNN内核中产生。现有的剪枝方法无法平衡准确性和效率的要求:随机稀疏性很好地保留了模型质量,但禁止张量核加速,而高度结构化的块稀疏性可以利用张量核,但遭受严重的准确性损失。在这项工作中,我们提出了一种新的稀疏模式,混合块稀疏(Shfl-BW),旨在有效地利用张量核,同时最大限度地减少对权重结构的约束。我们的见解是,行和列排列为权重结构提供了丰富的灵活性,同时使用我们的GPU内核设计引入了可以忽略不计的开销。我们在线性和卷积层中优化了Shfl-BW的GPU内核。评估表明,我们的技术可以实现最先进的GPU上的速度和精度的权衡。例如,在精度损失很小的情况下,我们可以在75%稀疏度下,在NVIDIA V100、T4和A100 GPU上分别将Transformer的计算密集型层加速1.81、4.18和1.90倍。
英文摘要:
Weight pruning in deep neural networks (DNNs) can reduce storage and computation cost, but struggles to bring practical speedup to the model inference time. Tensor-cores can significantly boost the throughput of GPUs on dense computation, but exploiting tensor-cores for sparse DNNs is very challenging. Compared to existing CUDA-cores, tensor-cores require higher data reuse and matrix-shaped instruction granularity, both difficult to yield from sparse DNN kernels. Existing pruning approaches fail to balance the demands of accuracy and efficiency: random sparsity preserves the model quality well but prohibits tensor-core acceleration, while highly-structured block-wise sparsity can exploit tensor-cores but suffers from severe accuracy loss. In this work, we propose a novel sparse pattern, Shuffled Block-wise sparsity (Shfl-BW), designed to efficiently utilize tensor-cores while minimizing the constraints on the weight structure. Our insight is that row- and column-wise permutation provides abundant flexibility for the weight structure, while introduces negligible overheads using our GPU kernel designs. We optimize the GPU kernels for Shfl-BW in linear and convolution layers. Evaluations show that our techniques can achieve the state-of-the-art speed-accuracy trade-offs on GPUs. For example, with small accuracy loss, we can accelerate the computation-intensive layers of Transformer by 1.81, 4.18 and 1.90 times on NVIDIA V100, T4 and A100 GPUs respectively at 75% sparsity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。