# Is microTVM still supported?

**URL:** <https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563>\
**Category:** Questions\
**Created:** [August 6, 2024, 10:57am UTC](https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563 "2024-08-06T10:57:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomhepworth](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/tomhepworth/32/5592_2.png) [@tomhepworth](https://discuss.tvm.apache.org/u/tomhepworth)\
**Post date:** [August 6, 2024, 10:57am UTC](https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563/1 "2024-08-06T10:57:28Z")

</div>

I have raised several questions about MicroTVM, including filing a bug report concerning some fundamental features. I have not received any responses. Is the project still maintained?

---

<div class="post-metadata">

**Author:** ![zrnsm](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/z/74df32/32.png) [@zrnsm](https://discuss.tvm.apache.org/u/zrnsm)\
**Post date:** [August 9, 2024, 2:00am UTC](https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563/2 "2024-08-09T02:00:14Z")

</div>

@tomhepworth I’m concerned about the same question.

I’m also confused about why the PyPi package is so out of date.

The stable release is 0.12.0 ([https://pypi.org/project/apache-tvm](https://pypi.org/project/apache-tvm)).

I’m relying on a workflow right now that uses the 0.14.dev273 release to compile ONNX to C that I pieced together from the various bits of MicroTVM documentation. This works well enough for my purposes right now but I don’t have a ton of confidence in the health of the project. I’m considering trying to move to IREE but its support for microTVM-style environments is still in an early phase. See `iree-bare-metal-arm` (sorry limited to one link per post as a new user).

Let me take a look at the questions you raised and see if there’s anything I can add.

---

<div class="post-metadata">

**Author:** ![tomhepworth](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/tomhepworth/32/5592_2.png) [@tomhepworth](https://discuss.tvm.apache.org/u/tomhepworth)\
**Post date:** [August 9, 2024, 9:17am UTC](https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563/3 "2024-08-09T09:17:19Z")

</div>

Thanks for the reply, @zrnsm I will try those versions

> <https://github.com/apache/tvm/issues/17194>
>
> I am compiling a test model with the following TVMC command: 
> \`\`\`
> python -m tv…m.driver.tvmc compile test.onnx --verbose --target='c -keys=cpu' --runtime=crt --runtime-crt-system-lib=1 --executor=aot --executor-aot-interface-api=c --executor-aot-unpacked-api=1 --pass-config tir.disable\_vectorize=1 --output-format=mlf --output=model\_tvm.tar
> \`\`\`
> 
> Inside the generated \`lib0.c\` I get two definitions of both \`tvmgen\_default\_run\` and \`tvmgen\_default\_\_tvm\_main\_\_\`. This causes the following errors :
> \- \`Conflicting types for 'tvmgen\_default\_run'\`
> \- \`Conflicting types for 'tvmgen\_default\_\_\_tvm\_main\_\_'\`
> 
> By simply removing the conflicting definition I am able to compile a working binary. 
> 
> In this forum post it was resolved with unpacked-api=true, this did not work for me from tvmc. 
> https://discuss.tvm.apache.org/t/problem-with-tvmexecute-on-arduino-in-standalone-execution/15420
> This bug report also experiences the issue https://github.com/apache/tvm/issues/14871 but it has gone unaddressed 
> This bug report also mentions it but they are on tvm 0.13 https://github.com/apache/tvm/issues/17136
> 
> I also personally know colleagues who have experienced this too. 
> 
> \### Expected behavior
> 
> Valid C code to be generated with no conflicts
> 
> \### Actual behavior
> The following is generated: 
> 
> \`\`\`C
> ....
> 
> TVM\_DLL int32\_t
> tvmgen\_default\_run(TVMValue \*args, int \*type\_code, int num\_args,
> TVMValue \*out\_value, int \*out\_type\_code,
> void \*resource\_handle);
> 
> ...
> 
> \#ifdef \_\_cplusplus
> extern "C"
> \#endif
> TVM\_DLL int32\_t
> tvmgen\_default\_\_\_tvm\_main\_\_(TVMValue \*args, int \*type\_code, int num\_args,
> TVMValue \*out\_value, int \*out\_type\_code,
> void \*resource\_handle);
> static TVMBackendPackedCFunc \_tvm\_func\_array\[\] = {
> (TVMBackendPackedCFunc)tvmgen\_default\_run,
> (TVMBackendPackedCFunc)tvmgen\_default\_fused\_nn\_contrib\_dense\_pack,
> (TVMBackendPackedCFunc)tvmgen\_default\_fused\_reshape,
> (TVMBackendPackedCFunc)tvmgen\_default\_fused\_reshape\_add\_nn\_relu,
> (TVMBackendPackedCFunc)tvmgen\_default\_\_\_tvm\_main\_\_,
> };
> static const TVMFuncRegistry \_tvm\_func\_registry = {
> "\\005\\000tvmgen\_default\_run\\000tvmgen\_default\_fused\_nn\_contrib\_dense\_"
> "pack\\000tvmgen\_default\_fused\_reshape\\000tvmgen\_default\_fused\_reshape\_add\_"
> "nn\_relu\\000tvmgen\_default\_\_\_tvm\_main\_\_\\000",
> \_tvm\_func\_array,
> };
> static const TVMModule \_tvm\_system\_lib = {
> &\_tvm\_func\_registry,
> };
> const TVMModule \*TVMSystemLibEntryPoint(void) { return &\_tvm\_system\_lib; }
> \#include "tvm/runtime/c\_runtime\_api.h"
> \#ifdef \_\_cplusplus
> extern "C" {
> \#endif
> \_\_attribute\_\_((
> section(".rodata.tvm"), )) static const struct global\_const\_workspace {
> float fused\_constant\_let\[10\]
> \_\_attribute\_\_((aligned(16))); // 40 bytes, aligned offset: 0
> float fused\_constant\_1\_let\[1\]
> \_\_attribute\_\_((packed, aligned(16))); // 4 bytes, aligned offset: 48
> } global\_const\_workspace = {
> .fused\_constant\_let = {-0x1.23b7a4p-2, 0x1.08fb6cp-2, 0x1.4128e2p-4,
> -0x1.03f552p-2, -0x1.09157ep-2, 0x1.8a4daep-4,
> -0x1.ffa53ep-3, -0x1.2849ep-3, -0x1.c1e5cp-3,
> -0x1.1a14aap-6},
> .fused\_constant\_1\_let = {-0x1.25dc64p-3},
> }; // of total size 52 bytes
> \_\_attribute\_\_((section(".bss.noinit.tvm"),
> aligned(16))) static uint8\_t global\_workspace\[68\];
> \#include \<tvmgen\_default.h\>
> TVM\_DLL int32\_t tvmgen\_default\_\_\_tvm\_main\_\_(
> void \*onnx\_\_MatMul\_0, void \*output0, uint8\_t \*global\_const\_workspace\_0\_var,
> uint8\_t \*global\_workspace\_1\_var);
> int32\_t tvmgen\_default\_run(struct tvmgen\_default\_inputs \*inputs,
> struct tvmgen\_default\_outputs \*outputs) {
> return tvmgen\_default\_\_\_tvm\_main\_\_(inputs-\>onnx\_\_MatMul\_0, outputs-\>output,
> ((uint8\_t \*)&global\_const\_workspace),
> ((uint8\_t \*)&global\_workspace));
> }
> \#ifdef \_\_cplusplus
> }
> \#endif
> ;
> \`\`\`
> 
> \### Environment
> 
> Any environment details, such as: Operating System, TVM version, etc
> 
> OS: RHEL8
> \`\`\`
> $ python -m tvm.driver.tvmc --version
> \[15:48:26\] /home/dev/tvm/src/runtime/logging.cc:390: TVM\_LOG\_DEBUG enables VLOG statements in 'ir/transform.cc' up to level 1
> \[15:48:26\] /home/dev/tvm/src/runtime/logging.cc:390: TVM\_LOG\_DEBUG enables VLOG statements in 'relay/ir/transform.cc' up to level 1
> 0.17.dev0
> \`\`\`
> 
> \### Steps to reproduce
> 
> \`\`\`
> python -m tvm.driver.tvmc compile test.onnx --verbose --target='c -keys=cpu' --runtime=crt --runtime-crt-system-lib=1 --executor=aot --executor-aot-interface-api=c --executor-aot-unpacked-api=1 --pass-config tir.disable\_vectorize=1 --output-format=mlf --output=model\_tvm.tar
> \`\`\`
> 
> where test.onnx is simply a torch.Linear followed by a relu. 
> 
> \### Triage
> 
> \* backend:c

This is my main problem, Id be grateful for any help.

---

<div class="post-metadata">

**Author:** ![tqchen](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/tqchen/32/5_2.png) [@tqchen](https://discuss.tvm.apache.org/u/tqchen)\
**Post date:** [August 9, 2024, 6:27pm UTC](https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563/4 "2024-08-09T18:27:38Z")

</div>

The recent development focus has been around the latest Relax development and support for emerging models. The relax development have the potential to simplify more things in bringing up new compilations, including those in micro environment. However, the current community effort on relax has been mainly on genAI workloads and there has not yet been support for bare metal environment. The origianl microTVM in legacy flow is mostly in maintainace mode.

---

<div class="post-metadata">

**Author:** ![tomhepworth](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/tomhepworth/32/5592_2.png) [@tomhepworth](https://discuss.tvm.apache.org/u/tomhepworth)\
**Post date:** [August 12, 2024, 3:12am UTC](https://discuss.tvm.apache.org/t/is-microtvm-still-supported/17563/5 "2024-08-12T03:12:34Z")

</div>

@tqchen So do you mean that a replacement for MicroTVM is coming eventually? In the mean time it does seem like there are problems with the basic operation of MicroTVM. Perhaps I am just using it wrong? I know of several people/companies who would like to use MicroTVM but are struggling with the issue I describe above.
