Hi @FrozenGene ,
About the code changes.
1) It will be hard to do this. The point is that the legalization is done in
Relay before picking the strategy (thus, it is unaware of the strategy picked).
To keep both legalizations I need somehow to pass information from the strategy
(e.g., the name of the algorithm, or something like that). Are you aware of any
other ways I can do it?
2) Note that I am targeting NHWC layout. I wasn't able to even compile with
`conv2d_nhwc_spatial_pack` for uint8 (it just hangs, at least when I tried it
without auto-tuning on Armv8-A). I gathered from various discussions that NHWC
support for arm targets is incomplete at the moment. So for now we might simply
agree to leave this as default for NHWC and `conv2d_nchw_spatial_pack` as
default for NCHW and mirror that in the legalization step which might look like:
```def _qnn_conv2d_legalize_arm_cpu(attrs, inputs, types):
if is_aarch64_arm() and attrs.data_layout == "NHWC":
return helper_change_dtypes_to_be_same(attrs, inputs, types,
relay.qnn.op.conv2d)
return helper_no_fast_int8_hw_legalization(attrs, inputs, types,
relay.qnn.op.conv2d)```
In a subsequent work, we can find a way to pick the correct legalization after
we picked the strategy.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-tvm/pull/5754#issuecomment-642543391