Hi @JoeyChou I am not sure what you mean by int8 -> uint8 conversion.

If you want your conv2d and dense inputs and weights to be of specific data 
type, yes that is certainly possible with QNN Legalize pass. An example of this 
is for Intel VNNI instructions which prefer `uint8` datatypes for feature maps 
and `int8` for the weights. Naturally, the pre-quantized models might not 
follow this rule. So, QNNLegalize inserts `requantize` node  before the conv2d 
and dense to satisfy the datatype restrictions.

Please look at an example here
https://github.com/apache/incubator-tvm/blob/master/python/tvm/relay/qnn/op/legalizations.py#L296-L300


https://github.com/apache/incubator-tvm/blob/master/python/tvm/relay/qnn/transform.py#L71-L116


https://github.com/apache/incubator-tvm/blob/master/tests/python/relay/test_pass_qnn_legalize.py#L295





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/support-for-pre-quantized-model-int8-uint8-conversion/8064/2)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/9a23daaf447ef77a359bb5d0cb9db6b330ce1dedfeff86ea901581861068561b).

Reply via email to