Add minimal forwarding RPC server for host driven python execution on Hexagon#9526
Conversation
| }; | ||
|
|
||
| static HexagonRPCDeviceAPI* Global() { | ||
| static auto* inst = new HexagonRPCDeviceAPI(); |
There was a problem hiding this comment.
Could this be a static local (i.e. not allocated via new)?
static HexagonRPCDeviceAPI inst;
This way it will eventually be destroyed.
There was a problem hiding this comment.
Here I just followed the convention of the other device APIs on their global singleton access.
| @@ -0,0 +1,321 @@ | |||
| /* | |||
There was a problem hiding this comment.
How is this loaded? Would it make sense to have this under src/runtime/hexagon/rpc?
There was a problem hiding this comment.
rpc_env.cc is a hexagon version of rpc_env.cc from apps/cpp_rpc. In this case, all other sources from the C++ RPC server are reused. As noted in the description above we are working on a solution to run a minrpc server directly on hexagon which will provide more general functionality (e.g. support for tuning). This minrpc implementation will land in src/runtime/hexagon/rpc as you suggest. Until then, we are submitting this prototype forwarding RPC server application for use in development.
There was a problem hiding this comment.
cc @mehrdadh who is working on the minrpc server implementation.
There was a problem hiding this comment.
I agree with @csullivan. Let's keep these files under app and the minRPC server under src
Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready.
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
|
Thanks, Chris! 🙌 |
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
… Hexagon (apache#9526) * Minimal proxy RPC server for hexagon. Functions by routing from Android to Hexagon via QTI FastRPC calls. Interim solution until Hexagon on-device RPC server is ready. * Apply clang-format. * Fix build to support building alongside Hexagon Launcher. * Add readme. * src/runtime/hexagon/rpc -> src/runtime/hexagon/proxy_rpc * Added small refactors to hexagon test_matmul.py. * Add skipif on additional env vars. * Fix IOS build. * Rename USE_HEXAGON_PROXY_RPC and add tvm_options entry. * Add NDArray::Container deleters. Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
This PR adds a proxy RPC server for Hexagon. It is a wrapper which takes standard TVM RPC calls from a python host to a remote Android device and forwards them across FastRPC to Hexagon. This RPC flow will be replaced by running a minimal RPC server directly on Hexagon. For now we provide a prototype forwarding RPC server for host driven execution on Hexagon.
This PR also implements a few supporting fixes:
HexagonHostModuleNodewhich is now the default runtime hexagon runtime module. It separates out the current functionality of HexagonModule from the FastRPC offload device api insrc/runtime/hexagon/android. This allowslibtvm.soto be built with codegen support for hexagon, without target or simulator runtime support.module.export_librarycould provide DSO linking rather than codegen.__tvm_main__.