aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/architecture_allocator.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/architecture_allocator.py')
-rw-r--r--ethosu/vela/architecture_allocator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ethosu/vela/architecture_allocator.py b/ethosu/vela/architecture_allocator.py
index e7e7471..b5edcab 100644
--- a/ethosu/vela/architecture_allocator.py
+++ b/ethosu/vela/architecture_allocator.py
@@ -329,7 +329,10 @@ def find_block_config(
ifm_fetch *= full_blocks.depth
# Scale relative to every output OFM element
- relative_cost = (ifm_fetch + weight_fetch) / ofm_shape.elements()
+ if npu_op_type == NpuBlockType.ElementWise:
+ relative_cost = ofm_shape.elements() / (height * width * depth)
+ else:
+ relative_cost = (ifm_fetch + weight_fetch) / ofm_shape.elements()
# If the entire IFM can be encompassed by both buffers, bias to prefer this configuration
if ifm_shape.elements() < ifm_block.elements() * 2: