MosaicQuant: 基于内点-离点分离的统一4位LLM量化
MosaicQuant: Inlier-Outlier Disaggregation for Unified 4-Bit LLM Quantization
AI总结:
提出MosaicQuant,通过将权重矩阵量化为密集4位基分量和稀疏4位残差分量,结合ZipperEngine融合稀疏块计算,实现统一4位推理,在LLaMA3和Qwen3上保持近FP16精度并加速1.24倍。
摘要:
4位量化显著减少了内存占用并加速了大语言模型(LLM)的推理。然而,其有限的位宽表示难以忠实捕捉密集的常见值(内点)和罕见的大幅度值(离点),导致显著的精度下降。现有的混合精度方法通过保留离点的高精度来缓解这一问题,但代价是破坏了低比特执行的统一性,引入了精度转换和额外的数据移动,削弱了实际加速效果。我们提出MosaicQuant,一种基于内点-离点分离新原理的统一4位LLM量化范式。MosaicQuant不提升离点精度,而是将整个权重矩阵量化为密集的4位基分量,其中内点被忠实捕捉,而离点不可避免地量化。然后引入一个稀疏的4位残差分量来补偿这些量化误差,选择性地针对输出失真最严重的误差关键权重块。然而,仅统一表示是不够的,因为将稀疏残差作为单独内核执行仍然会破坏统一的低比特推理流水线。为弥补这一差距,我们引入ZipperEngine,通过重叠流水线将稀疏块计算融合到密集4位GEMM内核中,不仅统一了表示,而且将执行统一为单个连贯的低比特推理流水线。在LLaMA3和Qwen3上的大量实验表明,MosaicQuant在保持接近FP16精度的同时,相比W16A16基线实现了高达1.24倍的加速。
英文摘要:
4-bit quantization significantly reduces the memory footprint and accelerates the inference of large language models (LLMs). However, its limited bit-width representation struggles to faithfully capture both dense common values (\emph{inliers}) and rare large-magnitude values (\emph{outliers}), causing substantial accuracy degradation. Existing mixed-precision methods mitigate this by retaining outliers in high precision, but at the cost of breaking the uniformity of low-bit execution, introducing precision conversion and extra data movement that undermine practical speedup. We propose \textbf{MosaicQuant}, a unified 4-bit LLM quantization paradigm built on a novel principle of \emph{inlier--outlier disaggregation}. Rather than elevating outlier precision, MosaicQuant quantizes the full weight matrix into a dense 4-bit base component, where inliers are captured faithfully while outlier are inevitably quantized. A sparse 4-bit residual component is then introduced to compensate for these quantization errors, selectively targeting the most error-critical weight blocks where output distortion is shown to be concentrated. However, a unified representation alone is insufficient, as naïvely executing the sparse residual as a separate kernel still breaks the unified low-bit inference pipeline. To bridge this gap, we introduce \textbf{ZipperEngine}, which fuses sparse block computation into the dense 4-bit GEMM kernel via an overlapped pipeline, unifying not only the representation but also the execution into a single coherent low-bit inference pipeline. Extensive experiments on LLaMA3 and Qwen3 demonstrate that MosaicQuant preserves near-FP16 accuracy while achieving up to $1.24\times$ speedup over the W16A16 baseline.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。