All Projects → amirgholami → Zeroq

amirgholami / Zeroq

Licence: gpl-3.0
[CVPR'20] ZeroQ: A Novel Zero Shot Quantization Framework

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Zeroq

DNNAC
All about acceleration and compression of Deep Neural Networks
Stars: ✭ 29 (-80.67%)
Mutual labels:  compression, quantization
Lq Nets
LQ-Nets: Learned Quantization for Highly Accurate and Compact Deep Neural Networks
Stars: ✭ 195 (+30%)
Mutual labels:  quantization, compression
Model Optimization
A toolkit to optimize ML models for deployment for Keras and TensorFlow, including quantization and pruning.
Stars: ✭ 992 (+561.33%)
Mutual labels:  quantization, compression
Nncf
PyTorch*-based Neural Network Compression Framework for enhanced OpenVINO™ inference
Stars: ✭ 218 (+45.33%)
Mutual labels:  quantization, compression
SSD-Pruning-and-quantization
Pruning and quantization for SSD. Model compression.
Stars: ✭ 19 (-87.33%)
Mutual labels:  compression, quantization
Aimet
AIMET is a library that provides advanced quantization and compression techniques for trained neural network models.
Stars: ✭ 453 (+202%)
Mutual labels:  quantization, compression
Model Quantization
Collections of model quantization algorithms
Stars: ✭ 118 (-21.33%)
Mutual labels:  quantization, compression
Bandwidth Hero Proxy
⚡️ Proxy that compresses images to low-resolution
Stars: ✭ 130 (-13.33%)
Mutual labels:  compression
Ctranslate2
Fast inference engine for OpenNMT models
Stars: ✭ 140 (-6.67%)
Mutual labels:  quantization
Pretrained Language Model
Pretrained language model and its related optimization techniques developed by Huawei Noah's Ark Lab.
Stars: ✭ 2,033 (+1255.33%)
Mutual labels:  quantization
Cstore fdw
Columnar storage extension for Postgres built as a foreign data wrapper. Check out https://github.com/citusdata/citus for a modernized columnar storage implementation built as a table access method.
Stars: ✭ 1,642 (+994.67%)
Mutual labels:  compression
Graffitist
Graph Transforms to Quantize and Retrain Deep Neural Nets in TensorFlow
Stars: ✭ 135 (-10%)
Mutual labels:  quantization
Junrar
Plain Java unrar library
Stars: ✭ 142 (-5.33%)
Mutual labels:  compression
Minify
CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.
Stars: ✭ 1,710 (+1040%)
Mutual labels:  compression
Lzsa
Byte-aligned, efficient lossless packer that is optimized for fast decompression on 8-bit micros
Stars: ✭ 146 (-2.67%)
Mutual labels:  compression
Lerc
Limited Error Raster Compression
Stars: ✭ 126 (-16%)
Mutual labels:  compression
Gorilla Tsc
Implementation of time series compression method from the Facebook's Gorilla paper
Stars: ✭ 147 (-2%)
Mutual labels:  compression
Digital video introduction
A hands-on introduction to video technology: image, video, codec (av1, vp9, h265) and more (ffmpeg encoding).
Stars: ✭ 12,184 (+8022.67%)
Mutual labels:  compression
Vdo
Userspace tools for managing VDO volumes.
Stars: ✭ 138 (-8%)
Mutual labels:  compression
Awesome Edge Machine Learning
A curated list of awesome edge machine learning resources, including research papers, inference engines, challenges, books, meetups and others.
Stars: ✭ 139 (-7.33%)
Mutual labels:  quantization

ZeroQ: A Novel Zero Shot Quantization Framework

Block

Introduction

This repository contains the PyTorch implementation for the CVPR 2020 paper ZeroQ: A Novel Zero-Shot Quantization Framework. Below are instructions for reproducing classification results. Please see detection readme for instructions to reproduce object detection results.

You can find a short video explanation of ZeroQ here.

TLDR;

# Code is based on PyTorch 1.2 (Cuda10). Other dependancies could be installed as follows: 
cd classification
pip install -r requirements.txt --user
# Set a symbolic link to ImageNet validation data (used only to evaluate model) 
mkdir data
ln -s /path/to/imagenet/ data/

The folder structures should be the same as following

zeroq
├── utils
├── data
│   ├── imagenet
│   │   ├── val

Afterwards you can test Zero Shot quantization with W8A8 by running:

bash run.sh

Below are the results that you should get for 8-bit quantization (W8A8 refers to the quantizing model to 8-bit weights and 8-bit activations).

Models Single Precision Top-1 W8A8 Top-1
ResNet18 71.47 71.43
ResNet50 77.72 77.67
InceptionV3 78.88 78.72
MobileNetV2 73.03 72.91
ShuffleNet 65.07 64.94
SqueezeNext 69.38 69.17

Evaluate

  • You can test a single model using the following command:
export CUDA_VISIBLE_DEVICES=0
python uniform_test.py [--dataset] [--model] [--batch_size] [--test_batch_size]

optional arguments:
--dataset                   type of dataset (default: imagenet)
--model                     model to be quantized (default: resnet18)
--batch-size                batch size of distilled data (default: 64)
--test-batch-size           batch size of test data (default: 512)

Citation

ZeroQ has been developed as part of the following paper. We appreciate it if you would please cite the following paper if you found the implementation useful for your work:

@inproceedings{cai2020zeroq,
  title={Zeroq: A novel zero shot quantization framework},
  author={Cai, Yaohui and Yao, Zhewei and Dong, Zhen and Gholami, Amir and Mahoney, Michael W and Keutzer, Kurt},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={13169--13178},
  year={2020}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].