NicolaLancellotti commented on code in PR #11453:
URL: https://github.com/apache/tvm/pull/11453#discussion_r882846863
##########
python/tvm/contrib/ethosu/cascader/device_config.py:
##########
@@ -609,18 +624,19 @@ def _get_subkernel_propagator(
stride_w = int(op_attrs.get("stride_w", 1))
transform = ifm_propagator.transform
- if input_layout == "NHCWB16":
- transform[1][-1] = min(transform[1][-1], self._subkernel_limits[0]
- stride_h)
- transform[3][-1] = min(transform[3][-1], self._subkernel_limits[1]
- stride_w)
- else:
- transform[1][-1] = min(transform[1][-1], self._subkernel_limits[0]
- stride_h)
- transform[2][-1] = min(transform[2][-1], self._subkernel_limits[1]
- stride_w)
-
- if op_type in ("ethosu_pooling", "ethosu_depthwise_conv2d"):
- if output_layout == "NHCWB16" and input_layout == "NHWC":
- transform[3][-1] = depth
- elif output_layout == "NHCWB16" and input_layout == "NHCWB16":
- transform[2][-1] = 1 + ((depth - 1) // 16)
+ if op_type != "ethosu_identity":
Review Comment:
The block assumes that the transform matrix has at least three rows, but the
one for identity can have fewer rows, so in that case, it crashes.
It is safe to hide that block because, for the identity, the transform
matrix has only 0 and 1 as values, both less than the second arguments of the
min function, so that block does not change the transform matrix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]