[RPC][VTA] rpc error after recent code refactor

I pull the code from the master branch (commit 54bde8501df19f0133d094432914e3cf3e98fb14), but encounter this error when I tried to run vta/tutorials/frontend/deploy_classification.py on ultra96 board. Previously it works well.

Below is the error log.

Traceback (most recent call last):
  File "vta/tutorials/frontend/deploy_classification.py", line 251, in <module>
    m.set_input(**params)
  File "/4pd/home/zhanghao/workspace/tvm-2/tvm/python/tvm/contrib/graph_runtime.py", line 165, in set_input
    self._get_input(k).copyfrom(params[k])
  File "/4pd/home/zhanghao/workspace/tvm-2/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 225, in __call__
    raise get_last_ffi_error()
ValueError: Traceback (most recent call last):
  [bt] (6) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(TVMFuncCall+0x48) [0x7fc85965da38]
  [bt] (5) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(+0x13ac3d2) [0x7fc8596bf3d2]
  [bt] (4) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const+0x222) [0x7fc8596c1c92]
  [bt] (3) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)> const&)+0x47) [0x7fc8596b7437]
  [bt] (2) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)>)+0x55) [0x7fc8596ae3c5]
  [bt] (1) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(tvm::runtime::RPCEndpoint::EventHandler::ValidateArguments(TVMValue const*, int const*, int)+0x148) [0x7fc8596b16d8]
  [bt] (0) /4pd/home/zhanghao/workspace/tvm-2/tvm/build/libtvm.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x4f) [0x7fc858cf235f]
  File "/4pd/home/zhanghao/workspace/tvm-2/tvm/src/runtime/rpc/rpc_endpoint.cc", line 177
ValueError: Cannot pass argument 0, type runtime.String is not supported by RPC

I tried to trace, and found the tcode with kTVMObjectHandle cannot be handled by RPC. Any ideas?

Thanks.

1 Like

Thanks for reporting. It seems due to one of the string change. cc @junrushao

As a solution to the problem we might want to translate String to str argument in RPC here https://github.com/apache/incubator-tvm/blob/master/src/runtime/rpc/rpc_module.cc#L48

I see. After introducing runtime::String, there are many places in the codebase that we have to deal with both std::string and runtime::String, and in this case, the RPC module. I will submit a fix tomorrow :slight_smile:

1 Like

@tqchen @junrushao Thanks for the quick response, and look forward to the fix.

Here is the patch

@zhanghaohit The patch is merged, could you try it again upon the latest mater?

1 Like

It works now. Thanks @junrushao

1 Like