I’m trying new TVM codegen feature for DNNL.
I’m loading my model from MXNet frontend, but adding:
mod['main'] = set_external_func_attr(mod['main'], "dnnl", "dnnl_0")
as inspired by tests/python/relay/test_external_codegen.py
, doesn’t seem to do the trick. Indeed I get the following error:
Traceback (most recent call last):
File "../scripts/tvm_compile_relay.py", line 88, in <module>
graph, lib, params = relay.build_module.build(mod, target=target, params=param)
File "/tvm/incubator-tvm/python/tvm/relay/build_module.py", line 244, in build
graph_json, mod, params = bld_mod.build(func, target, target_host, params)
File "/tvm/incubator-tvm/python/tvm/relay/build_module.py", line 109, in build
self._build(func, target, target_host)
File "/tvm/incubator-tvm/python/tvm/_ffi/_ctypes/function.py", line 207, in __call__
raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
[bt] (8) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::RelayBuildModule::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*)#3}::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const+0x1b5) [0x7fab8ee39365]
[bt] (7) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::RelayBuildModule::BuildRelay(tvm::relay::Function, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tvm::runtime::NDArray, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tvm::runtime::NDArray> > > const&)+0x60b) [0x7fab8ee3873b]
[bt] (6) /tvm/incubator-tvm/build/libtvm.so(std::_Function_handler<void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*), tvm::relay::backend::GraphRuntimeCodegenModule::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*)#2}>::_M_invoke(std::_Any_data const&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&)+0x8c) [0x7fab8ee2d62c]
[bt] (5) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::Codegen(tvm::relay::Function)+0x626) [0x7fab8ee2c406]
[bt] (4) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr(tvm::relay::Expr const&)+0x575) [0x7fab8ee22d55]
[bt] (3) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr_(tvm::relay::TupleGetItemNode const*)+0x29) [0x7fab8ee179e9]
[bt] (2) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr(tvm::relay::Expr const&)+0x42d) [0x7fab8ee22c0d]
[bt] (1) /tvm/incubator-tvm/build/libtvm.so(tvm::relay::backend::GraphRuntimeCodegen::VisitExpr_(tvm::relay::CallNode const*)+0xc2) [0x7fab8ee281f2]
[bt] (0) /tvm/incubator-tvm/build/libtvm.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x32) [0x7fab8e7b2a22]
File "/tvm/incubator-tvm/src/relay/backend/graph_runtime_codegen.cc", line 409
TVMError: Operators should be transformed away; try applyingthe fuse_ops transformation to the expression.
Am I missing something else?