tree: db64667fafe6684920130564924d42f48f3569cf
  1. main.cc
  2. Makefile
  3. README.md
  4. rpc_env.cc
  5. rpc_env.h
  6. rpc_server.cc
  7. rpc_server.h
  8. rpc_tracker_client.h
apps/cpp_rpc/README.md

TVM RPC Server

This folder contains a simple recipe to make RPC server in c++.

Usage

  • Build tvm runtime
  • Make the rpc executable Makefile. make CXX=/path/to/cross compiler g++/ TVM_RUNTIME_DIR=/path/to/tvm runtime library directory/ OS=Linux if you want to compile it for embedded Linux, you should add OS=Linux. if the target os is Android, you doesn't need to pass OS argument. You could cross compile the TVM runtime like this:
  cd tvm
  mkdir arm_runtime
  cp cmake/config.cmake arm_runtime
  cd arm_runtime
  cmake .. -DCMAKE_CXX_COMPILER="/path/to/cross compiler g++/"
  make runtime
  • Use ./tvm_rpc server to start the RPC server

How it works

  • The tvm runtime dll is linked along with this executable and when the RPC server starts it will load the tvm runtime library.
Command line usage
 server       - Start the server
--host        - The hostname of the server, Default=0.0.0.0
--port        - The port of the RPC, Default=9090
--port-end    - The end search port of the RPC, Default=9199
--tracker     - The RPC tracker address in host:port format e.g. 10.1.1.2:9190 Default=""
--key         - The key used to identify the device type in tracker. Default=""
--custom-addr - Custom IP Address to Report to RPC Tracker. Default=""
--silent      - Whether to run in silent mode. Default=False
  Example
  ./tvm_rpc server --host=0.0.0.0 --port=9000 --port-end=9090 --tracker=127.0.0.1:9190 --key=rasp

Note

Currently support is only there for Linux / Android environment and proxy mode doesn't be supported currently.