用非均匀码点表示实现高效4比特大模型量化,推理快2.21倍以上
SBVR: Summation of BitVector Representation for Efficient LLM Quantization
- 将权重映射到符合真实分布的非均匀码点,提升压缩精度
- 4比特量化下比原FP16模型快2.21至3.04倍,端到端生成加速显著
- 自研CUDA核直接在压缩格式上计算,避免解压开销,适合部署
随着大语言模型(LLMs)的发展,众多后训练量化(PTQ)方法被提出以缓解其庞大参数量带来的部署难题。量化通过限制数据可表示点数实现压缩,关键在于为给定数据选择最优的表示点组合。现有方法主要分为基于四舍五入到最近(RTN)和基于码本两类:前者将权重映射到均匀整数网格,忽略权重的高斯分布特性;后者虽能构建分布感知码本,但存在随机与跳变内存访问模式,导致推理速度下降,且受GPU L1缓存容量限制加剧。为此,本文提出新型量化方法SBVR(BitVector表示求和),在硬件友好方式下实现类似高斯的码点表示,支持快速推理。SBVR将权重值映射到非均匀表示点,其分布贴合实际权重分布,提升压缩精度。同时设计专用CUDA内核,可在不解压情况下直接执行矩阵-向量乘法,实现高性能运行。在多个模型上的评估表明,SBVR在4比特量化下达到顶尖困惑度与准确率表现,相较于原始FP16模型实现2.21至3.04倍的端到端生成速度提升。
原文摘要 · Abstract (English)
With the advent of large language models (LLMs), numerous Post-Training Quantization (PTQ) strategies have been proposed to alleviate deployment barriers created by their enormous parameter counts. Quantization achieves compression by limiting the number of representable points in the data. Therefore, the key to achieving efficient quantization is selecting the optimal combination of representation points, or codes, for the given data. Existing PTQ solutions adopt two major approaches to this problem: Round-To-Nearest (RTN)-based methods and codebook-based methods. RTN-based methods map LLM weights onto uniformly distributed integer grids, failing to account for the Gaussian-like weight distribution of LLM weights. Codebook-based methods mitigate this issue by constructing distribution-aware codebooks; however, they suffer from random and strided memory access patterns, resulting in degraded inference speed that is exacerbated by the limited size of GPU L1 cache. To overcome these limitations, we propose a novel LLM quantization method, SBVR (Summation of BitVector Representation), that enables Gaussian-like code representation in a hardware-friendly manner for fast inference. SBVR maps weight values to non-uniform representation points whose distribution follows the actual distribution of LLM weights, enabling more accurate compression. Additionally, we design a custom CUDA kernel that allows matrix-vector multiplication directly in the SBVR format without decompression, thereby enabling high-performance execution of SBVR-compressed models. Our evaluations of SBVR on various models demonstrate state-of-the-art perplexity and accuracy benchmark performance while delivering a 2.21x- 3.04x end-to-end token-generation speedup over naive FP16 models in the 4-bit quantization regime.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。