-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
support custom IP address from rpc server to tracker (PUT) #1243
Conversation
need rebase from master |
python/tvm/contrib/rpc/server.py
Outdated
@@ -92,8 +91,12 @@ def _accept_conn(listen_sock, tracker_conn, ping_period=2): | |||
# Report resource to tracker | |||
if tracker_conn: | |||
matchkey = base.random_key(rpc_key + ":") | |||
base.sendjson(tracker_conn, | |||
[TrackerCode.PUT, rpc_key, (port, matchkey)]) | |||
if custom_addr is not None: |
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.
Since we will be breaking the RPC protocol anyway in this cycle, maybe just always send the custom_addr
self._tracker.put(key, (self, self._addr[0], port, matchkey)) | ||
# got custom address (from rpc server) | ||
if args[3] is not None: | ||
self._tracker.put(key, (self, args[3], port, matchkey)) |
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.
can we directly also put None in here?
python/tvm/contrib/rpc/tracker.py
Outdated
@@ -195,6 +195,9 @@ def call_handler(self, args): | |||
port, matchkey = args[2] | |||
self.pending_matchkeys.add(matchkey) | |||
self._tracker.put(key, (self, self._addr[0], port, matchkey)) | |||
# got custom address (from rpc server) | |||
if args[3] is not None: |
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.
sorry, seems previous if else way is correct
Currently the tracker uses the IP address of the connection when a new rpc server registers.
In the case of a network topology where the tracker is behind a NAT/firewall, the registering RPC server's connection will appear to come from another device from within the NAT (e.g., if we use an ssh tunnel).
This PR allows the registering RPC server to specify a custom IP at
PUT
time so RPC requests to the tracker can receive the actual address of the server.