-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add minimal forwarding RPC server for host driven python execution on Hexagon #9526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| }; | ||
|
|
||
| static HexagonRPCDeviceAPI* Global() { | ||
| static auto* inst = new HexagonRPCDeviceAPI(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this loaded? Would it make sense to have this under src/runtime/hexagon/rpc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @mehrdadh who is working on the minrpc server implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
jwfromm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, 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 <[email protected]>
… 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 <[email protected]>
… 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 <[email protected]>
|
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 <[email protected]>
… 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 <[email protected]>
… 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 <[email protected]>
… 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 <[email protected]>
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__.