csullivan commented on code in PR #10909:
URL: https://github.com/apache/tvm/pull/10909#discussion_r849665063


##########
python/tvm/contrib/hexagon/build.py:
##########
@@ -356,26 +358,46 @@ def _copy_binaries(self):
         for item in self.ANDROID_HEXAGON_RPC_FILES:
             self._copy_to_remote(lib_dir / item, self._workspace / item)
 
+    def _process_forwarded_ports(self):
+        forwarded_ports = subprocess.check_output(self._adb_device_sub_cmd + 
["forward", "--list"])
+        existing_forwards = []
+        for forward in str(forwarded_ports).split("\\n"):
+            entry = forward.split()
+            if len(entry) == 3:
+                _, local, _ = entry
+                existing_forwards.append(int(local.strip("tcp:")))
+        return existing_forwards
+
+    def _forward_ports(self, rpc_server_port, existing_forwards):
+        # Enable port forward for RPC server. We forward the first ten open 
ports
+        # starting from the rpc_server_port
+        port = rpc_server_port
+        while len(self.forwarded_ports_) < 10:

Review Comment:
   Not sure throwing an error in these cases makes sense given that the user 
only cares about the functionality of their tests on hardware and doesn't want 
to see test failures based on bad port configurations. 
   
   If we change the RPC server to fail rather than search for a new port as it 
does now, then we can revisit the launcher code and have it try until 
successfully binding to a single port and remove the port range nonsense. 



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