vela: SHRAM alloc too big for some elementwise ops
- Fixed SHRAM allocation for 8 and 16-bit elementwise ops
Signed-off-by: Tim Hall <tim.hall@arm.com>
Change-Id: I909a86d76e4ee6eab612aae827038b82703f28dc
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py
index 0f5c1c8..55cc34c 100644
--- a/ethosu/vela/shared_buffer_allocation.py
+++ b/ethosu/vela/shared_buffer_allocation.py
@@ -90,7 +90,8 @@
assert (self.use_ifm_element == SHRAMElements.IFM16) or (
self.use_ifm_element == SHRAMElements.IFM16_Elementwise
)
- elif is_elementwise or ps.npu_block_type == NpuBlockType.ReduceSum and self.ifm_bits == 32:
+ elif self.ifm_bits == 32:
+ assert is_elementwise or ps.npu_block_type == NpuBlockType.ReduceSum, "Unsupported 32-bit IFM operation"
self.use_ifm_element = SHRAMElements.IFM32
else:
assert self.ifm_bits == 8, "Unexpected IFM bitdepth"