From 12fe0e9abdf789f2dd6695b95b8d18e46b1512d7 Mon Sep 17 00:00:00 2001 From: Janet Schneider <21978033+janetsc@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:32:21 -0800 Subject: [PATCH] [AOT]Aot module post-test error workaround (#13685) The deletion of the AotModule python object results in the device shutting down RPC too early, causing an assertion in the DSP. This is a temporary workaround while this is still being investigated. The workaround is to keep a reference to the AotModule object in the HexagonSession object, so it stays until the session has been shut down. --- python/tvm/contrib/hexagon/session.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/tvm/contrib/hexagon/session.py b/python/tvm/contrib/hexagon/session.py index 466103f6e2c9..506f1d968d70 100644 --- a/python/tvm/contrib/hexagon/session.py +++ b/python/tvm/contrib/hexagon/session.py @@ -248,8 +248,9 @@ def get_aot_executor( GraphModule : Runtime graph module that can be used to execute the graph. """ - aot_mod = self.load_module(module_file) - return tvm.runtime.executor.AotModule(aot_mod["default"](self.device)) + # Temporary workaround for https://github.com/apache/tvm/issues/13741 + self.aot_mod = self.load_module(module_file) + return tvm.runtime.executor.AotModule(self.aot_mod["default"](self.device)) def get_graph_debug_executor( self,