How to obtain operators that have not been converted to CMSIS-NN in the model

I referenced the code provided in the TVM repository to convert a Paddle model. However, I noticed that some operators in the Paddle model were not successfully converted to CMSIS-NN operators. How can I identify these operators to facilitate improvements to the model?

I used the following bash command to convert the model:

python3 -m tvm.driver.tvmc compile --target=cmsis-nn,c \
    --target-cmsis-nn-mcpu=$architecture \
    --target-c-mcpu=$architecture \
    --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 \
    $tvm_input_model_path \
    --output-format=mlf \
    --model-format=paddle \
    --module-name=$tvm_output_model_name \
    --input-shapes $model_input_node_name:[1,3,224,224] \
    --output=$tvm_output_zip_name

From what I recall, the CMSIS-NN backend only has support for a couple of operators. You can see which operators are supported here.

1 Like

TVMC compile has an option called --dump-offloads that will indicate which operators were mapped to an external codegen and those that weren’t. See https://github.com/apache/tvm/blob/fa223b077f3fb375e42f1e0d4563330daa730f18/python/tvm/driver/tvmc/compiler.py#L78 for more info

1 Like

Thank you, this is very helpful to me.