Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/reference/api/python/arith.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

tvm.arith
---------
.. automodule:: tvm.arith
:members:
:imported-members:
14 changes: 14 additions & 0 deletions docs/reference/api/python/contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,17 @@ tvm.contrib.xcode
~~~~~~~~~~~~~~~~~
.. automodule:: tvm.contrib.xcode
:members:


tvm.contrib.cutlass
~~~~~~~~~~~~~~~~~~~
.. automodule:: tvm.contrib.cutlass
:members:
:imported-members:


tvm.contrib.hexagon
~~~~~~~~~~~~~~~~~~~
.. automodule:: tvm.contrib.hexagon
:members:
:imported-members:
22 changes: 22 additions & 0 deletions docs/reference/api/python/exec.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

tvm.exec
--------
.. automodule:: tvm.exec
:members:
:imported-members:
4 changes: 4 additions & 0 deletions docs/reference/api/python/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ Python API

error
ir
arith
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The module arith is inserted out of alphabetical order. For better maintainability and navigation, the toctree entries should be sorted alphabetically (e.g., arith should be the first entry in this list).

instrument
transform
target
driver
testing
exec
Comment on lines +32 to +33
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These entries are not sorted alphabetically. exec should come before testing.

Suggested change
testing
exec
exec
testing


.. toctree::
:maxdepth: 1
Expand Down Expand Up @@ -62,6 +65,7 @@ Python API
tirx/analysis
tirx/stmt_functor
tirx/transform
tirx/backend
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The module tirx/backend is added at the end of the list, which breaks the alphabetical order. It should ideally follow tirx/analysis.


.. toctree::
:maxdepth: 1
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/python/instrument.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ tvm.ir.instrument
.. automodule:: tvm.ir.instrument
:members:
:imported-members:
:exclude-members: Path
6 changes: 6 additions & 0 deletions docs/reference/api/python/ir.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ tvm.ir
:members:
:imported-members:
:autosummary:

tvm.ir.diagnostics
~~~~~~~~~~~~~~~~~~
.. automodule:: tvm.ir.diagnostics
:members:
:imported-members:
6 changes: 6 additions & 0 deletions docs/reference/api/python/target.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ tvm.target
:members:
:imported-members:
:autosummary:

tvm.target.tag
~~~~~~~~~~~~~~
.. automodule:: tvm.target.tag
:members:
:imported-members:
22 changes: 22 additions & 0 deletions docs/reference/api/python/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

tvm.testing
-----------
.. automodule:: tvm.testing
:members:
:imported-members:
31 changes: 31 additions & 0 deletions docs/reference/api/python/tirx/backend.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

tvm.tirx.backend
================

tvm.tirx.backend
*****************
.. automodule:: tvm.tirx.backend
:members:
:imported-members:

tvm.tirx.backend.adreno
***********************
.. automodule:: tvm.tirx.backend.adreno
:members:
:imported-members:
Comment on lines +18 to +31
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The heading style in this file is inconsistent with other API reference files in this directory (which typically use - for the main title and ~ for sub-sections). Additionally, the title tvm.tirx.backend is redundant as it appears twice.

Please ensure the underline length matches the title length exactly.

Suggested change
tvm.tirx.backend
================
tvm.tirx.backend
*****************
.. automodule:: tvm.tirx.backend
:members:
:imported-members:
tvm.tirx.backend.adreno
***********************
.. automodule:: tvm.tirx.backend.adreno
:members:
:imported-members:
tvm.tirx.backend
----------------
.. automodule:: tvm.tirx.backend
:members:
:imported-members:
tvm.tirx.backend.adreno
~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: tvm.tirx.backend.adreno
:members:
:imported-members:

26 changes: 26 additions & 0 deletions docs/reference/api/python/topi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,29 @@ tvm.topi.image
:members:
:imported-members:
:autosummary:

tvm.topi.vision
~~~~~~~~~~~~~~~
.. automodule:: tvm.topi.vision
:members:
:imported-members:
:noindex:

tvm.topi.gpu
~~~~~~~~~~~~
.. automodule:: tvm.topi.gpu
:members:
:imported-members:
:noindex:

tvm.topi.cpp
~~~~~~~~~~~~
.. automodule:: tvm.topi.cpp
:members:
:imported-members:

tvm.topi.testing
~~~~~~~~~~~~~~~~
.. automodule:: tvm.topi.testing
:members:
:imported-members:
6 changes: 3 additions & 3 deletions python/tvm/arith/bound.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ def deduce_bound(var, cond, hint_map, relax_map):

Parameters
----------
var : Var
var : tvm.tir.Var
The target variable to be deduced.

cond : PrimExpr
The condition

hint_map : Map[Var, IntSet]
hint_map : Map[tvm.tir.Var, IntSet]
Domain of variables used to help deduction.

relax_map : Map[Var, IntSet]
relax_map : Map[tvm.tir.Var, IntSet]
The fomain of the variables to be relaxed
using the provided domain.
"""
Expand Down
10 changes: 5 additions & 5 deletions python/tvm/arith/int_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def estimate_region_lower_bound(region, var_dom, predicate):
region : List[Range]
The region to be analyzed.
var_dom : Dict[Var, Range]
var_dom : Dict[tvm.tir.Var, Range]
The ranges of the variables
predicate : PrimExpr
Expand All @@ -125,7 +125,7 @@ def estimate_region_strict_bound(region, var_dom, predicate):
region : List[Range]
The region to be analyzed.
var_dom : Dict[Var, Range]
var_dom : Dict[tvm.tir.Var, Range]
The ranges of the variables
predicate : PrimExpr
Expand All @@ -149,7 +149,7 @@ def estimate_region_upper_bound(region, var_dom, predicate):
region : List[Range]
The region to be analyzed.
var_dom : Dict[Var, Range]
var_dom : Dict[tvm.tir.Var, Range]
The ranges of the variables
predicate : PrimExpr
Expand All @@ -168,7 +168,7 @@ def pos_inf():
Returns
----------
pos_inf : Var
pos_inf : tvm.tir.Var
A symbolic var that indicates positive infinity
"""
return _ffi_api.PosInf()
Expand All @@ -179,7 +179,7 @@ def neg_inf():
Returns
----------
neg_inf : Var
neg_inf : tvm.tir.Var
A symbolic var that indicates positive infinity
"""
return _ffi_api.NegInf()
Expand Down
55 changes: 31 additions & 24 deletions python/tvm/arith/iter_affine_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def detect_iter_map(
indices : List[PrimExpr]
The input indices

input_iters : Map[Var, Range]
input_iters : Map[tvm.tir.Var, Range]
The domain of each input iterators.

predicate : PrimExpr
Expand Down Expand Up @@ -178,7 +178,7 @@ def normalize_to_iter_sum(index, input_iters):
index : PrimExpr
The input index

input_iters : Map[Var, Range]
input_iters : Map[tvm.tir.Var, Range]
The domain of each input iterators.

Returns
Expand Down Expand Up @@ -211,7 +211,7 @@ def iter_map_simplify(
indices : List[PrimExpr]
The input indices

input_iters : Map[Var, Range]
input_iters : Map[tvm.tir.Var, Range]
The domain of each input iterators.

predicate : PrimExpr
Expand Down Expand Up @@ -265,28 +265,34 @@ def subspace_divide(
simplify_trivial_iterators=True,
):
"""Detect if bindings can be written as
[a_0*e_0 + b_0 + c_0, a_1*e_1 + b_1, ..., a_n*e_n + b_n]
where a = some-quasi-affine-iter-map(input_iters set_minus sub_iters)
b = some-quasi-affine-iter-map(sub_iters)
c is constant symbols
e is the extent of b
For example, z*12 + y*3 + x + c = (z*4+y)*3 + x
bindings = [z*12 + y*3 + x + c]
input_iters = [z, y, x]
sub_iter = [x]
Then the result will be [a, b] where
a = [z*4 + y]
b = [x]
``[a_0*e_0 + b_0 + c_0, a_1*e_1 + b_1, ..., a_n*e_n + b_n]``

where::

a = some-quasi-affine-iter-map(input_iters set_minus sub_iters)
b = some-quasi-affine-iter-map(sub_iters)
c is constant symbols
e is the extent of b

For example::

z*12 + y*3 + x + c = (z*4+y)*3 + x
bindings = [z*12 + y*3 + x + c]
input_iters = [z, y, x]
sub_iter = [x]
Then the result will be [a, b] where
a = [z*4 + y]
b = [x]

Parameters
----------
bindings : List[PrimExpr]
The input bindings

input_iters : Map[Var, Range]
input_iters : Map[tvm.tir.Var, Range]
The domain of input iterator, which is the basis of the whole space

sub_iters : Array[Var]
sub_iters : Array[tvm.tir.Var]
The subset of input_iters, which is the basis of the subspace

predicate : PrimExpr
Expand All @@ -302,12 +308,13 @@ def subspace_divide(
Returns
-------
results : List[List[PrimExpr]]
The result list has length len(bindings) + 1
[0, len(bindings)): The iter map matching result. The inner list is of length 2.
The first expr is the basis of the quotient space.
The second expr is the basis of the subspace.
len(bindings): the predicate of outer space and inner space
Empty array if no match can be found.
The result list has length ``len(bindings) + 1``.

- ``[0, len(bindings))``: The iter map matching result.
The inner list is of length 2. The first expr is the basis
of the quotient space. The second expr is the basis of the subspace.
- ``len(bindings)``: the predicate of outer space and inner space.
- Empty array if no match can be found.
"""
if isinstance(check_level, str):
check_level = IterMapLevel.from_str(check_level)
Expand Down Expand Up @@ -337,7 +344,7 @@ def inverse_affine_iter_map(iter_map, outputs):

Returns
-------
results : Map[Var, PrimExpr]
results : Map[tvm.tir.Var, PrimExpr]
The map from the input to the transformed result.
"""
return _ffi_api.InverseAffineIterMap(iter_map, outputs)
4 changes: 2 additions & 2 deletions python/tvm/contrib/hexagon/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def link_shared(so_name, objs, extra_args=None):
----------
so_name : str
Name of the shared library file.
objs : list[str,StringImm]
objs : list[str, tvm.tirx.StringImm]
extra_args : dict (str->str) or Map<String,String>
Additional arguments:
'hex_arch' - Hexagon architecture, e.g. v68
Expand Down Expand Up @@ -187,7 +187,7 @@ def link_shared_macos(so_name, objs, extra_args=None):
----------
so_name : str
Name of the shared library file.
objs : list[str,StringImm]
objs : list[str, tvm.tirx.StringImm]
extra_args : dict (str->str) or Map<String,String>
Additional arguments:
'hex_arch' - Hexagon architecture, e.g. v68
Expand Down
Loading
Loading