I am trying to use MicroTVM’s compile flow directly from my Python script (for automating purposes). Compiling the model through the tvmc CLI works fine, but I am failing to convert all parameters to the appropriate parameters in the Python TVMC interface.
The CLI input looks like this:
tvmc compile \
--target=ethos-u,cmsis-nn,c \
--target-ethos-u-accelerator_config=ethos-u55-128 \
--target-c-mcpu=cortex-m55 \
--runtime=crt \
--executor=aot \
--executor-aot-interface-api=c \
--executor-aot-unpacked-api=1 \
--pass-config tir.usmp.enable=1 \
--pass-config tir.usmp.algorithm=hill_climb \
--pass-config tir.disable_storage_rewrite=1 \
--pass-config tir.disable_vectorize=1 \
--output-format=mlf \
--verbose \
test.tflite
I am especially confused about the executor-aot-interface/unpacked args as well as the target-ethos-u and target-c-mcpu arguments.
A minimal working example without Ethos-U seems to be working when using this:
target = "cmsis-nn,c"
# Set the pass configurations
pass_context_configs = {
"tir.usmp.enable=1",
"tir.usmp.algorithm=hill_climb",
"tir.disable_storage_rewrite=1",
"tir.disable_vectorize=1",
}
# Compile the model
output = tvmc.compile(
tvmc_model=model,
target=target,
output_format="mlf",
pass_context_configs=pass_context_configs,
package_path="./module.tar"
)
but I am unsure, where to put the currently missing arguments.