diff options
author | Johan Alfven <johan.alfven@arm.com> | 2023-03-09 16:01:00 +0100 |
---|---|---|
committer | Johan Alfven <johan.alfven@arm.com> | 2023-03-10 14:13:57 +0100 |
commit | c72cac8e8beb6bd52bdf6a41e6f7182b5167ee5d (patch) | |
tree | da2bf5a459eedad7ea27ca12a35d94080e6565ba /ethosu/vela | |
parent | 3ac03be07f89655debd3cd4364d4ed9b22bfa507 (diff) | |
download | ethos-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>
Diffstat (limited to 'ethosu/vela')
-rw-r--r-- | ethosu/vela/pass_packing.py | 5 |
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: |