aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela
diff options
context:
space:
mode:
authorFredrik Svedberg <fredrik.svedberg@arm.com>2020-09-15 17:18:40 +0200
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-09-17 08:31:01 +0000
commit2b60ce93e1f404340e1be5c88f064cf75a4bad6f (patch)
tree04714f6b19d14770aa8d12192ab5aaec69841a16 /ethosu/vela
parent1a66697b80a527af6d6dd1ed235199264696767e (diff)
downloadethos-u-vela-2b60ce93e1f404340e1be5c88f064cf75a4bad6f.tar.gz
[MLBEDSW-2638] Do not use 40bit ACC for softmax int16
Added logic for not using 40bit ACC for softmax int16. Change-Id: I02b376040e19b48e8aaa65d48ffc7c47a0b9b187 Signed-off-by: Fredrik Svedberg <fredrik.svedberg@arm.com>
Diffstat (limited to 'ethosu/vela')
-rw-r--r--ethosu/vela/shared_buffer_allocation.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py
index 55cc34cc..63e2268d 100644
--- a/ethosu/vela/shared_buffer_allocation.py
+++ b/ethosu/vela/shared_buffer_allocation.py
@@ -37,6 +37,8 @@ class SharedBufferAllocation:
self.banks_required = np.zeros(SharedBufferArea.Size)
ifm_tensor, ifm2_tensor, weight_tensor, ofm_tensor = ps.get_primary_op_ifm_ifm2_weights_ofm()
+ tensors = [t for t in (ifm_tensor, ifm2_tensor, ofm_tensor) if t is not None]
+ has_scale = None not in (t.quantization.scale_f32 for t in tensors)
strides = (1, 1, 1, 1)
dilation = (1, 1, 1, 1)
@@ -84,7 +86,7 @@ class SharedBufferAllocation:
else:
self.ifm_depth = ifm_tensor.shape[-1]
if self.ifm_bits == 16:
- if ps.npu_block_type != NpuBlockType.Pooling:
+ if ps.npu_block_type != NpuBlockType.Pooling and has_scale:
self.use_accumulator_element = SHRAMElements.Acc40
self.use_ifm_element = self.use_ifm_element + 1
assert (self.use_ifm_element == SHRAMElements.IFM16) or (