I quantified the yolov5s model into the int8 tflite format and then compiled it via tvmc:
The command I use:
tvmc compile --target=ethos-u,cmsis-nn,c \
--target-ethos-u-accelerator_config=ethos-u55-256 \
--target-cmsis-nn-mcpu=cortex-m55 \
--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 \
./yolov5s-int8.tflite \
--output-format=mlf
But I found that errors would occur in three operators: These operators are MULs, but they perform multiplying the same variable. This will cause only one variable to be created in the subsequent MerCompiler pass, but originally this mul is a two-input variable, thus causing subsequent errors
class MulRewriter(BinaryElementwiseRewriter):
def __init__(self):
super().__init__(
params_class=ethosu_patterns.MulParams,# MulParams在前面的时候应该就调用了
pattern=(wildcard().has_attr({"Composite": ethosu_patterns.MulParams.composite_name}))( #
wildcard(), wildcard()
),
)
I tried to modify my yolo model (yolo.py, yolo.onnx), but after quantifying it to tflie, it was still the same. Now I want to make the MergeComposite pass create two variables instead of the same variable when it creates the function. I wonder if it works?
