[AutoTVM] Cannot get remote devices from tracker

All,

Dig more into the discussion, and I found the post by @hht (Thank you very much!) has a fix for this. So the issue was that remote was occupying the connection already so autotvm cannot connect the VTA device, and this issue was described in here.

Just to help out others, here is the file from @hht 's fork and diff

 $ diff -uN tune_relay_vta.py tune_relay_vta_one_board.py 
--- tune_relay_vta.py   2020-10-31 01:26:48.000000000 -0700
+++ tune_relay_vta_one_board.py 2020-11-23 01:19:07.000000000 -0800
@@ -70,6 +70,9 @@
 from vta.testing import simulator
 from vta.top import graph_pack
 
 #
 # You can register multiple devices to the tracker to accelerate tuning.
@@ -340,18 +342,6 @@
 
 def tune_and_evaluate(tuning_opt):
 
-    if env.TARGET != "sim":
-        # Get remote from fleet node
-        remote = autotvm.measure.request_remote(
-            env.TARGET, tracker_host, tracker_port, timeout=10000
-        )
-        # Reconfigure the JIT runtime and FPGA.
-        vta.reconfig_runtime(remote)
-        vta.program_fpga(remote, bitstream=None)
-    else:
-        # In simulation mode, host the RPC server locally.
-        remote = rpc.LocalSession()
-
     # Register VTA tuning tasks
     register_vta_tuning_tasks()
 
@@ -401,12 +391,25 @@
 
 
     # run tuning tasks
     print("Tuning...")
     tune_tasks(tasks, **tuning_opt)
 
+    # evaluate with tuning history
+    if env.TARGET != "sim":
+        # Get remote from fleet node
+        remote = autotvm.measure.request_remote(
+            env.TARGET, tracker_host, tracker_port, timeout=10000
+        )
+        # Reconfigure the JIT runtime and FPGA.
+        vta.reconfig_runtime(remote)
+        vta.program_fpga(remote, bitstream=None)
+    else:
+        # In simulation mode, host the RPC server locally.
+        remote = rpc.LocalSession()
+
     # compile kernels with history best records
     with autotvm.tophub.context(target, extra_files=[log_file]):
         # Compile network

1 Like