It seems like I am missing some bits in what I said above, when running the module after a build I don’t see anything getting printed, it looks like it didn’t automatically called partition_for_myccompiler
from tvm/python/tvm/relay/op/contrib/myccompiler.py
:
DEBUG:autotvm:Finish loading 35 records
WARNING:autotvm:One or more operators have not been tuned. Please tune your model for better performance. Use DEBUG logging level to see more details.
DEBUG:autotvm:Cannot find tuning records for:
target=llvm -keys=cpu -link-params=0
key=('conv2d_NCHWc.x86', ('TENSOR', (1, 1, 32, 32), 'float32'), ('TENSOR', (16, 1, 5, 5), 'float32'), (1, 1), (2, 2, 2, 2), (1, 1), 'NCHW', 'NCHW', 'float32')
TVM will apply a default schedule which may negatively impact performance.
INFO:te_compiler:Using conv2d_nchw.x86 for nn.conv2d based on highest priority (10)
And if I call it manually on the relay ir and call build
on the result, this is what I get:
DEBUG:autotvm:Finish loading 35 records
Traceback (most recent call last):
File "pt_relay_conv2d.py", line 69, in <module>
mod = graph_executor.GraphModule(lib['default'](dev))
File "/home/.../tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
5: TVMFuncCall
4: tvm::runtime::PackedFuncObj::Extractor<tvm::runtime::PackedFuncSubObj<tvm::runtime::GraphExecutorFactory::GetFunction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::ObjectPtr<tvm::runtime::Object> const&)::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}> >::Call(tvm::runtime::PackedFuncObj const*, tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)
3: tvm::runtime::GraphExecutorFactory::ExecutorCreate(std::vector<DLDevice, std::allocator<DLDevice> > const&)
2: tvm::runtime::GraphExecutor::Init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tvm::runtime::Module, std::vector<DLDevice, std::allocator<DLDevice> > const&, tvm::runtime::PackedFunc)
1: tvm::runtime::GraphExecutor::SetupOpExecs()
0: tvm::runtime::GraphExecutor::CreateTVMOp(tvm::runtime::TVMOpParam const&, std::vector<DLTensor, std::allocator<DLTensor> > const&)
File "/home/.../tvm/src/runtime/graph_executor/graph_executor.cc", line 529
TVMError:
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
Check failed: (pf != nullptr) is false: no such function in module: tvmgen_default_myccompiler_main_0