From e99bb33eea26d426b02771f2b50459f83ead70be Mon Sep 17 00:00:00 2001 From: Xiyou Zhou Date: Mon, 20 Sep 2021 14:36:43 -0700 Subject: [PATCH] Rebase. --- include/tvm/meta_schedule/builder.h | 1 - python/tvm/meta_schedule/__init__.py | 1 + python/tvm/meta_schedule/tune_context.py | 6 +++--- .../test_meta_schedule_tune_context.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename tests/python/{meta_schedule => unittest}/test_meta_schedule_tune_context.py (95%) diff --git a/include/tvm/meta_schedule/builder.h b/include/tvm/meta_schedule/builder.h index d0985071b773e..9186c9d039e00 100644 --- a/include/tvm/meta_schedule/builder.h +++ b/include/tvm/meta_schedule/builder.h @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/python/tvm/meta_schedule/__init__.py b/python/tvm/meta_schedule/__init__.py index b12194e7e0092..790572042c5b4 100644 --- a/python/tvm/meta_schedule/__init__.py +++ b/python/tvm/meta_schedule/__init__.py @@ -16,3 +16,4 @@ # under the License. """Package `tvm.meta_schedule`. The meta schedule infrastructure.""" from . import builder +from . import tune_context diff --git a/python/tvm/meta_schedule/tune_context.py b/python/tvm/meta_schedule/tune_context.py index eec242e13c4b4..87c0f6d37e067 100644 --- a/python/tvm/meta_schedule/tune_context.py +++ b/python/tvm/meta_schedule/tune_context.py @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""The tune context of meta schedule.""" +"""Meta Schedule tuning context.""" from typing import Optional @@ -36,8 +36,8 @@ class TuneContext(Object): the same task can interact with each other through tune context. Most classes have a function to initialize with a tune context. - Members - ------- + Parameters + ---------- mod : Optional[IRModule] = None The workload to be optimized. target : Optional[Target] = None diff --git a/tests/python/meta_schedule/test_meta_schedule_tune_context.py b/tests/python/unittest/test_meta_schedule_tune_context.py similarity index 95% rename from tests/python/meta_schedule/test_meta_schedule_tune_context.py rename to tests/python/unittest/test_meta_schedule_tune_context.py index 4ebe05c2bb217..cc436f44e811c 100644 --- a/tests/python/meta_schedule/test_meta_schedule_tune_context.py +++ b/tests/python/unittest/test_meta_schedule_tune_context.py @@ -23,7 +23,7 @@ from tvm import tir from tvm.script import ty from tvm.target import Target -from tvm.meta_schedule import TuneContext +from tvm.meta_schedule.tune_context import TuneContext # pylint: disable=invalid-name,no-member,line-too-long,too-many-nested-blocks,missing-docstring @@ -44,7 +44,7 @@ def main(a: ty.handle, b: ty.handle, c: ty.handle) -> None: # pylint: disable=n # pylint: enable=invalid-name,no-member,line-too-long,too-many-nested-blocks,missing-docstring -def test_tune_context(): +def test_tune_context_create(): mod = Matmul() context = TuneContext(mod, Target("llvm"), "Test Task") assert context.num_threads > 0