GPU Tensor Core 上大型语言模型的高效任意精度加速
Efficient Arbitrary Precision Acceleration for Large Language Models on GPU Tensor Cores
AI总结:
针对任意精度超低比特 LLM 推理受限于 Tensor Core 与内存管理的问题,提出 bipolar-INT、比特级矩阵乘、预处理及恢复导向内存管理方案,实现最高 6.7 倍推理加速。
摘要:
大型语言模型(LLM)已得到广泛应用,但在高效推理方面面临挑战。尽管量化方法降低了计算需求,但支持任意精度的超低比特量化受到 GPU Tensor Core 支持有限以及内存管理低效的阻碍,从而导致加速效果不理想。为应对这些挑战,我们提出了一种面向任意精度 LLM 的综合加速方案。其核心是,我们引入了一种新型 bipolar-INT 数据格式,该格式有助于并行计算并支持对称量化,可有效减少数据冗余。在此基础上,我们实现了一种任意精度矩阵乘法方案,在比特层面对矩阵进行分解与恢复,从而在灵活支持精度的同时最大化 GPU Tensor Core 利用率。此外,我们开发了一种高效的矩阵预处理方法,为后续计算优化数据布局。最后,我们设计了一种面向数据恢复的内存管理系统,该系统策略性地利用高速共享内存,显著提升 kernel 执行速度并最小化内存访问延迟。实验结果证明了本文方法的有效性:与 NVIDIA 的 CUTLASS 相比,矩阵乘法最高实现 2.4 倍加速;将其集成到 LLM 中后,推理加速最高达到 6.7 倍。这些改进显著提升了 LLM 推理效率,使 LLM 能够支持更广泛、响应更快的应用。
英文摘要:
Large language models (LLMs) have been widely applied but face challenges in efficient inference. While quantization methods reduce computational demands, ultra-low bit quantization with arbitrary precision is hindered by limited GPU Tensor Core support and inefficient memory management, leading to suboptimal acceleration. To address these challenges, we propose a comprehensive acceleration scheme for arbitrary precision LLMs. At its core, we introduce a novel bipolar-INT data format that facilitates parallel computing and supports symmetric quantization, effectively reducing data redundancy. Building on this, we implement an arbitrary precision matrix multiplication scheme that decomposes and recovers matrices at the bit level, enabling flexible precision while maximizing GPU Tensor Core utilization. Furthermore, we develop an efficient matrix preprocessing method that optimizes data layout for subsequent computations. Finally, we design a data recovery-oriented memory management system that strategically utilizes fast shared memory, significantly enhancing kernel execution speed and minimizing memory access latency. Experimental results demonstrate our approach's effectiveness, with up to 2.4\times speedup in matrix multiplication compared to NVIDIA's CUTLASS. When integrated into LLMs, we achieve up to 6.7\times inference acceleration. These improvements significantly enhance LLM inference efficiency, enabling broader and more responsive applications of LLMs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。