Skip to content

Commit a504955

Browse files
author
shingjan
committed
add sanity check
1 parent 114197d commit a504955

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

python/tvm/meta_schedule/runner/local_runner.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def __init__(
198198
timeout=timeout_sec,
199199
initializer=initializer,
200200
)
201+
self._sanity_check()
201202

202203
def run(self, runner_inputs: List[RunnerInput]) -> List[RunnerFuture]:
203204
results: List[RunnerFuture] = []
@@ -228,6 +229,25 @@ def run(self, runner_inputs: List[RunnerInput]) -> List[RunnerFuture]:
228229
results.append(local_future)
229230
return results
230231

232+
def _sanity_check(self) -> None:
233+
def _check(
234+
f_alloc_argument,
235+
f_run_evaluator,
236+
f_cleanup,
237+
) -> None:
238+
get_global_func_with_default_on_worker(name=f_alloc_argument, default=None)
239+
get_global_func_with_default_on_worker(name=f_run_evaluator, default=None)
240+
get_global_func_with_default_on_worker(name=f_cleanup, default=None)
241+
tvm.get_global_func("tvm.contrib.random.random_fill", True)
242+
243+
value = self.pool.submit(
244+
_check,
245+
self.f_alloc_argument,
246+
self.f_run_evaluator,
247+
self.f_cleanup,
248+
)
249+
value.result()
250+
231251
@staticmethod
232252
def _worker_func(
233253
_f_alloc_argument: Optional[str],

0 commit comments

Comments
 (0)