kparzysz-quic commented on a change in pull request #10507:
URL: https://github.com/apache/tvm/pull/10507#discussion_r821094201



##########
File path: tests/python/contrib/test_hexagon/README_RPC.md
##########
@@ -0,0 +1,366 @@
+<!--- Licensed to the Apache Software Foundation (ASF) under one -->
+<!--- or more contributor license agreements.  See the NOTICE file -->
+<!--- distributed with this work for additional information -->
+<!--- regarding copyright ownership.  The ASF licenses this file -->
+<!--- to you under the Apache License, Version 2.0 (the -->
+<!--- "License"); you may not use this file except in compliance -->
+<!--- with the License.  You may obtain a copy of the License at -->
+
+<!---   http://www.apache.org/licenses/LICENSE-2.0 -->
+
+<!--- Unless required by applicable law or agreed to in writing, -->
+<!--- software distributed under the License is distributed on an -->
+<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
+<!--- KIND, either express or implied.  See the License for the -->
+<!--- specific language governing permissions and limitations -->
+<!--- under the License. -->
+
+
+# A life of a Hexagon API call
+
+The goal is to understand what exactly is happening during 
`A_data.copyfrom(np.array([2, 3]))`, where `A_data` lives in Hexagon.
+
+## Overview
+The diagram below describes the sequence of calls and components involved when 
memcpy over the Hexagon device is invoked.
+
+![Overview of 
RPC](https://github.com/tlc-pack/web-data/raw/main/images/design/tvm-hex-rpc.png)
+
+The communication between x86 and Android is done via the standard TVM RPC 
protocol implemented mostly in `src/runtime/rpc/rpc_endpoint.cc`.
+
+A packet between Android and Hexagon is proxy-ed by the Hexagon FastRPC 
mechanism. FastRPC depends on the auto-generated implementations of client- and 
server- side API. During the build time, the Android side API (”stub”) and the 
Hexagon side API (”skel”) is generated from 
`src/runtime/hexagon/rpc/hexagon_rpc.idl` (see `cmake/modules/Hexagon.cmake`).
+
+When TVM’s RPC server on Android, `tvm_rpc_android_server`, invokes 
`hexagon_rpc_send(...)`, it actually calls into the same-name function defined 
in the stub with the exact same arguments (which includes the URI for the 
`*skel.so` library to use on Hexagon, which in our case is 
`libhexagon_rpc_skel.so`). Similarly, on the Hexagon side, 
`hexagon_rpc_send(...)` call is first intercepted by the “skel” API, which in 
tern calls the actual implementation defined in 
`src/runtime/hexagon/rpc/rpc_server.cc`.
+
+## Initialization: Setting up Android and establishing connection between x86 
host and android
+
+What’s happening during the launcher initialization at 
[https://github.com/apache/tvm/blob/2b35cfd6ddb73afecd3f550f33881e1fdc7c3267/tests/python/contrib/test_hexagon/rpc/test_launcher.py#L98-L107](https://github.com/apache/tvm/blob/2b35cfd6ddb73afecd3f550f33881e1fdc7c3267/tests/python/contrib/test_hexagon/rpc/test_launcher.py#L98-L107)
 ?
+
+```cpp
+launcher = HexagonLauncher(serial_number=android_serial_number)
+launcher.android_run_rpc(rpc_tracker_host=tvm_tracker_host, 
rpc_tracker_port=tvm_tracker_port)
+launcher.hexagon_setup()
+remote_kw = {...}
+launcher.hexagon_session_setup(remote_kw)

Review comment:
       This is out of date.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to