aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfven <johan.alfven@arm.com>2023-03-09 16:01:00 +0100
committerJohan Alfven <johan.alfven@arm.com>2023-03-10 14:13:57 +0100
commitc72cac8e8beb6bd52bdf6a41e6f7182b5167ee5d (patch)
treeda2bf5a459eedad7ea27ca12a35d94080e6565ba
parent3ac03be07f89655debd3cd4364d4ed9b22bfa507 (diff)
downloadethos-u-vela-c72cac8e8beb6bd52bdf6a41e6f7182b5167ee5d.tar.gz
MLBEDSW-7386: Fix assert in pass packing
- The assert was caused due to a faulty optimization being done in the pass packing when trying to group CPU passes. The code did not take into account that a CPU op could have many outputs. -The fix is to make sure that the pass the follows the CPU pass is not dependent on any of the outputs from the CPU pass. If there is a dependency the CPU pass cannot be moved. Change-Id: Ia0c90bae1ed97d503a97e7bc353f834a0fa75130 Signed-off-by: Johan Alfven <johan.alfven@arm.com>
-rw-r--r--ethosu/vela/pass_packing.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ethosu/vela/pass_packing.py b/ethosu/vela/pass_packing.py
index 6049366f..5a9f9575 100644
--- a/ethosu/vela/pass_packing.py
+++ b/ethosu/vela/pass_packing.py
@@ -520,11 +520,12 @@ def pack_into_passes(nng, arch, verbose_packing=False):
pass_list.insert(insert_index, cpu_ps)
break
+ # Check all outputs from the cpu pass
if (
- cpu_ps.ops[0].ofm in [next_ps.ops[0].ifm, next_ps.ops[0].ifm2]
+ any(ofm in [next_ps.ops[0].ifm, next_ps.ops[0].ifm2] for ofm in cpu_ps.ops[0].outputs)
or next_ps.placement == PassPlacement.MemoryOnly
):
- # Not possible to move
+ # Not possible to move since next pass depends on the output from the cpu pass
break
if pass_list.index(next_ps) == last_idx: