HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

ZeroQ: A Novel Zero Shot Quantization Framework

Cai Yaohui ; Yao Zhewei ; Dong Zhen ; Gholami Amir ; Mahoney Michael W. ; Keutzer Kurt

ZeroQ: A Novel Zero Shot Quantization Framework

Abstract

Quantization is a promising approach for reducing the inference time andmemory footprint of neural networks. However, most existing quantizationmethods require access to the original training dataset for retraining duringquantization. This is often not possible for applications with sensitive orproprietary data, e.g., due to privacy and security concerns. Existingzero-shot quantization methods use different heuristics to address this, butthey result in poor performance, especially when quantizing to ultra-lowprecision. Here, we propose ZeroQ , a novel zero-shot quantization framework toaddress this. ZeroQ enables mixed-precision quantization without any access tothe training or validation data. This is achieved by optimizing for a DistilledDataset, which is engineered to match the statistics of batch normalizationacross different layers of the network. ZeroQ supports both uniform andmixed-precision quantization. For the latter, we introduce a novel Paretofrontier based method to automatically determine the mixed-precision bitsetting for all layers, with no manual search involved. We extensively test ourproposed method on a diverse set of models, including ResNet18/50/152,MobileNetV2, ShuffleNet, SqueezeNext, and InceptionV3 on ImageNet, as well asRetinaNet-ResNet50 on the Microsoft COCO dataset. In particular, we show thatZeroQ can achieve 1.71\% higher accuracy on MobileNetV2, as compared to therecently proposed DFQ method. Importantly, ZeroQ has a very low computationaloverhead, and it can finish the entire quantization process in less than 30s(0.5\% of one epoch training time of ResNet50 on ImageNet). We haveopen-sourced the ZeroQframework\footnote{https://github.com/amirgholami/ZeroQ}.

Code Repositories

jakc4103/DFQ
pytorch
Mentioned in GitHub
amirgholami/ZeroQ
Official
pytorch
Mentioned in GitHub
ricky40403/GDFQ
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
data-free-quantization-on-cifar10ResNet-20 CIFAR10
CIFAR-10 W8A8 Top-1 Accuracy: 93.94

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
ZeroQ: A Novel Zero Shot Quantization Framework | Papers | HyperAI