aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-12-22 10:12:54 +0100
committerJohan Alfvén <johan.alfven@arm.com>2023-01-10 08:59:37 +0100
commit1657307bbea6a73cad58623cf54d72d15693345f (patch)
treeb80cb6c97af9645f163ebeb976ee7c17ea1953f8
parent5fdcf1753fc803a6baeb8eb1fc97c7df5a6e95ac (diff)
downloadethos-u-vela-1657307bbea6a73cad58623cf54d72d15693345f.tar.gz
MLBEDSW-7220: Updated uncascaded memory calculation
- The uncascaded SRAM usage for an op in the cascade builder did not take into account that OFM will be reusing the IFM for elementwise ops and resulted in wrong values for the uncascaded memory. - Changed code to use the _estimate_sram_usage since this function does the calucation correctly. Change-Id: I681bcf6e45ee869bbfb92306869b18ee4a838325 Signed-off-by: Johan Alfven <johan.alfven@arm.com>
-rw-r--r--ethosu/vela/cascade_builder.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/ethosu/vela/cascade_builder.py b/ethosu/vela/cascade_builder.py
index 3a3026fe..0e651b90 100644
--- a/ethosu/vela/cascade_builder.py
+++ b/ethosu/vela/cascade_builder.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
+# SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -222,7 +222,6 @@ class CascadeBuilder:
break
# Get the size of the FeatureMap buffers between current and neighbouring Ops
- op_full_ifm = current_op.ifm_size_in_bytes()
op_full_ofm = current_op.ofm_size_in_bytes()
_, op_ifm_buffer = buffers.get_buffer(producer, current_op, ref_cost)
@@ -230,7 +229,7 @@ class CascadeBuilder:
op_weight_buffer = sum(tens.storage_size() for tens in ref_cost[current_op].buffered_weight_tensors)
# Calculate the uncascaded memory requirement for current Op
- uncascaded_sram_usage = op_full_ifm + op_full_ofm + self.non_local_mem_usage.get(current_op, 0)
+ uncascaded_sram_usage = self._estimate_sram_usage(current_op, fallback_cost[current_op])
# Add current Op to cascade
ops_in_cascade.append(current_op)