aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-05-19 07:26:03 +0200
committerJohan Alfvén <johan.alfven@arm.com>2022-05-19 14:12:17 +0200
commit1e363b10a6d4ce0fc062e34df0182b847b08850d (patch)
tree645af2fcc70d9bd899f84aaf2abbf198b37e3f6f
parent0b20781caf7e4fa22f9b9bf2c080c3dbeff8c643 (diff)
downloadethos-u-vela-1e363b10a6d4ce0fc062e34df0182b847b08850d.tar.gz
MLBEDSW-6430: MLCE: Update to graph has sequential ethos-u ops
Update to the "Vela splitting network into two ethos operators" patch allowing the CPU pass to be moved last in the pass_list. Signed-off-by: Johan Alfven <johan.alfven@arm.com> Change-Id: I2e8a299101e5d65e963327bed7c8d891fff6523e
-rw-r--r--ethosu/vela/pass_packing.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/ethosu/vela/pass_packing.py b/ethosu/vela/pass_packing.py
index 74e1f34..050b096 100644
--- a/ethosu/vela/pass_packing.py
+++ b/ethosu/vela/pass_packing.py
@@ -501,6 +501,7 @@ def pack_into_passes(nng, arch, verbose_packing=False):
# Sort the rest of the list based on critera 2.
# Search from bottom of list and when a CPU pass is found
# search forward in the list and see if it is possible to join another CPU pass.
+ last_idx = len(pass_list) - 1
for cpu_ps in reversed(pass_list):
if cpu_ps.placement != PassPlacement.Cpu:
continue
@@ -513,13 +514,20 @@ def pack_into_passes(nng, arch, verbose_packing=False):
insert_index = pass_list.index(next_ps)
pass_list.insert(insert_index, cpu_ps)
break
+
if (
- cpu_ps.ops[0].ofm not in [next_ps.ops[0].ifm, next_ps.ops[0].ifm2]
- and next_ps.placement != PassPlacement.MemoryOnly
+ cpu_ps.ops[0].ofm in [next_ps.ops[0].ifm, next_ps.ops[0].ifm2]
+ or next_ps.placement == PassPlacement.MemoryOnly
):
- continue
+ # Not possible to move
+ break
+
+ if pass_list.index(next_ps) == last_idx:
+ # Last element, ok to move the CPU pass
+ pass_list.remove(cpu_ps)
+ pass_list.append(cpu_ps)
+ break
- break
pass_list_top.extend(pass_list)
sg.passes = pass_list_top