Check failed: (pf != nullptr) is false: no such function in module: tvmgen_default_cmsis_nn_main_0

Hi All, I am getting an issue with implementation of TFLite Person Detection model over zephyr project with CMSIS-NN for nucleo_u575zi_q board. I am using TVMC in linux PC

TVMC Compile Command: python -m tvm.driver.tvmc compile /home/test/vyoma/tvm_tflite/models/96_grey_quantize_aware.tflite --target=‘cmsis-nn,c -march=armv8-m -mcpu=cortex-m33 -model=nucleo_u575zi_q’ --runtime=crt --runtime-crt-system-lib 1 --executor=‘graph’ --executor-graph-link-params 0 --output model_cmsisnn.tar --output-format mlf --pass-config tir.disable_vectorize=1 --disabled-pass=AlterOpLayout

model structure after this is: image

I cloned CMSIS-NN from Git_CMSISNN

Create command: python -m tvm.driver.tvmc micro create --force project_cmsisnn ./model_cmsisnn.tar zephyr --project-option project_type=host_driven board=nucleo_u575zi_q workspace_size_bytes=600000 cmsis_path="/home/test/vyoma/tvmc_tflite" config_main_stack_size=10000

Build command: python -m tvm.driver.tvmc micro build --force project_cmsisnn zephyr

Flash command: python -m tvm.driver.tvmc micro flash project_cmsisnn zephyr

Run command: python -m tvm.driver.tvmc -vvvv run --device micro project_cmsisnn --options zephyr_board=nucleo_u575zi_q --fill-mode ones --print-top 2

Project gets built and flashed over the board. But when I am running it, I am getting the TVMerror where:

Traceback (most recent call last): File “/home/test/anaconda3/envs/tvmc_tflite/lib/python3.9/runpy.py”, line 197, in _run_module_as_main return _run_code(code, main_globals, None, File “/home/test/anaconda3/envs/tvmc_tflite/lib/python3.9/runpy.py”, line 87, in _run_code exec(code, run_globals) File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/driver/tvmc/main.py”, line 24, in tvmc.main.main() File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/driver/tvmc/main.py”, line 115, in main sys.exit(_main(sys.argv[1:])) File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/driver/tvmc/main.py”, line 103, in _main return args.func(args) File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/driver/tvmc/runner.py”, line 280, in drive_run result = run_module( File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/driver/tvmc/runner.py”, line 655, in run_module module = tvm.micro.create_local_graph_executor(tvmc_package.graph, lib, dev) File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/micro/session.py”, line 226, in create_local_graph_executor fcreate(graph_json_str, mod, lookup_remote_linked_param, device_type_id) File “/home/test/vyoma/tvmc_tflite/tvm/python/tvm/_ffi/_ctypes/packed_func.py”, line 237, in call raise get_last_ffi_error() tvm._ffi.base.TVMError: Traceback (most recent call last): 5: TVMFuncCall 4: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue)#1}> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) 3: tvm::runtime::GraphExecutorCreate(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, tvm::runtime::Module const&, std::vector<DLDevice, std::allocator > const&, tvm::runtime::PackedFunc) 2: tvm::runtime::GraphExecutor::Init(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, tvm::runtime::Module, std::vector<DLDevice, std::allocator > const&, tvm::runtime::PackedFunc) 1: tvm::runtime::GraphExecutor::SetupOpExecs() 0: tvm::runtime::GraphExecutor::CreateTVMOp(tvm::runtime::TVMOpParam const&, std::vector<DLTensor, std::allocator > const&) File “/home/test/vyoma/tvmc_tflite/tvm/src/runtime/graph_executor/graph_executor.cc”, line 585 TVMError:

An error occurred during the execution of TVM. For more information, please see: Handle TVM Errors — tvm 0.11.dev0 documentation

Check failed: (pf != nullptr) is false: no such function in module: tvmgen_default_cmsis_nn_main_0

Also, I found that default_lib2.c file containing cmsis nn functions is not present in /home/test/vyoma/tvmc_tflite/project_cmsisnn/build/zephyr/zephyr.map although it is present in /home/test/vyoma/tvmc_tflite/project_cmsisnn/model/codegen/host/src/default_lib2.c