aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-12-09 17:50:48 +0100
committerFredrik Svedberg <fredrik.svedberg@arm.com>2022-12-15 12:44:38 +0000
commiteb332a3bc50dffcf93f5005eaddd1aa64a7aed25 (patch)
tree6dc4afd07f4c6b6168a6ef428177032cbb9e16da
parent2f87617ef1ed682a5a0ac2138fc9fd551c93fd74 (diff)
downloadethos-u-vela-eb332a3bc50dffcf93f5005eaddd1aa64a7aed25.tar.gz
MLBEDSW-7179: Fix assert for non local memory calculation
IFM's in persistent memory should not be included in the memory op SRAM calculation. Change-Id: Iaac4d2ad8b206c5fb727e5815477cb3611a13e0e Signed-off-by: Johan Alfven <johan.alfven@arm.com>
-rw-r--r--ethosu/vela/scheduler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ethosu/vela/scheduler.py b/ethosu/vela/scheduler.py
index c7d08fbb..dd66ec84 100644
--- a/ethosu/vela/scheduler.py
+++ b/ethosu/vela/scheduler.py
@@ -975,8 +975,13 @@ class Scheduler:
op_mem_usage = 0
else:
# Min schedule only have ifm and ofm in SRAM (no buffered weigth tensors)
+ # Only include IFM's that are in the scratch area
+ ifm = sched_op.ifm.connection.parent_tens
+ ifm_size = (
+ 0 if ifm.mem_type not in (MemType.Scratch, MemType.Scratch_fast) else sched_op.ifm_size_in_bytes()
+ )
ofm_size = 0 if ofm_can_reuse_ifm(sched_op) else sched_op.ofm_size_in_bytes()
- op_mem_usage = sched_op.ifm_size_in_bytes() + ofm_size
+ op_mem_usage = ifm_size + ofm_size
non_local_mem_usage[sched_op] = min_schedule.memory_snapshot[time_index] - op_mem_usage
assert non_local_mem_usage[sched_op] >= 0