From 1657307bbea6a73cad58623cf54d72d15693345f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Alfv=C3=A9n?= Date: Thu, 22 Dec 2022 10:12:54 +0100 Subject: 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 --- ethosu/vela/cascade_builder.py | 5 ++--- 1 file 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 +# SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates # # 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) -- cgit v1.2.1