Free(): invalid pointer Aborted

When I ran the pytorch model, the terminal showed that:

One or more operators have not been tuned. Please tune your model for better performance. Use DEBUG logging level to see more details.

Relay top-1 id: 281, class name: tabby, tabby cat, class probality: 0.3626886010169983

Torch top-1 id: 281, class name: tabby, tabby cat, class probality: 0.36268892884254456

Relay time(ms): 41.741

Torch time(ms): 16.326

free(): invalid pointer

Aborted.

Why the relay time is twice than the torch time and how to avoid the free()?

As the message says, you need to tune for your workload to obtain reasonable performance.

invalid pointer problem is due to symbol crash between PyTorch and TVM. There is an open issue for this problem. https://github.com/apache/tvm/issues/9362

For now, swapping the import order of tvm and torch should fix this problem.

It didn’t seem to work for me …

I see the github issues and tried many times, but it didn’t work. I wonder how to use the pdb and gdb to debug. Would you please give me some advice?

Please try the new solution posted in https://github.com/apache/tvm/issues/9362#issuecomment-955263494

Thank you for your github issue, but it still didn’t work for me…

You need to replace /path/to/llvm-config with the actual path to your llvm-config, for example /usr/bin/llvm-config.

Hello, the below picture is my path and my setting. I tried again, but the error still exists…

ZY$H@MBP@EFOGTLBVR2_0S S@H`EFUCCQ}D8S0EH_XOL

Thank you for your answer sincerely, but I wonder if the pictures below should be the proper settings.

You need to modify USE_LLVM and HIDE_PRIVATE_SYMBOLS in build/config.cmake

Thank you very much, I have solved this problem successfully.