ZICQ
中 Log in / Sign up
Newsroom Compute & Architecture #MACaQ #W4A4 Quantization #MXFP4 #Hadamard Transform #Post-Training Quantization

MACaQ Enables Streaming W4A4 Quantization with 32.5GB GPU Memory

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published:

中文阅读 (Chinese) English Version

Summary:MACaQ introduces a model-agnostic post-training quantization method for MXFP4 W4A4 inference. By processing each linear layer independently, applying online per-channel scaling and block-Hadamard transforms to activations, and absorbing inverse transforms into the weights, it removes cross-layer basis dependencies and supports streaming quantization. Combined with Hessian-aware Flip-Refinement, the method reports only a 2.3% end-to-end overhead over pure MXFP4 on Qwen3-32B in vLLM. It matches t


Core idea: turning quantization into a layer-local problem

MACaQ targets MXFP4 W4A4 inference, where both weights and activations use four-bit representations to reduce memory traffic and matrix-multiplication cost. Instead of propagating basis transforms across layers, it treats each linear layer independently. Activations receive an online per-channel scale and a block-Hadamard transform, while the corresponding inverse transform is absorbed into the weights before quantization.

Removing cross-layer dependencies enables streaming quantization: only one layer needs to remain in memory at a time. This is the key reason MACaQ can quantize a 122B-parameter model with 32.5GB of GPU memory.

The Hadamard transform is not free. MACaQ executes it at inference time and therefore introduces additional matrix operations and kernel overhead. The paper reports only a 2.3% end-to-end overhead over pure MXFP4 for Qwen3-32B in vLLM. Whether this remains true at smaller batch sizes, longer context lengths, or on hardware without fused FP4 and Hadamard kernels requires independent validation.

Quantization mechanism: absorbing online transforms into weights

For a linear layer, the computation can be written as:

[ y = xW^T ]

MACaQ applies a per-channel scale (s) and a block-Hadamard transform (H) to the activation:

[ y = (Hs)(HW^T)^T ]

The transformed weight (HW^T) can be prepared offline. During inference, the system only needs to scale and transform the incoming activation before the FP4 matrix multiplication. The block-Hadamard transform is intended to reduce outlier concentration and channel correlation in the activation distribution, allowing more values to fall into regions that FP4 can represent efficiently.

Compared with global basis transforms, a layer-local design sacrifices some theoretical optimality in exchange for architectural independence, streaming execution, and no need for architecture-specific transform propagation. This makes it particularly attractive for mixture-of-experts models, hybrid attention stacks, and diffusion architectures.

The trade-off remains measurable: online transforms consume compute and memory bandwidth, and the savings from low-precision matrix multiplication may not always dominate that cost. Actual gains should therefore be measured with optimized kernels on the intended GPU rather than inferred from theoretical FLOP counts.

Flip-Refinement: optimizing FP4 codes with second-order information

Standard round-to-nearest maps a weight or activation to the numerically closest FP4 code. MACaQ adds Flip-Refinement, a Hessian-aware coordinate-descent procedure that evaluates the effect of moving individual coordinates to adjacent representable values.

For an input distribution (X), the quantization error can often be approximated as:

[ \Delta L \approx \frac{1}{2}(x-\hat{x})^T H (x-\hat{x}) ]

Here, (H) captures the model's sensitivity to input perturbations. Rather than performing an unrestricted grid search, Flip-Refinement uses second-order information to decide which coordinate flips are likely to reduce the loss. Its greedy, one-coordinate-at-a-time strategy can improve discrete code assignment without requiring a prohibitively expensive global optimizer.

Coordinate descent may still become trapped in local optima, while Hessian estimation and candidate evaluation add offline cost. The paper reports that, on Llama-3-8B, MACaQ matches the best perplexity of DuQuant++ and MR-GPTQ with roughly 11 times less quantization time, suggesting that its accuracy gains do not necessarily depend on prolonged global optimization. Stability across random seeds, model sizes, layer widths, and calibration-set sizes still requires examination.

Engineering results and limitations

MACaQ highlights three engineering results:

  • It adds only 2.3% end-to-end overhead over pure MXFP4 for Qwen3-32B in vLLM.
  • It reaches the best perplexity of DuQuant++ and MR-GPTQ on Llama-3-8B with approximately 11 times less quantization time.
  • It quantizes a 122B-parameter model in 64 minutes using only 32.5GB of GPU memory.

The method is also applied directly to an image diffusion model without architecture-specific modifications. This supports its model-agnostic positioning, but the available summary does not provide complete diffusion metrics such as FID, sampling latency, or generation quality. It therefore cannot establish that generative workloads will receive the same benefits.

W4A4 also compounds errors in both weights and activations. Models with long contexts, strong activation outliers, or high numerical sensitivity may show larger task-level degradation than perplexity suggests. Evaluation should cover prefill, decoding, low-batch online serving, high-concurrency serving, and varying context lengths rather than relying only on offline perplexity.

Deployment recommendations

For teams deploying very large models under tight memory limits, MACaQ's most important contribution is arguably the layer-streaming quantization mechanism, not a single benchmark record. The model can be processed one layer at a time without requiring the full model and all calibration data to coexist in memory.

A practical rollout should:

  1. Test whether Hadamard transforms, scaling, and FP4 matrix multiplication are genuinely fused in the target vLLM and GPU stack.
  2. Measure prefill and decoding separately, since online activation transforms may affect low-batch decoding latency more than throughput-oriented prefill.
  3. Calibrate on deployment data and evaluate perplexity, task accuracy, output stability, and long-context degradation together.
  4. For mixture-of-experts models, inspect routing stability, expert activation distributions, and load imbalance, since small numerical shifts in the router can be disproportionately harmful.
  5. Compare against FP16, BF16, pure MXFP4, and existing W4A16 pipelines using peak memory, throughput, time to first token, generation speed, and model-file size.

MACaQ's main contribution is the combination of local Hadamard coordinate transforms, weight-absorbed inverse transforms, and streaming layer-local execution. Whether its paper-level results translate into dependable production gains will ultimately depend on kernel quality, hardware support, and workload-specific end-to-end testing.


Source: Hugging Face Daily Papers (2026-11-07)

— END —

Tags: #MACaQ #W4A4 Quantization #MXFP4 #Hadamard Transform #Post-Training Quantization

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

Community Comments

Loading live comments and annotations…