This is an automated email from the ASF dual-hosted git repository.
masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 86b184b [Meta Scheduler] Add cleanup for localrunner (#9191)
86b184b is described below
commit 86b184be23a73b1d0b20d813e4b23c0fc056df8c
Author: Yuanjing Shi <[email protected]>
AuthorDate: Mon Oct 4 19:09:08 2021 -0700
[Meta Scheduler] Add cleanup for localrunner (#9191)
* add cleanup for localrunner
* remove build results
---
python/tvm/meta_schedule/runner/local_runner.py | 27 +++++++++++++++++++---
tests/python/unittest/test_meta_schedule_runner.py | 2 ++
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/python/tvm/meta_schedule/runner/local_runner.py
b/python/tvm/meta_schedule/runner/local_runner.py
index 9ba1b17..e3c78d7 100644
--- a/python/tvm/meta_schedule/runner/local_runner.py
+++ b/python/tvm/meta_schedule/runner/local_runner.py
@@ -179,11 +179,32 @@ class LocalRunner(PyRunner):
evaluator_config: Optional[EvaluatorConfig] = None,
cooldown_sec: float = 0.0,
alloc_repeat: int = 1,
- f_alloc_argument: Optional[str] = None,
- f_run_evaluator: Optional[str] = None,
- f_cleanup: Optional[str] = None,
+ f_alloc_argument: Union[T_ALLOC_ARGUMENT, str, None] = None,
+ f_run_evaluator: Union[T_RUN_EVALUATOR, str, None] = None,
+ f_cleanup: Union[T_CLEANUP, str, None] = None,
initializer: Optional[Callable[[], None]] = None,
) -> None:
+ """Constructor
+
+ Parameters
+ ----------
+ timeout_sec: float
+ The timeout setting.
+ evaluator_config: EvaluatorConfig
+ The evaluator configuration.
+ cooldown_sec: float
+ The cooldown in seconds.
+ alloc_repeat: int
+ The number of times to random fill the allocation.
+ f_alloc_argument: Union[T_ALLOC_ARGUMENT, str, None]
+ The function name to allocate the arguments or the function itself.
+ f_run_evaluator: Union[T_RUN_EVALUATOR, str, None]
+ The function name to run the evaluator or the function itself.
+ f_cleanup: Union[T_CLEANUP, str, None]
+ The function name to cleanup the session or the function itself.
+ initializer: Optional[Callable[[], None]]
+ The initializer function.
+ """
super().__init__()
self.timeout_sec = timeout_sec
self.evaluator_config = EvaluatorConfig._normalized(evaluator_config)
diff --git a/tests/python/unittest/test_meta_schedule_runner.py
b/tests/python/unittest/test_meta_schedule_runner.py
index 8cd8709..9fb1e5e 100644
--- a/tests/python/unittest/test_meta_schedule_runner.py
+++ b/tests/python/unittest/test_meta_schedule_runner.py
@@ -455,6 +455,7 @@ def test_meta_schedule_local_runner_time_out():
"LocalRunner: Timeout, killed after"
)
assert runner_result.run_secs is None
+ _clean_build(builder_result.artifact_path)
def test_meta_schedule_rpc_runner_exception():
@@ -554,6 +555,7 @@ def test_meta_schedule_local_runner_exception():
"LocalRunner: An exception occurred\n"
)
assert runner_result.run_secs is None
+ _clean_build(builder_result.artifact_path)
def test_meta_schedule_runner_matmul_test():