From 75122db551c13f5c0ac7143080a75ff7f427b331 Mon Sep 17 00:00:00 2001 From: Piotr eF Date: Wed, 16 Feb 2022 21:49:30 +0100 Subject: [PATCH] fix RPC waiting for device (#10255) Co-authored-by: pfk-beta --- python/tvm/autotvm/measure/measure_methods.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/tvm/autotvm/measure/measure_methods.py b/python/tvm/autotvm/measure/measure_methods.py index 755c1a32a3cf..6ebbbb653140 100644 --- a/python/tvm/autotvm/measure/measure_methods.py +++ b/python/tvm/autotvm/measure/measure_methods.py @@ -806,17 +806,22 @@ def check_remote(target, device_key, host=None, port=None, priority=100, timeout """ def _check(): + logger.debug("waiting for device...") remote = request_remote(device_key, host, port, priority) dev = remote.device(str(target)) while not dev.exist: # wait until we get an available device pass + logger.debug("device available") t = threading.Thread( target=_check, ) t.start() t.join(timeout) - return not t.is_alive() + + remote = request_remote(device_key, host, port, priority) + dev = remote.device(str(target)) + return dev.exist def set_cuda_target_arch(arch):