I’m using relay.frontend.from_pytorch to convert pytorch model, but face some problem on this:
File “TSM_tvm.py”, line 52, in torch2tvm_module
relay_module, params = tvm.relay.frontend.from_pytorch(scripted_model, shape_list)
File “/home/po/Desktop/tvm/python/tvm/relay/frontend/pytorch.py”, line 3996, in from_pytorch
converter.report_missing_conversion(op_names)
File “/home/po/Desktop/tvm/python/tvm/relay/frontend/pytorch.py”, line 3202, in report_missing_conversion
raise NotImplementedError(msg)
NotImplementedError: The following operators are not implemented: [‘aten::triu’, ‘prim::PythonOp’, ‘aten::copy_’]
However if the ops are not supported by ONNX then TVM will also have an issue.
Sometimes model writers for PyTorch will create custom C++/CUDA versions of their ops to speed up training, which are represented as prim::PythonOp when attempting to import into TVM. However sometimes there may also be a “pure PyTorch” implementation of said operations that can be enabled.