Open Piotr94 opened 7 months ago
@Piotr94, AIMET does not support adjusted_weights_quantizer, could you disable it SNPE as well. Also, are you using Per channel quantization in AIMET, since it is being used with SNPE in your code?
I presume that 5 inputs are not enough, but the difference between the obtained results is very confusing for me.
Yes, 5 is a very small dataset.
Thanks for your answer. Indeed i didn't use per channel quantization in AIMET but I don't see how could I set it. In the documentation for QuantSimModel (link) I couldn't find such option. Can you tell where can I find it/ how can I enable it?
Yes, looks like it is not documented. For per channel you can an example here- https://github.com/quic/aimet/blob/develop/NightlyTests/torch/test_quantize_resnet18.py
You need to change the config file that is passed to Quantsim as show in- save_config_file_for_per_channel_quantization
I would like to ask some questions about the difference between AIMET and SNPE quantization.
I am attempting to perform quantization of the video denoising model.
I started with SNPE and used the following commands:
For calibration, I used 5 inputs with different levels of noise. Then I tested the quantized model on exactly the same inputs using the command below:
snpe-net-run --container Quant_MODEL_NAME.dlc --input_list Inputlist.txt
The quality is lower, but the difference is acceptable. On average, there is a drop from 37.77 dB to 37.17.To have more control over quantization, I wanted to use AIMET. I used the code below to obtain the quantized model:
Then, for calibration, I used the same 5 inputs as for SNPE:
Later, I evaluated the quantized model on the same 5 inputs, but the obtained results were very poor, with an average PSNR of 25 dB. For evaluation, I used the following code:
I presume that 5 inputs are not enough, but the difference between the obtained results is very confusing for me. Could you tell me what I can do to obtain the same results with AIMET as with SNPE quantization? Are there any mistakes in the current AIMET approach?