From 1d5d295ac19da964f9545e5bfdf3504914733626 Mon Sep 17 00:00:00 2001 From: pfk-beta Date: Tue, 15 Feb 2022 14:33:45 +0100 Subject: [PATCH] fix RPC waiting for device --- 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):