Skip to content

Latest commit

 

History

History
executable file
·
91 lines (75 loc) · 2.91 KB

File metadata and controls

executable file
·
91 lines (75 loc) · 2.91 KB

PyTorch GPUNet-0

This document describes evaluation of optimized checkpoints for GPUNet-0.

Environment Setup

Setup AI Model Efficiency Toolkit

Please install and setup AIMET before proceeding further. This model was tested with the torch_gpu variant of AIMET 1.25.0.

Add AIMET Model Zoo to the python path

export PYTHONPATH=$PYTHONPATH:<aimet_model_zoo_path>

Package Dependencies

Install required packages

pip install -r <path to aimet-model-zoo>/aimet_zoo_torch/gpunet0/requirements.txt

Dataset

ImageNet can be downloaded from here:

The folder structure and format of ImageNet dataset is like below:

--ImageNet
	--val
	    --n01440764
	        --ILSVRC2012_val_00048969.JPEG
	--train
		--n13133613
		    --n13133613_7875.JPEG

Usage

python gpunet0_quanteval.py \
		--dataset-path <The path to the ImageNet dataset's root path>
		--model-config <Quantized Model Configuration to test, default is 'gpunet0_w8a8', and just one choice>
		--batch-size <Data batch size to evaluate your model, default is 200>
		--use-cuda <Use cuda or cpu, default is True> \
  • example
    python gpunet0_quanteval.py --dataset-path <ILSVRC2012_PyTorch_path> --model-config gpunet0_w8a8
    

Model checkpoint and configuration


Quantization Configuration (W8A8)

  • Weight quantization: 8 bits, per channel symmetric quantization
  • Bias parameters are not quantized
  • Activation quantization: 8 bits, asymmetric quantization
  • Model inputs are quantized
  • Percentile was used as quantization scheme, and the value was set to 99.999
  • Adaround and fold_all_batch_norms_to_scale have been applied

Results

Below are the acc top1 results of this GPUNet-0 implementation on ImageNet:

Model Configuration acc top1 (%)
GPUNet0_FP32 78.86
GPUNet0_FP32 + simple PTQ(w8a8) 76.87
GPUNet0_W8A8 78.42