# Graph Executor and CMSIS-NN

**URL:** <https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897>\
**Category:** Uncategorized\
**Created:** [October 30, 2023, 9:23am UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897 "2023-10-30T09:23:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@Manuel](https://discuss.tvm.apache.org/u/Manuel)\
**Post date:** [October 30, 2023, 9:23am UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897/1 "2023-10-30T09:23:37Z")

</div>

Using the Graph Executor together with CMSIS-NN I get runtime errors like

no such function in module: tvmgen\_default\_cmsis\_nn\_main\_0

In the generated code the above function uses the CMSIS-NN kernel but it is missing in the function registry, so it cannot be triggered by the RPC calls.

Are Graph Executor and CMSIS-NN supposed to be compatible (and it is a bug) or are they mutual exclusive?

---

<div class="post-metadata">

**Author:** ![lhutton1](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/lhutton1/32/3256_2.png) [@lhutton1](https://discuss.tvm.apache.org/u/lhutton1)\
**Post date:** [October 30, 2023, 9:39am UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897/2 "2023-10-30T09:39:25Z")

</div>

Hi @Manuel,

CMSIS-NN was designed to work with the Ahead of Time executor, so you may run into some issues using the Graph Executor.

---

<div class="post-metadata">

**Author:** ![Manuel](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@Manuel](https://discuss.tvm.apache.org/u/Manuel)\
**Post date:** [October 30, 2023, 10:12am UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897/3 "2023-10-30T10:12:16Z")

</div>

Thanks for the answer. Does it mean that conceptually there is no reason why Graph Executor would not work with CMSIS-NN. It is just not implemented/verified in microTVM. Correct?

Wouldn’t it be a good feature then? The Graph Executor is used during auto-tuning to improve the performance. Why should microTVM sacrifice this advantage by using a self-generated kernel that does not make as much use of the SIMD capabilities of the target hardware (Cortex-M4) as the CMSIS-NN kernel does?

---

<div class="post-metadata">

**Author:** ![lhutton1](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/lhutton1/32/3256_2.png) [@lhutton1](https://discuss.tvm.apache.org/u/lhutton1)\
**Post date:** [October 31, 2023, 9:43am UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897/4 "2023-10-31T09:43:38Z")

</div>

In the current implementation, CMSIS-NN support relies on the [target hook system](https://discuss.tvm.apache.org/t/pre-rfc-additional-target-hooks/10430). This system supported by the Ahead of Time Executor, while it’s not been used with the Graph Executor. I don’t see any reason CMSIS-NN wouldn’t work with the Graph Executor, it’s just a case of enablement and adding the plumbing.

Currently we rely on CMSIS-NN kernels being greedily partitioned where they are supported. Tuning might be able to make better decisions about what kernel to use, although I’m not aware of a compilation flow that exists today capable of doing that.

---

<div class="post-metadata">

**Author:** ![ebraheema](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/ebraheema/32/6041_2.png) [@ebraheema](https://discuss.tvm.apache.org/u/ebraheema)\
**Post date:** [March 3, 2024, 7:27pm UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897/5 "2024-03-03T19:27:51Z")

</div>

Hi @Manuel , @lhutton1i am running into the same issue , _tvm\_func\_registry has only two functions: static const TVMFuncRegistry tvm\_func\_registry = { "\002\000tvmgen\_default\_fused\_reshape\000\_\_tvm\_main_\000", \_tvm\_func\_array, };

and my case run without calling any function , had you find a way to make it work? is there a plan to enable that?

---

<div class="post-metadata">

**Author:** ![Manuel](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@Manuel](https://discuss.tvm.apache.org/u/Manuel)\
**Post date:** [March 4, 2024, 8:12am UTC](https://discuss.tvm.apache.org/t/graph-executor-and-cmsis-nn/15897/6 "2024-03-04T08:12:31Z")

</div>

Hi @ebraheema, I didn’t get it working. For the moment, I am using the AoT Executor.
