After importing model from Tensorflow Saved Model, I simply use
mod = relay.quantize.quantize(mod, params=params)
to quantize model.
I was able to build and run with the target “llvm”, but got segment fault with the target “llvm -mcpu=skylake-avx512” and “llvm -mcpu=cascadelake” during relay.build.
I’m testing on a machine with an Intel ® Xeon ® Platinum 8269(Cascade Lake) CPU, and trying to evaluate the performance of TVM quantization with the acceleration of VNNI instruction.
Since your segment fault is very likely to take place in the intrinsics, I think it’s better to build TVM with CMAKE_BUILD_TYPE=Debug , and start your python script with
$ gdb --fullname python3
(gdb) run your_script.py
<your segment fault take place here>
(gdb) bt
The back trace command would help you locate the error.
This seems like the legalization or AlterOpLayout problem. Try with opt_level=0 and see if it passes.
I am travelling right now, so will not be able to reproduce the problem on my end quickly. You can also try 'return None` in Legalize and AlterOpLayout for conv2d and see if it passes. If it does, then the problem is definitely in one of those 2 passes.
Thanks for your reply. I’ve tried with opt_level=0 and it passed. But the performance is fairly poor.
I also tried to add LOG in code. It crashed when performing Legalize pass or FoldScaleAxis pass.