arXiv:2508.04405cs.LG2025-08被引 2

提出FlexQ框架,用INT6量化实现大模型高效推理,兼顾精度与速度。

FlexQ: Efficient Post-training INT6 Quantization for LLM Serving via Algorithm-System Co-Design

  • 统一6位权重+自适应8位激活,结合敏感性分析优化
  • 在LLaMA-2-70B上保持接近FP16精度,困惑度提升≤0.1
  • 专为GPU设计加速内核,相比SmoothQuant提速1.33倍

大型语言模型虽表现优异,但内存与计算开销大,限制实际部署。现有INT4/INT8量化常导致精度下降或效率不足。INT6量化在精度与效率间更具优势,但现代GPU缺乏原生支持,需通过高精度算术单元模拟,制约加速效果。本文提出FlexQ,一种融合算法创新与系统优化的后训练INT6量化框架。其对所有层采用统一6位权重量化,并通过逐层敏感性分析,自适应保留部分层的8位激活。为最大化硬件效率,开发专用高性能GPU内核,支持基于二进制张量核心(BTC)等效的W6A6与W6A8矩阵乘法,有效绕过无原生INT6张量核心的限制。在LLaMA系列模型上的评估显示,FlexQ维持近FP16精度,WikiText2上困惑度增加不超过0.1。所提内核在LLaMA-2-70B线性层上平均比ABQ-LLM快1.39倍。端到端测试中,较SmoothQuant实现1.33倍推理加速与1.21倍内存节省。代码已开源:https://github.com/FlyFoxPlayer/FlexQ。

原文摘要 · Abstract (English)

Large Language Models (LLMs) demonstrate exceptional performance but entail significant memory and computational costs, restricting their practical deployment. While existing INT4/INT8 quantization reduces these costs, they often degrade accuracy or lack optimal efficiency. INT6 quantization offers a superior trade-off between model accuracy and inference efficiency, but lacks hardware support in modern GPUs, forcing emulation via higher-precision arithmetic units that limit acceleration. In this paper, we propose FlexQ, a novel post-training INT6 quantization framework combining algorithmic innovation with system-level optimizations. FlexQ employs uniform 6-bit weight quantization across all layers, with adaptive retention of 8-bit activations in layers identified through layer-wise sensitivity analysis. To maximize hardware efficiency, we develop a specialized high-performance GPU kernel supporting matrix multiplication for W6A6 and W6A8 representations via Binary Tensor Core (BTC) equivalents, effectively bypassing the lack of native INT6 tensor cores. Evaluations on LLaMA family models show FlexQ maintains near-FP16 accuracy, with perplexity increases of no more than 0.1 on WikiText2. The proposed kernel achieves an average 1.39$\times$ speedup over ABQ-LLM on LLaMA-2-70B linear layers. End-to-end, FlexQ delivers 1.33$\times$ inference acceleration and 1.21$\times$ memory savings over SmoothQuant. Code is released at https://github.com/FlyFoxPlayer/FlexQ.

INT6量化大模型推理GPU优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。