From 3e1b60b2f90e5c1cf7d4ce1d1a76eb02ec6590e3 Mon Sep 17 00:00:00 2001 From: Wuwei Lin Date: Fri, 3 Sep 2021 15:53:23 -0400 Subject: [PATCH 1/2] [AutoScheduler] Fix custom build func in PopenWorker --- python/tvm/auto_scheduler/measure.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/tvm/auto_scheduler/measure.py b/python/tvm/auto_scheduler/measure.py index 72c1126b5035..560d4920480b 100644 --- a/python/tvm/auto_scheduler/measure.py +++ b/python/tvm/auto_scheduler/measure.py @@ -661,10 +661,6 @@ def local_build_worker(args): The build result of this Builder thread. """ inp, build_func, verbose = args - assert build_func == BuildFunc.name, ( - "BuildFunc.name: " + BuildFunc.name + ", but args is: " + build_func - ) - build_func = BuildFunc.build_func return _local_build_worker(inp, build_func, verbose) @@ -701,7 +697,7 @@ def local_builder_build(inputs, timeout, n_parallel, build_func="default", verbo [ ( i.serialize(), - build_func, + BuildFunc.build_func, verbose, ) for i in inputs From 0f02b3dd8226476bb00dcafa0dfa26569fb1df10 Mon Sep 17 00:00:00 2001 From: Wuwei Lin Date: Mon, 6 Sep 2021 20:27:20 -0400 Subject: [PATCH 2/2] Add assertion --- python/tvm/auto_scheduler/measure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/tvm/auto_scheduler/measure.py b/python/tvm/auto_scheduler/measure.py index 560d4920480b..5e42dd090f2f 100644 --- a/python/tvm/auto_scheduler/measure.py +++ b/python/tvm/auto_scheduler/measure.py @@ -689,6 +689,9 @@ def local_builder_build(inputs, timeout, n_parallel, build_func="default", verbo res : List[BuildResult] The build results of these MeasureInputs. """ + assert build_func == BuildFunc.name, ( + "BuildFunc.name: " + BuildFunc.name + ", but args is: " + build_func + ) executor = PopenPoolExecutor( n_parallel, timeout, reset_global_scope, (AutotvmGlobalScope.current,) )