diff --git a/docs/reference/api/python/index.rst b/docs/reference/api/python/index.rst index a3852e6adaf7..fa83956972f5 100644 --- a/docs/reference/api/python/index.rst +++ b/docs/reference/api/python/index.rst @@ -70,6 +70,15 @@ Python API s_tir/transform s_tir/dlight +.. toctree:: + :maxdepth: 1 + :caption: tvm.script + + script/script + script/parser + script/ir_builder + script/printer + .. toctree:: :maxdepth: 1 :caption: tvm.te diff --git a/docs/reference/api/python/script/ir_builder.rst b/docs/reference/api/python/script/ir_builder.rst new file mode 100644 index 000000000000..201090a0e4c8 --- /dev/null +++ b/docs/reference/api/python/script/ir_builder.rst @@ -0,0 +1,46 @@ +.. 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.script.ir_builder +--------------------- + +tvm.script.ir_builder +********************* +.. automodule:: tvm.script.ir_builder + :members: + :imported-members: + +tvm.script.ir_builder.ir +************************ +.. automodule:: tvm.script.ir_builder.ir + :members: + :imported-members: + +tvm.script.ir_builder.relax +*************************** +.. automodule:: tvm.script.ir_builder.relax + :members: + +tvm.script.ir_builder.relax.distributed +*************************************** +.. automodule:: tvm.script.ir_builder.relax.distributed + :members: + +tvm.script.ir_builder.tirx +************************** +.. automodule:: tvm.script.ir_builder.tirx + :members: diff --git a/docs/reference/api/python/script/parser.rst b/docs/reference/api/python/script/parser.rst new file mode 100644 index 000000000000..583b27b27614 --- /dev/null +++ b/docs/reference/api/python/script/parser.rst @@ -0,0 +1,37 @@ +.. 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.script.parser +----------------- + +tvm.script.parser +***************** +.. automodule:: tvm.script.parser + :members: + :imported-members: + +tvm.script.parser.ir +******************** +.. automodule:: tvm.script.parser.ir + +tvm.script.parser.relax +*********************** +.. automodule:: tvm.script.parser.relax + +tvm.script.parser.tirx +********************** +.. automodule:: tvm.script.parser.tirx diff --git a/docs/reference/api/python/script/printer.rst b/docs/reference/api/python/script/printer.rst new file mode 100644 index 000000000000..b5dddb4396c8 --- /dev/null +++ b/docs/reference/api/python/script/printer.rst @@ -0,0 +1,25 @@ +.. 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.script.printer +------------------ + +tvm.script.printer +****************** +.. automodule:: tvm.script.printer + :members: + :imported-members: diff --git a/docs/reference/api/python/script/script.rst b/docs/reference/api/python/script/script.rst new file mode 100644 index 000000000000..5e819bd1bba2 --- /dev/null +++ b/docs/reference/api/python/script/script.rst @@ -0,0 +1,35 @@ +.. 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.script +---------- + +tvm.script +********** +.. automodule:: tvm.script + :members: + :imported-members: + +tvm.script.relax +**************** +.. automodule:: tvm.script.relax + :members: + +tvm.script.tirx +*************** +.. automodule:: tvm.script.tirx + :members: diff --git a/python/tvm/script/ir_builder/ir/ir.py b/python/tvm/script/ir_builder/ir/ir.py index 12e31038fc04..dba2063f03a9 100644 --- a/python/tvm/script/ir_builder/ir/ir.py +++ b/python/tvm/script/ir_builder/ir/ir.py @@ -35,6 +35,7 @@ def ir_module() -> IRModuleFrame: def decl_function(func_name: str, func_signature: BaseFunc) -> GlobalVar: """Declare a Function without given the specific function implementation. + Parameters ---------- func_name : str @@ -47,6 +48,7 @@ def decl_function(func_name: str, func_signature: BaseFunc) -> GlobalVar: Note ---- It is usually used in cross-function call. And we can specify the function by `DefFunction` + Returns ------- gv : GlobalVar