Dev[0]._rpc_sess.get_function("tvm.graph_executor_debug.create")

In my code, want to use debug_executor to extrace the cost time for each ops.

my code is kind of the following, and remote means tvm rpc apk


from tvm.contrib.debugger import debug_executor as graph_executor

with tvm.transform.PassContext(opt_level=3, config={"relay.backend.use_auto_scheduler": True}):
    lib = relay.build(ir_mod, target=config.target, params=params)

rlib = remote.load_module(os.path.basename(lib_file_path))
mod = debug_executor.create(lib.get_graph_json(), rlib["debug_create"]("default", dev),
                                        dev)
# set inputs
m.set_input('data', tvm.nd.array(data.astype(dtype)))
# execute
m.run()

but got errors:

---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (pf != nullptr) is false: Cannot find function tvm.graph_executor_debug.create in registry. Do you enable debug graph executor build?

I have already build runtime with

set(USE_RELAY_DEBUG ON)

set(USE_GRAPH_RUNTIME_DEBUG ON)
set(USE_GRAPH_EXECUTOR_DEBUG ON)

any idea to do it?

found solution. if anyone want to use debug_executor with android apk. add the following to apps/android_rpc/app/src/main/jni/tvm_runtime.h except for set(USE_GRAPH_EXECUTOR_DEBUG ON)

#include "../src/runtime/graph_executor/debug/graph_executor_debug.cc"