Hello,
I wanted to get a better view of what the output of compiling a network in the VTA deployment example is.
More specifically, I wanted to get the C source after building the module. Trying to read this output in LLVM was giving me headaches.
For that I changed the ‘llvm’ target when using fsim to ‘c’.
The compilation throws the following error:
Exception has occurred: TVMError
Traceback (most recent call last):
[bt] (8) /home/tvm/build/libtvm.so(tvm::codegen::CodeGenC::VisitExpr_(tvm::tir::CastNode const*, std::ostream&)+0x227) [0x7f653bb80e27]
[bt] (7) /home/tvm/build/libtvm.so(tvm::codegen::CodeGenC::PrintExpr(tvm::PrimExpr const&, std::ostream&)+0xad) [0x7f653bb7beed]
[bt] (6) /home/tvm/build/libtvm.so(void tvm::codegen::CodeGenCHost::PrintTernaryCondExpr<tvm::tir::MaxNode>(tvm::tir::MaxNode const*, char const*, std::ostream&)+0x57) [0x7f653bb92527]
[bt] (5) /home/tvm/build/libtvm.so(tvm::tir::ExprFunctor<void (tvm::PrimExpr const&, std::ostream&)>::VisitExpr(tvm::PrimExpr const&, std::ostream&)+0x7c) [0x7f653bb8a97c]
[bt] (4) /home/tvm/build/libtvm.so(void tvm::codegen::CodeGenCHost::PrintTernaryCondExpr<tvm::tir::MinNode>(tvm::tir::MinNode const*, char const*, std::ostream&)+0x57) [0x7f653bb920b7]
[bt] (3) /home/tvm/build/libtvm.so(tvm::tir::ExprFunctor<void (tvm::PrimExpr const&, std::ostream&)>::VisitExpr(tvm::PrimExpr const&, std::ostream&)+0x7c) [0x7f653bb8a97c]
[bt] (2) /home/tvm/build/libtvm.so(tvm::codegen::CodeGenCHost::VisitExpr_(tvm::tir::CallNode const*, std::ostream&)+0x70) [0x7f653bb8f420]
[bt] (1) /home/tvm/build/libtvm.so(tvm::codegen::CodeGenC::VisitExpr_(tvm::tir::CallNode const*, std::ostream&)+0x3a2) [0x7f653bb82262]
[bt] (0) /home/tvm/build/libtvm.so(+0x11fc7b2) [0x7f653bb787b2]
File "/home/tvm/src/target/source/codegen_c.cc", line 649
TVMError: Unresolved call Op(tir.round)
File "/home/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 225, in __call__
raise get_last_ffi_error()
File "/home/tvm/python/tvm/relay/build_module.py", line 121, in build
self._build(mod, target, target_host)
File "/home/tvm/python/tvm/relay/build_module.py", line 255, in build
graph_json, mod, params = bld_mod.build(mod, target, target_host, params)
File "/home/tvm/vta/tutorials/frontend/deploy_classification.py", line 200, in <module>
params=params, target_host=env.target_host)
As a side note, the conv2d optimization tutorial for VTA with the same change to the fsim target (i.e. ‘c’ instead of ‘llvm’) does work. But the C file does not include the VTA specific include statements.
#include "tvm/runtime/c_runtime_api.h"
#include "tvm/runtime/c_backend_api.h"
void* __tvm_module_ctx = NULL;
static void* __tvm_set_device_packed = NULL;
#ifdef __cplusplus
extern "C"
#endif
//Rest of C code
cc @thierry any thoughts on the matter?