Skip to content
/ QwT Public

Official PyTorch implementation of QwT—“Quantization without Tears” (CVPR 2025): fast, accurate, and hassle-free post-training network quantization with lightweight linear compensation layers.

License

Notifications You must be signed in to change notification settings

wujx2001/QwT

Repository files navigation

Quantization without Tears (CVPR 2025)

Implementation of QwT, a simple, fast, and general approach to network quantization that “adds no tears” to your workflow. QwT augments any PTQ model with lightweight linear compensation layers to recover information lost during quantization .


📖 Paper

Minghao Fu, Hao Yu, Jie Shao, Junjie Zhou, Ke Zhu & Jianxin Wu
Quantization without Tears, the Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)
PDFCVPR 2025 Version


🚀 Features

  • Fast: closed‐form compensation parameters can be computed on a small calibration set in under 2 minutes.
  • Accurate: outperforms standard PTQ methods without any back‐prop.
  • Simple: zero task‐specific hyperparameters; only a few linear layers (W, b) per block.
  • General: applies to CNNs (ResNet), Transformers (ViT, Swin), detection (Mask R-CNN, DETR), segmentation, multi‐modal (CLIP), generative (DiT) and LLMs (LLaMA).
  • Practical: integrates seamlessly with TensorRT or any existing INT8/PTQ pipeline.

📌 Changelog

  • 2025-09-30: Release code implementing QwT + RepQ-ViT for CLIP-based multimodal recognition. NEW
  • 2025-07-22: Release code implementing QwT with pytorch‑percentile, along with latency‑testing scripts to reproduce the results in Table 2 of our paper.
  • 2025-06-23: Release code implementing QwT + ResNet, evaluated on ImageNet.
  • 2025-06-09: Release code showcasing QwT integrated with the baseline PTQ method RepQ-ViT for both classification and detection tasks.
  • 2025-02-27: QwT is accepted by CVPR 2025 link.
  • 2024-11-21: QwT preprint published on (arXiv:2411.13918).

📦 Installation

  • To install QwT and develop locally:
  git clone https://github.com/wujx2001/qwt.git
  cd qwt

🛠️ Usage

For detailed reproduction instructions, please refer to:


🙏 Acknowledgements

This implementation builds on code from RepQ-ViT and leverages the timm library.

🎓 Citation

We would greatly appreciate it if you could cite our paper if you find our implementation helpful in your work.

@InProceedings{Fu_2025_CVPR,
    author    = {Fu, Minghao and Yu, Hao and Shao, Jie and Zhou, Junjie and Zhu, Ke and Wu, Jianxin},
    title     = {Quantization without Tears},
    booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)},
    month     = {June},
    year      = {2025},
    pages     = {4462-4472}
}

About

Official PyTorch implementation of QwT—“Quantization without Tears” (CVPR 2025): fast, accurate, and hassle-free post-training network quantization with lightweight linear compensation layers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages