Skip to content

Commit 81ec1e9

Browse files
pfk-betapfk-beta
andcommitted
fix RPC waiting for device (apache#10255)
Co-authored-by: pfk-beta <this_email_isnot_working@gmail.com>
1 parent c72b6e9 commit 81ec1e9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/tvm/autotvm/measure/measure_methods.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,17 +806,22 @@ def check_remote(target, device_key, host=None, port=None, priority=100, timeout
806806
"""
807807

808808
def _check():
809+
logger.debug("waiting for device...")
809810
remote = request_remote(device_key, host, port, priority)
810811
dev = remote.device(str(target))
811812
while not dev.exist: # wait until we get an available device
812813
pass
814+
logger.debug("device available")
813815

814816
t = threading.Thread(
815817
target=_check,
816818
)
817819
t.start()
818820
t.join(timeout)
819-
return not t.is_alive()
821+
822+
remote = request_remote(device_key, host, port, priority)
823+
dev = remote.device(str(target))
824+
return dev.exist
820825

821826

822827
def set_cuda_target_arch(arch):

0 commit comments

Comments
 (0)