Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix RPC waiting for device #10255

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion python/tvm/autotvm/measure/measure_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down