tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] Type inference error compiling quantized group convolution on `arm_cpu` target

Open lhutton1 opened this issue 1 year ago • 0 comments
trafficstars

Expected behaviour:

When an arm_cpu target is used, the grouped convolution should compile successfully without an error.

Actual behaviour:

When an arm_cpu target is used, the model fails to compile during type inference with:

Incompatible broadcast type TensorType([1, 8, 8, 2], int32) and TensorType([1, 1, 1, 16], int32)
The type inference pass was unable to infer a type for this expression.
This usually occurs when an operator call is under constrained in some way, check other reported errors for hints of what may of happened.

Environment:

Tested with TVM at 6a3fadc0654ecf9557ffe08d24677684c96e80b0. The issue was found as a result of the changes in #16513, however it can be reproduced without as described below.

How to reproduce:

Run the test pytest tests/python/frontend/tflite/test_forward.py -k test_forward_quantized_convolution with an arm_cpu target. Note: reminder to remove any skip condition that exists in the test currently.


Likely group convolution needs to be handled correctly in: https://github.com/apache/tvm/blob/8a2ffee38e6020083c857a3aaaecae29d982c5c7/python/tvm/relay/qnn/op/legalizations.py#L489

lhutton1 avatar Feb 07 '24 10:02 lhutton1