jacobbohlin commented on code in PR #10509:
URL: https://github.com/apache/tvm/pull/10509#discussion_r857736239
##########
python/tvm/contrib/ethosu/cascader/device_config.py:
##########
@@ -491,6 +493,28 @@ def get_elementwise_block_config(
if activation == "LUT" and not self._lut_reserved:
banks_available -= 2
+ # Handle user-forced block config
+ options =
tvm.transform.PassContext.current().config.get("relay.ext.ethos-u.options",
None)
+ if options and options.dev_force_block_config:
+ block_config = [int(v) for v in
options.dev_force_block_config.split("x")]
+ assert len(block_config) == 3
+ if output_layout == "NHWC":
+ block_shape = [output_shape[0], block_config[0],
block_config[1], block_config[2]]
+ else:
+ block_shape = [
+ output_shape[0],
+ block_config[0],
+ 1 + ((block_config[2] - 1) // 16),
+ block_config[1],
+ 16,
+ ]
+ output_cycles = self._get_output_cycles(
+ op_type, op_str, ifm_dtype, ofm_dtype, activation
+ )
+ output_cycles *= reduce(lambda a, b: a * b, block_shape, 1)
Review Comment:
That's probably simpler, I will change it.
--
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]