Table of Contents
Fetching ...

QwT-v2: Practical, Effective and Efficient Post-Training Quantization

Ningyuan Tang, Minghao Fu, Hao Yu, Jianxin Wu

TL;DR

QwT-v2 tackles practical post-training quantization by delivering a hardware-friendly, low-parameter compensation mechanism. It introduces Channel-Wise Affine Compensation (CWAC) in a post-compensation framework that uses diagonal, per-channel gains to align quantized outputs with full-precision references, and it can be integrated into existing inference engines with negligible overhead. Empirically, QwT-v2 delivers consistent accuracy gains over QwT and other PTQ baselines across vision, detection, multimodal, generation, and language models, while keeping extra parameter and compute costs minimal. The work demonstrates strong potential for wide deployment on diverse hardware, addressing real-world constraints without sacrificing performance.

Abstract

Network quantization is arguably one of the most practical network compression approaches for reducing the enormous resource consumption of modern deep neural networks. They usually require diverse and subtle design choices for specific architecture and tasks. Instead, the QwT method is a simple and general approach which introduces lightweight additional structures to improve quantization. But QwT incurs extra parameters and latency. More importantly, QwT is not compatible with many hardware platforms. In this paper, we propose QwT-v2, which not only enjoys all advantages of but also resolves major defects of QwT. By adopting a very lightweight channel-wise affine compensation (CWAC) module, QwT-v2 introduces significantly less extra parameters and computations compared to QwT, and at the same time matches or even outperforms QwT in accuracy. The compensation module of QwT-v2 can be integrated into quantization inference engines with little effort, which not only effectively removes the extra costs but also makes it compatible with most existing hardware platforms.

QwT-v2: Practical, Effective and Efficient Post-Training Quantization

TL;DR

QwT-v2 tackles practical post-training quantization by delivering a hardware-friendly, low-parameter compensation mechanism. It introduces Channel-Wise Affine Compensation (CWAC) in a post-compensation framework that uses diagonal, per-channel gains to align quantized outputs with full-precision references, and it can be integrated into existing inference engines with negligible overhead. Empirically, QwT-v2 delivers consistent accuracy gains over QwT and other PTQ baselines across vision, detection, multimodal, generation, and language models, while keeping extra parameter and compute costs minimal. The work demonstrates strong potential for wide deployment on diverse hardware, addressing real-world constraints without sacrificing performance.

Abstract

Network quantization is arguably one of the most practical network compression approaches for reducing the enormous resource consumption of modern deep neural networks. They usually require diverse and subtle design choices for specific architecture and tasks. Instead, the QwT method is a simple and general approach which introduces lightweight additional structures to improve quantization. But QwT incurs extra parameters and latency. More importantly, QwT is not compatible with many hardware platforms. In this paper, we propose QwT-v2, which not only enjoys all advantages of but also resolves major defects of QwT. By adopting a very lightweight channel-wise affine compensation (CWAC) module, QwT-v2 introduces significantly less extra parameters and computations compared to QwT, and at the same time matches or even outperforms QwT in accuracy. The compensation module of QwT-v2 can be integrated into quantization inference engines with little effort, which not only effectively removes the extra costs but also makes it compatible with most existing hardware platforms.

Paper Structure

This paper contains 18 sections, 10 equations, 2 figures, 11 tables.

Figures (2)

  • Figure 1: The left figure (\ref{['fig:mot_a']}) shows pre-compensation in QwT (top) and our post-compensation in QwT-v2 (bottom), respectively. In pre-compensation, the linear compensation module receives a Transformer block's input as its input, while in post-compensation, the block's output is input to the linear compensation module. The right figure (\ref{['fig:mot_b']}) shows example compensation matrix $W$'s absolute values in QwT and our QwT-v2, respectively (on 4-bit quantized DeiT-tiny).
  • Figure 2: The architecture of QwT-v2's compensation in a vision Transformer. Compensations are applied after each fully connected layer.