diff options
author | Johan Alfvén <johan.alfven@arm.com> | 2022-12-09 17:50:48 +0100 |
---|---|---|
committer | Fredrik Svedberg <fredrik.svedberg@arm.com> | 2022-12-15 12:44:38 +0000 |
commit | eb332a3bc50dffcf93f5005eaddd1aa64a7aed25 (patch) | |
tree | 6dc4afd07f4c6b6168a6ef428177032cbb9e16da /ethosu | |
parent | 2f87617ef1ed682a5a0ac2138fc9fd551c93fd74 (diff) | |
download | ethos-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>
Diffstat (limited to 'ethosu')
-rw-r--r-- | ethosu/vela/scheduler.py | 7 |
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 |