一拍即合的多精度量化,让一个模型跑遍不同硬件
MatGPTQ: Accurate and Efficient Post-Training Matryoshka Quantization
- 用一次校准就训练出可按需切分精度的模型
- 低比特下性能显著优于现有方法,高比特精度不下降
- 适合需要统一部署、兼顾效率与兼容性的团队
Matryoshka量化(MatQuant)是一种新型量化方法,允许单一整数量化模型在推理时通过截取最高有效位(MSB)支持多种精度,从而覆盖广泛内存与延迟预算。但该方法此前依赖昂贵的量化感知训练(QAT),缺乏高效的一次性后训练量化(PTQ)方案及开源支持。本文提出后训练马特罗什卡量化(MatGPTQ),基于小规模校准集,一次性联合优化多个目标精度,实现单检查点多精度部署。它将马特罗什卡量化建模为带位切片与跨位误差补偿的多精度目标,生成可切分的多比特模型。同时引入预算感知的异构逐层比特分配策略,并提供高效的切片与混合精度执行内核。在标准大语言模型与基准测试中,MatGPTQ在保持高比特精度的同时,显著提升低比特设置下的性能。整体上建立了马特罗什卡类后训练量化的最新标杆,使单检查点、多精度部署真正开放且实用。代码已开源:https://github.com/IST-DASLab/MatGPTQ。
原文摘要 · Abstract (English)
Matryoshka Quantization (MatQuant) is a recent quantization approach showing that a single integer-quantized model can be served across multiple precisions, by slicing the most significant bits (MSB) at inference time. This enables a single checkpoint to cover a wide range of memory and latency budgets, but renders quantization much more challenging. In particular, the initial MatQuant relies on expensive quantization-aware training (QAT) variants, rather than fast one-shot post training quantization (PTQ), and lacks open-source and kernel support. We address all of these limitations by introducing Post-Training Matryoshka Quantization (MatGPTQ), a new PTQ pipeline that produces a single parent model jointly optimized for multiple target precisions in one-shot, based on a small calibration set. MatGPTQ casts Matryoshka quantization as a multi-precision objective with bit-slicing and cross-bit error compensation, resulting in an algorithm that produces a multi-bit-width, "sliceable" model in a single pass. We also incorporate a new budget-aware search for heterogeneous per-layer bit-witdhs and provide efficient kernels that implement slicing and mixed-precision execution. Across standard LLMs and benchmarks, MatGPTQ preserves high-bit accuracy while substantially improving performance at low-bit-witdh settings. Overall, we establish a new state of the art for Matryoshka-style post-training quantization and make single-checkpoint, multi-precision deployment open and practical. Code is available at https://github.com/IST-DASLab/MatGPTQ.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。