MLBEDSW-7541: Extend error message when reaching maximum recursion depth
Extend the error message of RecursionError when reaching default
recursion depth with instructions to use the "--recursion-limit"
option in Vela.
Change-Id: I5c92d49b99203268c4b988f421afe7013ac3511a
Signed-off-by: Rickard Bolin <rickard.bolin@arm.com>
diff --git a/ethosu/vela/nn_graph.py b/ethosu/vela/nn_graph.py
index 6dc6b58..50266d5 100644
--- a/ethosu/vela/nn_graph.py
+++ b/ethosu/vela/nn_graph.py
@@ -302,7 +302,13 @@
assert tens in pred_cpass.outputs
def refresh_after_modification(self):
- self.update_consumers()
+ try:
+ self.update_consumers()
+ except RecursionError as e:
+ raise RecursionError(
+ "Compilation failed due to exceeding the default maximum recursion depth.\n"
+ 'Try increasing the maximum recursion depth with the "--recursion-limit" option.'
+ ) from e
def prune_startup_init_pass(self):
assert len(self.passes) >= 1