aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-06-24 08:42:19 +0200
committerJohan Alfvén <johan.alfven@arm.com>2022-06-27 11:35:41 +0200
commit68b8f2f9457d56df3211be5318e3682332bcefbf (patch)
tree3bee26a71de870e0c92d7d6ab1744416e4852b16
parent5c30971e1025eae428f6a74ca5f828919b2c34d4 (diff)
downloadethos-u-vela-68b8f2f9457d56df3211be5318e3682332bcefbf.tar.gz
MLBEDSW-6639: Bug fix for evicted FMS in the fast storage allocator
- The fast storage allocator is supposed to add all feature maps that does not fit in SRAM to an evicted list. However, in the case when conflicting tensors were handled the list was not updated. -This patch makes sure to update the list correctly. Signed-off-by: Johan Alfven <johan.alfven@arm.com> Change-Id: Ibeb3b4e4927f22a8206784a478f1ac38bd7f5a87
-rw-r--r--ethosu/vela/scheduler.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/ethosu/vela/scheduler.py b/ethosu/vela/scheduler.py
index 4360c9a3..0e17d705 100644
--- a/ethosu/vela/scheduler.py
+++ b/ethosu/vela/scheduler.py
@@ -1248,6 +1248,7 @@ class Scheduler:
staging_limit,
self.scratched_fms,
competing_tens_access,
+ self.evicted_fms,
)
start = i
start_time = lr.start_time
@@ -1260,6 +1261,7 @@ class Scheduler:
staging_limit,
self.scratched_fms,
competing_tens_access,
+ self.evicted_fms,
)
def move_constant_data(self):
@@ -1434,7 +1436,9 @@ class FastStorageComponentAllocator:
base_mem_usage[t] += lr.size
assert base_mem_usage[t] <= staging_limit
- def allocate_component(self, allocator, lrs, max_mem, min_mem, staging_limit, scratched_fms, competing_tens_access):
+ def allocate_component(
+ self, allocator, lrs, max_mem, min_mem, staging_limit, scratched_fms, competing_tens_access, evicted_fms
+ ):
sz = len(lrs)
allocator.lrs = lrs
allocator.evicted = [0] * len(lrs)
@@ -1453,8 +1457,12 @@ class FastStorageComponentAllocator:
for i, e in enumerate(allocator.evicted):
if e:
self.evict(lrs[i], max_mem, scratched_fms)
+ if lrs[i] not in evicted_fms:
+ evicted_fms.append(lrs[i])
else:
self.keep(lrs[i], min_mem, staging_limit)
+ if lrs[i] in evicted_fms:
+ evicted_fms.remove(lrs[i])
def schedule_passes(nng: Graph, arch: ArchitectureFeatures, options, scheduler_options: SchedulerOptions):