aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRickard Bolin <rickard.bolin@arm.com>2022-08-11 14:26:20 +0000
committerRickard Bolin <rickard.bolin@arm.com>2022-08-16 12:17:10 +0000
commit21d9031e6d0a423b2e6c02bddb98334a909804d7 (patch)
tree9177290b32e8a88e991880e39e00b598b4b88ff1
parentdd49a7205b76d668308262b2ea4cc38968ff576c (diff)
downloadethos-u-vela-21d9031e6d0a423b2e6c02bddb98334a909804d7.tar.gz
MLBEDSW-6640: Modify elementwise block size selection
Limit relative cost to 1 for elementwise operations since increasing block size when the full ofm already fits gives no additional benefits. Signed-off-by: Rickard Bolin <rickard.bolin@arm.com> Change-Id: Ib6128f6346834fd916efa59adbe07a069dbda0ae
-rw-r--r--ethosu/vela/architecture_allocator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/architecture_allocator.py b/ethosu/vela/architecture_allocator.py
index b5edcabb..9cc22bb4 100644
--- a/ethosu/vela/architecture_allocator.py
+++ b/ethosu/vela/architecture_allocator.py
@@ -330,7 +330,7 @@ def find_block_config(
# Scale relative to every output OFM element
if npu_op_type == NpuBlockType.ElementWise:
- relative_cost = ofm_shape.elements() / (height * width * depth)
+ relative_cost = max(ofm_shape.elements() / (height * width * depth), 1)
else:
relative_cost = (ifm_fetch + weight_fetch) / ofm_shape.elements()