Replies: 2 comments 1 reply
-
@shewu-quic @chunit-quic @haowhsu-quic @qiurc mind help answering this question? I'm guessing it's due to the kernel restriction, but would like to confirm |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @codereba, thank you for reading through the code. For parameter quantization, HTP requires symmetrical encoding. Since [min, max] of int8 equal to [-128, 127], we have to add 1 manually to have the same range, i.e. [-127, 127], and the zero point can be mapped exactly to 0. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I read the code of get_8a8w_qnn_ptq_config, I found the minimum values of weight quantization is a one more than activation and bias quantization, please refer to:
https://github.com/pytorch/executorch/blob/main/backends/qualcomm/quantizer/qconfig.py#L88
weight_quantization_spec = QuantizationSpec(
dtype=torch.int8,
quant_min=torch.iinfo(torch.int8).min + 1,
quant_max=torch.iinfo(torch.int8).max,
qscheme=torch.per_tensor_symmetric,
ch_axis=0,
observer_or_fake_quant_ctr=MinMaxObserver.with_args(**extra_args),
)
I think the difference between the minimum values of weight quantization and the activation and bias quantization should not be the const 1.
And there should check the minimum value should be lower than the maximum value firstly.
I just try to make the code be best, could you please explain the code?
Thanks for the great work of executorch.
Beta Was this translation helpful? Give feedback.
All reactions