From d2e03c61b028f9f84fd61812ea8905bf68f482e3 Mon Sep 17 00:00:00 2001 From: Tim Hall Date: Tue, 19 Dec 2023 11:17:37 +0000 Subject: MLBEDSW-8467: verbose-allocation memory usage is incorrect - The issue was that the peak memory usage was only evaluated at the start of the tensor's lifetime and not across its whole lifetime - The fix is to look for the maximum usage between start and end Change-Id: Iff4f390f3a017f1df0f8933796fa5282db7870db Signed-off-by: Tim Hall --- ethosu/vela/tensor_allocation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethosu/vela/tensor_allocation.py b/ethosu/vela/tensor_allocation.py index fa9ace1..7a7aaa4 100644 --- a/ethosu/vela/tensor_allocation.py +++ b/ethosu/vela/tensor_allocation.py @@ -165,7 +165,7 @@ def print_allocation(lrs, mem_area, mem_type_set, tensor_allocator, sg, actual_m ): print( f"{start_time:10d} - {end_time:10d}: {start_addr:#10x} - {end_addr:#10x}: {size:11d}:" - f" {memory_hist[start_time]:12d}: {purpose.display_name():12s}: {name:s}" + f" {max(memory_hist[start_time:end_time+1]):12d}: {purpose.display_name():12s}: {name:s}" ) alloc_overhead_fraction = (actual_mem_usage_for_alloc - min_mem_usage_for_alloc) / min_mem_usage_for_alloc -- cgit v1.2.1