ZeroQ: A Novel Zero Shot Quantization Framework

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}.