aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRickard Bolin <rickard.bolin@arm.com>2022-05-19 12:38:27 +0000
committertim.hall <tim.hall@arm.com>2022-05-19 14:44:45 +0000
commiteb5a4a857cca3ae18928268adfcffe91efd48fd9 (patch)
tree68be81a0c1ea95a55ce5288e2a495956c99b2fbd
parent0f98de67b2f929a1297326721eb421f0a44ef216 (diff)
downloadethos-u-vela-eb5a4a857cca3ae18928268adfcffe91efd48fd9.tar.gz
MLBEDSW-6271: Key error when using --verbose-performance option
- The print_performance function that is called when using the --verbose-performance option crashed with KeyError when no SRAM was used. Signed-off-by: Rickard Bolin <rickard.bolin@arm.com> Change-Id: Ib6af3193e8f4f368cb28d51e65afa0751773628a
-rw-r--r--ethosu/vela/npu_performance.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ethosu/vela/npu_performance.py b/ethosu/vela/npu_performance.py
index 0e2e3ca..6d99dea 100644
--- a/ethosu/vela/npu_performance.py
+++ b/ethosu/vela/npu_performance.py
@@ -804,12 +804,14 @@ def print_performance(
src_op_name = nng_optype_to_input_op_type(src_op_type)
max_macs = cycles[sched_op][PassCycles.Total] * arch.num_macs_per_cycle * arch.ncores
-
+ peak_sram = (
+ mem_usage[sched_op] / nng.memory_used[MemArea.Sram] * 100 if MemArea.Sram in nng.memory_used else 0
+ )
print(
f" {src_op_name:20s}"
f" {sched_op.op_type:20s}"
f" {mem_usage[sched_op]:10.0f}"
- f" ({mem_usage[sched_op] / nng.memory_used[MemArea.Sram] * 100:6.2f}%)"
+ f" ({peak_sram:6.2f}%)"
f" {cycles[sched_op][PassCycles.Total]:10.0f}"
f" ({cycles[sched_op][PassCycles.Total] / nng.cycles[PassCycles.Total] * 100:6.2f}%)"
f" ["