Pytorch implementation of RAPQ, IJCAI 2022. link
Any question can be asked, please contact with E-mail: [email protected]
-
RAPQ provides the Power-of-Two quantization scheme for PTQ specially. Because of BRECQ's SOTA performance in PTQ area, this hub implements RAPQ based on BRECQ by Yuhang Li @yhhhli. .
-
Please download the pretrained models before running this program!
After downloading, please put it into "~/.cache/torch/checkpoints" of your user path
This program is done in the Pytorch framework, so please prepare the environment first!
ImageNet dataset is also Necessary!
- Use Naive Powers-of-Two PTQ:
CUDA_VISIBLE_DEVICES=0 python main_imagenet.py --data_path /path/to/ImageNet/ --arch mobilenetv2 --n_bits_w 2 --channel_wise --n_bits_a 4 --act_quant --test_before_calibration
- Use RAPQ Quick Mode:
CUDA_VISIBLE_DEVICES=0 python main_imagenet.py --RAPQ --data_path /path/to/ImageNet/ --arch resnet18 --n_bits_w 2 --channel_wise --n_bits_a 4 --act_quant --test_before_calibration
- Use RAPQ:
CUDA_VISIBLE_DEVICES=0 python main_imagenet.py --RAPQ --data_path /path/to/ImageNet/ --arch mobilenetv2 --n_bits_w 2 --iters_w 80000 --channel_wise --n_bits_a 4 --act_quant --test_before_calibration
RAPQ is release under MIT license.