Hello,
I’m reading code of RPC module in Python, and many elements are hard to understand for me. I’m not a big expert, but I think some of them should be more meaningfull, so I suggest to change their names. We can discus about my suggestions.
Minor changes:
-
python/tvm/rpc/client.py- function
connect_trackerisn’t connecting to tracker explicitly. It createsTrackerSession, so its name should beget_tracker_sessionorget_active_tracker_session. And it is only one line, so if we do not plan to modify this function, then we cat remove it. All variables, to whose we assign output should be namedtracker_session, nottracker. -
TrackerSession.requestshould be renamed. Name suggest it will return request, but instead we are gettingRPCSession. I think good name would berequest_connectionorget_rpc_session. All variables, to whose we assign output should be namedrpc_session. We can introduce one level of inheritance, e.g.class RemoteDevice(RPCSession)
- function
-
python/tvm/rpc/server.py- rename
ServertoRPCServer
- rename
-
python/tvm/autotvm/measure/measure_methods.py-
class LocalRunner(RPCRunner)- this is hard to understand. I think that some functionality ofRPCRunnershould be moved toRunnerclass
-
Big changes:
- RPC Tracker is also server, because it has infinite loop.
- RPC Server is server by name. But in some ways it is a kind of client, because it connects to the tracker.
- In my opinion better names would be RPC Manager and RPC Worker. Session to Manager we can name
ManagerSession, Session to Worker we can nameWorkerSession. Functions to connect we can nameconnect_worker,connect_managerrespectively. WorkerServer, ManagerServer also are good names. - I’m not sure how to treat proxy