From 58b8a43fb3cb015062173cda0d75835ead674642 Mon Sep 17 00:00:00 2001 From: Andrew Reusch Date: Mon, 9 Aug 2021 17:01:45 -0700 Subject: [PATCH] Fix using nvcc from xdist and also whenever stdin is closed :| --- python/tvm/contrib/nvcc.py | 4 +++- .../python/unittest/test_auto_scheduler_search_policy.py | 9 +-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/python/tvm/contrib/nvcc.py b/python/tvm/contrib/nvcc.py index 612be292e873f..2a7c0de7be98a 100644 --- a/python/tvm/contrib/nvcc.py +++ b/python/tvm/contrib/nvcc.py @@ -97,7 +97,9 @@ def compile_cuda(code, target="ptx", arch=None, options=None, path_target=None): # if cxx_compiler_path != "": # cmd += ["-ccbin", cxx_compiler_path] - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + # NOTE(areusch): Per https://github.com/lpereira/lwan/issues/106, stdin must be left open. + proc = subprocess.Popen( + cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) (out, _) = proc.communicate() diff --git a/tests/python/unittest/test_auto_scheduler_search_policy.py b/tests/python/unittest/test_auto_scheduler_search_policy.py index d114ce4f9d16c..aa1a55d1c3847 100644 --- a/tests/python/unittest/test_auto_scheduler_search_policy.py +++ b/tests/python/unittest/test_auto_scheduler_search_policy.py @@ -210,11 +210,4 @@ def apply_func(search_policy, state, stage_id): if __name__ == "__main__": - test_workload_registry_empty_policy() - test_sketch_search_policy_basic() - test_sketch_search_policy_basic_spawn() - test_sketch_search_policy_xgbmodel() - test_sketch_search_policy_cuda_rpc_runner() - test_sketch_search_policy_cuda_xgbmodel_rpc_runner() - test_sketch_search_policy_zero_rank() - test_sketch_search_policy_custom_sketch() + sys.exit(pytest.main([__file__] + sys.argv[1:]))