MACaQ:面向低精度权重和激活的快速、模型无关的校准量化

·

研究论文 · 2026/11/11

MACaQ 是一种针对低精度权重和激活的快速、模型无关的量化方法。它采用 MXFP4 W4A4 训练后量化,独立处理每个线性层:对激活在线应用逐通道缩放和块 Hadamard 变换,并将逆变换吸收到权重中。这种在线保留变换的方式避免了跨层依赖,支持流式实现,每次只需在内存中保留一层。为改进最近邻量化,作者引入了 Flip-Refinement,一种基于 Hessian 的坐标下降过程,贪心地调整单个 FP4 码到相邻可表示值。在 Qwen3-32B 上,MACaQ 仅比纯 MXFP4 增加 2.3% 的端到端开销,困惑度低于 DuQuant++ 和 MR-GPTQ,在 Llama-3-8B 上以 11 倍的量化时间匹配它们的最佳困惑度。该方法无需架构特定修改即可应用于图像扩散模型,并能在 64 分钟内量化 122B 参数模型,仅使用 32.5GB GPU 内存。

MACaQ 在保持低精度量化效果的同时显著提升了量化速度,并降低了内存需求,其模型无关的设计使其易于应用于多种架构,包括大语言模型和扩散模型,具有很高的实用价值。

Weight-activation quantization can reduce the memory and compute cost of neural-network inference, but recent methods often require expensive optimization and architecture-specific propagation of basis transforms across layers. We introduce MACaQ, an MXFP4 W4A4 post-training quantization method that treats every linear layer independently. MACaQ applies a per-channel scale and a block-Hadamard transform online to each layer's activations, while absorbing the corresponding inverse transforms into its weights. Retaining these transforms online avoids cross-layer dependencies and enables a simple streaming implementation of the quantization process, in which only one layer must reside in memory at a time. To improve over round-to-nearest quantization, we introduce Flip-Refinement, a Hessian-aware coordinate-descent procedure that greedily moves individual FP4 codes to adjacent representable values. Despite executing the activation transforms at inference time, MACaQ adds only 2.3% end-to-end overhead over pure MXFP4 on Qwen3-32B in vLLM. MACaQ reaches lower perplexity than DuQuant++ and MR-GPTQ, and already matches their best perplexity on Llama-3-8B in 11 times less quantization time. We further apply MACaQ without architecture-specific modifications to an image diffusion model, illustrating the generality of its layer-local design and show quantization of a 122B parameter model in 64 minutes, using only 32.5GB GPU RAM.

阅读原文

参与讨论