tqchen opened a new pull request #5484:
URL: https://github.com/apache/incubator-tvm/pull/5484


   This PR refactors the RPC protocol to make it more modularized.
   
   - RPCSession: represent a set of features that need to be implemented
   - RPCEndPont: End point that forwards the RPCSession requests over a 
communication channel.
   - RPCModule: Exposes an RPCSession as an rpc device in the TVM Runtime API.
   
   In the new design, the local machine is presented as a special case of 
RPCSession.
   The remote is just another client session that calls into RPCEndPoint.
   The RPC communication path is as follows.
   
   ```
   client -> ClientSession -> EndPoint[client@n0]
   -> networking[between n0 <=> n1]
   -> EndPoint[server@n1] -> LocalSession[@n1]
   
   ```
   
   Because of the new modular design, we can now chain more sessions together.
   For example, we can now run the following proxy setup (testcase in 
test_runtime_rpc.test_session_constructor).
   
   ```
   client -> ClientSession -> Endpoint[client@n0]
   -> networking[between n0 <=> n1]
   -> Endpoint[server@n1] -> ClientSession -> Endpoint[client@n1]
   -> networking[between n1 <=> n2]
   -> Endpoint[server@n2] -> LocalSession[@n2]
   ```
   
   We can also implement other types of Sessions.
   For example, we could make uTVM session a special case of the RPCSession
   and use the same mechanism for session management.
   
   We also add more comments about the internal of the RPC.
   The communication protocol is simplfied using a similar convention as 
PackedFunc.
   This allows us to further reduce the amount of special remote syscalls.
   
   Due to the major improvement and simplification, we are making a 
non-compatible update to the RPC protocol. It means that the client and server 
needs to be upgraded to together in order for it to function correctly.
   
   This PR also introduces a versioning mechanism to the current RPC procotol,
   so that future upgrade will be produce more user friendly with error 
messages.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to