From f9194e11b2d2f1e813e347cad2d863a26115fa7e Mon Sep 17 00:00:00 2001 From: Johan Alfven Date: Mon, 22 Apr 2024 15:17:33 +0200 Subject: MLBEDSW-8973: MLCE: Fix assert in build pass links - Assert in build pass links due to that a concat op is split into several avg pools op which run in different custom ops. The code did not expected the pass to have a dependency to itself. - Fixed the assert to handle this special case Change-Id: Id03b1145b19c25bf967a1061aa5ecf559b3bc1cc Signed-off-by: Johan Alfven --- ethosu/vela/nn_graph.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ethosu/vela/nn_graph.py b/ethosu/vela/nn_graph.py index 3c87f9be..b9eee28b 100644 --- a/ethosu/vela/nn_graph.py +++ b/ethosu/vela/nn_graph.py @@ -253,7 +253,10 @@ class Subgraph: for tens in ps.inputs: for op in tens.ops: pred_pass = op.scheduled_pass - assert pred_pass.time < ps.time + # Pass with split concat ops may end up with a dependency to + # itself since output from concat is produced by several avg pool ops. + # Hence pred_pass can be equal to ps. + assert pred_pass == ps or pred_pass.time < ps.time if ps not in pred_pass.successors: pred_pass.successors.append(ps) -- cgit v1.2.1