From f697eac94d8d391fbe6fafac9c5b460ffae4cef6 Mon Sep 17 00:00:00 2001 From: Alexander Bengtsson Date: Fri, 23 Feb 2024 08:55:56 +0000 Subject: MLBEDSW-8725: Remove scales & biases from --verbose-weights Remove scales and biases from encoded weights size. This aligns better with original weights size (which only represents the weight tensor) Change-Id: I5aabf61385d8fdf150764c45e04ba4388c6a63f0 Signed-off-by: Alexander Bengtsson --- ethosu/vela/npu_performance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ethosu/vela/npu_performance.py b/ethosu/vela/npu_performance.py index dfb7006..32d0749 100644 --- a/ethosu/vela/npu_performance.py +++ b/ethosu/vela/npu_performance.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2020-2024 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # @@ -954,7 +954,11 @@ def calc_new_performance_for_network( if encoded_npu_weight and (encoded_npu_weight.equivalence_id not in encoded_npu_weight_uuids): encoded_npu_weight_uuids.add(encoded_npu_weight.equivalence_id) - total_encoded_weight_size += len(encoded_npu_weight.buffer) + # Get total weight size from encoded ranges + sz = 0 + for key in encoded_npu_weight.encoded_ranges: + sz += encoded_npu_weight.encoded_ranges[key].weight_bytes + total_encoded_weight_size += sz total_bws += bws[sched_op] total_macs += macs[sched_op] -- cgit v1.2.1