Skip to content

Commit

Permalink
[AutoScheduler] Fix custom build func in PopenWorker (apache#8939)
Browse files Browse the repository at this point in the history
* [AutoScheduler] Fix custom build func in PopenWorker

* Add assertion
  • Loading branch information
vinx13 authored and ylc committed Sep 29, 2021
1 parent 79c6f9f commit 699b5e9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/tvm/auto_scheduler/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -693,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,)
)
Expand All @@ -701,7 +700,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
Expand Down

0 comments on commit 699b5e9

Please sign in to comment.