This is an automated email from the ASF dual-hosted git repository.

junrushao 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 17bd178bfa [Docs] Fix MetaSchedule Docs (#14480)
17bd178bfa is described below

commit 17bd178bfad8d831e983cd91d76ca29f1f32e422
Author: Xiyou Zhou <[email protected]>
AuthorDate: Fri Apr 7 20:29:09 2023 -0700

    [Docs] Fix MetaSchedule Docs (#14480)
    
    * [Doc] Publish MetaSchedule API Doc
    
    See discussion thread for details:
    
https://discuss.tvm.apache.org/t/ask-for-help-do-we-have-metaschedule-python-api-docs/14643.
    
    Python API docs need to be explicitly specified to be published on TVM
    website, which we have mistakenly forgotten in previous releases.
    This PR fixes this issue.
    
    * Fix docs.
    
    * Add blank line.
    
    ---------
    
    Co-authored-by: Junru Shao <[email protected]>
---
 docs/reference/api/python/index.rst                |  1 +
 .../api/python/{index.rst => meta_schedule.rst}    | 39 ++++------------------
 python/tvm/meta_schedule/database/database.py      |  7 ++--
 python/tvm/meta_schedule/postproc/postproc.py      |  2 +-
 .../meta_schedule/schedule_rule/schedule_rule.py   |  4 +--
 .../search_strategy/search_strategy.py             |  6 ++--
 .../space_generator/space_generator.py             |  4 +--
 python/tvm/meta_schedule/tune.py                   | 15 +++++----
 python/tvm/meta_schedule/tune_context.py           |  4 +--
 9 files changed, 29 insertions(+), 53 deletions(-)

diff --git a/docs/reference/api/python/index.rst 
b/docs/reference/api/python/index.rst
index 62741548d3..5dc1ed806d 100644
--- a/docs/reference/api/python/index.rst
+++ b/docs/reference/api/python/index.rst
@@ -42,6 +42,7 @@ Python API
    relay/testing
    autotvm
    auto_scheduler
+   meta_schedule
    rpc
    micro
    contrib
diff --git a/docs/reference/api/python/index.rst 
b/docs/reference/api/python/meta_schedule.rst
similarity index 67%
copy from docs/reference/api/python/index.rst
copy to docs/reference/api/python/meta_schedule.rst
index 62741548d3..426e3b6cfd 100644
--- a/docs/reference/api/python/index.rst
+++ b/docs/reference/api/python/meta_schedule.rst
@@ -15,36 +15,9 @@
     specific language governing permissions and limitations
     under the License.
 
-Python API
-==========
-
-
-.. toctree::
-   :maxdepth: 2
-
-   runtime
-   ndarray
-   error
-   ir
-   target
-   tir
-   te
-   driver
-   relay/index
-   relay/frontend
-   relay/nn
-   relay/vision
-   relay/image
-   relay/transform
-   relay/analysis
-   relay/backend
-   relay/dataflow_pattern
-   relay/testing
-   autotvm
-   auto_scheduler
-   rpc
-   micro
-   contrib
-   graph_executor
-   topi
-   vta/index
+tvm.meta_schedule
+------------------
+.. automodule:: tvm.meta_schedule
+   :members:
+   :imported-members:
+   :autosummary:
diff --git a/python/tvm/meta_schedule/database/database.py 
b/python/tvm/meta_schedule/database/database.py
index 6621db9633..4775a93de3 100644
--- a/python/tvm/meta_schedule/database/database.py
+++ b/python/tvm/meta_schedule/database/database.py
@@ -284,7 +284,7 @@ class Database(Object):
 
         Returns
         -------
-        schedule : Optional[Schedule]
+        schedule : Optional[tvm.tir.Schedule]
             The best schedule of the given workload; None if not found.
         """
         return _ffi_api.DatabaseQuerySchedule(self, mod, target, 
workload_name)  # type: ignore # pylint: disable=no-member
@@ -338,7 +338,7 @@ class Database(Object):
 
         Returns
         -------
-        result : Union[Schedule, IRModule, TuningRecord]
+        result : Union[tvm.tir.Schedule, IRModule, TuningRecord]
             The best optimization outcome of the given workload.
         """
         if kind == "schedule":
@@ -381,7 +381,8 @@ class Database(Object):
 
         Parameters
         ----------
-        kind : str = "json" | "memory" | "union" | "ordered_union" | 
Callable[[Schedule], bool]
+        kind : str = "json" | "memory" | "union" | "ordered_union" | 
Callable[[tvm.tir.Schedule],
+        bool]
             The kind of the database to be created. The following kinds are 
supported:
             "json", "memory", "union", "ordered_union", and a custom schedule 
function.
 
diff --git a/python/tvm/meta_schedule/postproc/postproc.py 
b/python/tvm/meta_schedule/postproc/postproc.py
index 67a0d27e82..af7fe9e9c5 100644
--- a/python/tvm/meta_schedule/postproc/postproc.py
+++ b/python/tvm/meta_schedule/postproc/postproc.py
@@ -54,7 +54,7 @@ class Postproc(Object):
 
         Parameters
         ----------
-        sch : Schedule
+        sch : tvm.tir.Schedule
             The schedule to be post processed.
 
         Returns
diff --git a/python/tvm/meta_schedule/schedule_rule/schedule_rule.py 
b/python/tvm/meta_schedule/schedule_rule/schedule_rule.py
index 19cb1d8a55..b71a4c7c35 100644
--- a/python/tvm/meta_schedule/schedule_rule/schedule_rule.py
+++ b/python/tvm/meta_schedule/schedule_rule/schedule_rule.py
@@ -57,14 +57,14 @@ class ScheduleRule(Object):
 
         Parameters
         ----------
-        sch : Schedule
+        sch : tvm.tir.Schedule
             The schedule to be modified.
         block : BlockRV
             The specific block to apply the schedule rule.
 
         Returns
         -------
-        design_spaces : List[Schedule]
+        design_spaces : List[tvm.tir.Schedule]
             The list of schedules generated by applying the schedule rule.
         """
         return _ffi_api.ScheduleRuleApply(  #  type: ignore # pylint: 
disable=no-member
diff --git a/python/tvm/meta_schedule/search_strategy/search_strategy.py 
b/python/tvm/meta_schedule/search_strategy/search_strategy.py
index 3b72cc8d1a..8822b09794 100644
--- a/python/tvm/meta_schedule/search_strategy/search_strategy.py
+++ b/python/tvm/meta_schedule/search_strategy/search_strategy.py
@@ -44,7 +44,7 @@ class MeasureCandidate(Object):
 
     Parameters
     ----------
-    sch : Schedule
+    sch : tvm.tir.Schedule
         The schedule to be measured.
     args_info : List[ArgInfo]
         The argument information.
@@ -62,7 +62,7 @@ class MeasureCandidate(Object):
 
         Parameters
         ----------
-        sch : Schedule
+        sch : tvm.tir.Schedule
             The schedule to be measured.
         args_info : List[ArgInfo]
             The argument information.
@@ -115,7 +115,7 @@ class SearchStrategy(Object):
             The maximum number of trials.
         num_trials_per_iter : int
             The number of trials per iteration.
-        design_spaces : List[Schedule]
+        design_spaces : List[tvm.tir.Schedule]
             The design spaces used during tuning process.
         database : Optional[Database] = None
             The database used during tuning process.
diff --git a/python/tvm/meta_schedule/space_generator/space_generator.py 
b/python/tvm/meta_schedule/space_generator/space_generator.py
index f6212a360a..31357b362f 100644
--- a/python/tvm/meta_schedule/space_generator/space_generator.py
+++ b/python/tvm/meta_schedule/space_generator/space_generator.py
@@ -80,7 +80,7 @@ class SpaceGenerator(Object):
 
         Returns
         -------
-        design_spaces : List[Schedule]
+        design_spaces : List[tvm.tir.Schedule]
             The generated design spaces, i.e., schedules.
         """
         return _ffi_api.SpaceGeneratorGenerateDesignSpace(self, mod)  # type: 
ignore # pylint: disable=no-member
@@ -248,7 +248,7 @@ class PySpaceGenerator:
 
         Returns
         -------
-        design_spaces : List[Schedule]
+        design_spaces : List[tvm.tir.Schedule]
             The generated design spaces, i.e., schedules.
         """
         raise NotImplementedError
diff --git a/python/tvm/meta_schedule/tune.py b/python/tvm/meta_schedule/tune.py
index 0c4035844c..132f446a52 100644
--- a/python/tvm/meta_schedule/tune.py
+++ b/python/tvm/meta_schedule/tune.py
@@ -73,13 +73,14 @@ def tune_tasks(
     module_equality : Optional[str]
         A string to specify the module equality testing and hashing method.
         It must be one of the followings:
-          - "structural": Use StructuralEqual/Hash
-          - "ignore-ndarray": Same as "structural", but ignore ndarray raw 
data during
-                              equality testing and hashing.
-          - "anchor-block": Apply equality testing and hashing on the anchor 
block extracted from a
-                            given module. The "ignore-ndarray" varint is used 
for the extracted
-                            blocks or in case no anchor block is found.
-                            For the definition of the anchor block, see 
tir/analysis/analysis.py.
+
+            - "structural": Use StructuralEqual/Hash
+            - "ignore-ndarray": Same as "structural", but ignore ndarray raw 
data during equality
+                testing and hashing.
+            - "anchor-block": Apply equality testing and hashing on the anchor 
block extracted from
+                a given module. The "ignore-ndarray" varint is used for the 
extracted blocks or in
+                case no anchor block is found. For the definition of the 
anchor block, see
+                tir/analysis/analysis.py.
 
     Returns
     -------
diff --git a/python/tvm/meta_schedule/tune_context.py 
b/python/tvm/meta_schedule/tune_context.py
index f15976b1cc..db7e060d28 100644
--- a/python/tvm/meta_schedule/tune_context.py
+++ b/python/tvm/meta_schedule/tune_context.py
@@ -154,7 +154,7 @@ class TuneContext(Object):
 
         Returns
         -------
-        design_spaces : List[Schedule]
+        design_spaces : List[tvm.tir.Schedule]
             The generated design spaces, i.e., schedules.
         """
         if self.mod is None:
@@ -184,7 +184,7 @@ class TuneContext(Object):
             The maximum number of trials to be executed.
         num_trials_per_iter : int = 64
             The number of trials to be executed per iteration.
-        design_spaces : Optional[List[Schedule]]
+        design_spaces : Optional[List[tvm.tir.Schedule]]
             The design spaces used during tuning process.
             If None, use the outcome of `self.generate_design_space()`.
         database : Optional[Database] = None

Reply via email to