aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bengtsson <Alexander.Bengtsson@arm.com>2024-02-23 08:55:56 +0000
committerAlexander Bengtsson <alexander.bengtsson@arm.com>2024-03-12 15:01:53 +0000
commitf697eac94d8d391fbe6fafac9c5b460ffae4cef6 (patch)
treebf375a2681abadda4fa212a145d8d18e090c6715
parentb90666d9b43f4b5223bb4dcecdbee87b2ad757c2 (diff)
downloadethos-u-vela-f697eac94d8d391fbe6fafac9c5b460ffae4cef6.tar.gz
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 <Alexander.Bengtsson@arm.com>
-rw-r--r--ethosu/vela/npu_performance.py8
1 files 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 <open-source-office@arm.com>
+# SPDX-FileCopyrightText: Copyright 2020-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
#
# 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]