Skip to content

Commit

Permalink
[Doc] Add doc on how to define operator computation (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyaoding committed Oct 31, 2022
1 parent e2e1ed1 commit c0c8f9f
Show file tree
Hide file tree
Showing 30 changed files with 737 additions and 47 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sphinx
sphinx-gallery
sphinx-copybutton
autodocsumm
sphinx-book-theme
matplotlib
Expand Down
37 changes: 37 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,41 @@ div.container-xl {

.sphx-glr-script-out .highlight pre {
background-color: #e9ecef !important;
}

div.sphx-glr-download a {
background-color: #0084c845 !important;
background-image: none !important;
}

div.sphx-glr-download a:hover {
background-color: rgba(0, 132, 200, 0.5) !important;
background-image: none !important;
}

dt.sig {
letter-spacing: 0;
font-family: Menlo,Monaco,Consolas,SFMono-Regular,"Liberation Mono","Courier New",monospace;
/*font-family: ;*/
/*font-size=1em;*/
}

span.sig-name {
color: #0558b7;
}
em.sig-param {
font-style: normal;
}
em.property {
font-style: normal;
}
code {
font-family: monospace;
}
code {
color: #3e3ead;
}

.heading-style, h1, h2, h3, h4, h5, h6 {
font-family: Ubuntu, system-ui;
}
10 changes: 9 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@
'sphinx.ext.viewcode',
'sphinx.ext.coverage',
'sphinx.ext.todo',
'sphinx.ext.graphviz',
'sphinx.ext.doctest',
"sphinx_gallery.gen_gallery",
'sphinxcontrib.googleanalytics',
'sphinx_copybutton',
'autodocsumm',
]

Expand Down Expand Up @@ -77,7 +80,7 @@
intersphinx_mapping = {
'torch': ('https://pytorch.org/docs/stable', None),
'torchvision': ('https://pytorch.org/vision/stable', None),
"python": ("https://docs.python.org/3", None),
# "python": ("https://docs.python.org/3", None),
}

# -- Options for HTML output -------------------------------------------------
Expand Down Expand Up @@ -115,3 +118,8 @@
'filename_pattern': r'/*\.py',
"download_all_examples": False,
}

copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True

graphviz_output_format = "svg"
17 changes: 11 additions & 6 deletions docs/source/getting-started/install.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
Installation
============

Install from pip
Install via pip
----------------

.. note::
.. todo::
:class: margin

Currently, hidet is not open-sourced yet. Please ask Yaoyao get access to the GitHub repository.

In the future, we will publish hidet to The `Python Package Index (PyPI) <https://pypi.org/>`_.
Coming soon.

Run the following command to install ``hidet`` package directly using python pip:

.. code-block:: console
$ pip install git+ssh://git@github.com/yaoyaoding/hidet.git
$ pip install hidet
Install from source
-------------------

.. note::
:class: margin

Currently, hidet is not open-sourced yet. Please ask Yaoyao get access to the GitHub repository.

In the future, we will publish hidet to The `Python Package Index (PyPI) <https://pypi.org/>`_.

If you are a developer of Hidet, it is better to install hidet from source.

Clone the code
Expand Down
15 changes: 11 additions & 4 deletions docs/source/how-to-guides/add-new-operator/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ Hidet is designed to be extensible. It is easy to add new operators to Hidet. Th
an operator.

1. **Rule-based Scheduling**
Define the mathematical computation of the operator, and use Hidet's rule-based scheduler to implement the
computation.
Define the mathematical computation of the operator, and Hidet will automatically schedule the computation into
parallel tensor program with Hidet's rule-based scheduler.
2. **Template-based Scheduling**
Besides the computation, also give the concrete implementation of the operator.
Besides the computation, user can also give the concrete implementation of the operator to achieve better performance
for complex operators.

.. toctree::
:maxdepth: 1
:caption: Two Methods
:caption: Define Computation

../../gallery/how-to-guides/add-new-operator-compute-definition

.. toctree::
:maxdepth: 1
:caption: Two Scheduling Methods

../../gallery/how-to-guides/add-new-operator-rule-based
../../gallery/how-to-guides/add-new-operator-template-based
7 changes: 0 additions & 7 deletions docs/source/how-to-guides/index.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Hidet is an open-source DNN inference framework, it features
:maxdepth: 1
:caption: Notes

notes/hidet-cache
notes/operator-cache
notes/visualize-flow-graph

.. toctree::
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Hidet Cache
===========
Operator Cache
==============

.. todo::

Will come soon.


6 changes: 6 additions & 0 deletions docs/source/python_api/driver.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hidet.driver
------------

.. automodule:: hidet.driver
:members:
:autosummary:
2 changes: 2 additions & 0 deletions docs/source/python_api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Python API
:caption: Python API

root
driver
ir/index
graph/index
runtime/index
utils/index
Expand Down
13 changes: 13 additions & 0 deletions docs/source/python_api/ir/compute.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
hidet.ir.compute
================

.. tip::

Please refer to :doc:`here </gallery/how-to-guides/add-new-operator-compute-definition>` for how to use these compute
primitives to define a computation task.


.. automodule:: hidet.ir.compute
:members:
:imported-members:
:autosummary:
6 changes: 6 additions & 0 deletions docs/source/python_api/ir/expr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hidet.ir.expr
=============

.. automodule:: hidet.ir.expr
:members:
:autosummary:
6 changes: 6 additions & 0 deletions docs/source/python_api/ir/func.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hidet.ir.func
=============

.. automodule:: hidet.ir.func
:members:
:autosummary:
13 changes: 13 additions & 0 deletions docs/source/python_api/ir/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
hidet.ir
========

.. toctree::
:caption: Submodules

type
expr
stmt
func
compute
task

6 changes: 6 additions & 0 deletions docs/source/python_api/ir/stmt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hidet.ir.stmt
=============

.. automodule:: hidet.ir.stmt
:members:
:autosummary:
6 changes: 6 additions & 0 deletions docs/source/python_api/ir/task.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hidet.ir.task
=============

.. automodule:: hidet.ir.task
:members:
:autosummary:
6 changes: 6 additions & 0 deletions docs/source/python_api/ir/type.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hidet.ir.type
=============

.. automodule:: hidet.ir.type
:members:
:autosummary:
2 changes: 1 addition & 1 deletion docs/source/python_api/root.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ hidet

.. automodule:: hidet
:members:
:exclude-members: FlowGraph, Tensor, Operator
:exclude-members: FlowGraph, Tensor, Operator, Task
:imported-members:
:autosummary:

0 comments on commit c0c8f9f

Please sign in to comment.