-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Add and update documentation (#48)
* . * update docs * format & lint
- Loading branch information
1 parent
ad10146
commit 91abff6
Showing
30 changed files
with
406 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Build from source | ||
------------------- | ||
.. _Build-from-source: | ||
|
||
If you want to contribute to Hidet, or you encountered any problem installing hidet via pip, it is better to install | ||
hidet from source. | ||
|
||
Clone the code | ||
~~~~~~~~~~~~~~ | ||
|
||
First clone the repository to local: | ||
|
||
.. code-block:: console | ||
$ git clone https://github.com/hidet-org/hidet | ||
Build shared libraries | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The runtime library is written in C++ and compiled into a shared library. To build the shared library, you need to have | ||
a C++ compiler installed (as well as build tools like ``cmake``, and ``make``). The following command will build the | ||
shared library: | ||
|
||
.. code-block:: console | ||
$ cd hidet | ||
$ mkdir build | ||
$ cd build | ||
$ cp ../config.cmake . # copy the cmake config to build directory | ||
$ cmake .. | ||
$ make -j4 | ||
After building, you could find two libraries ``libhidet.so`` and ``libhidet_runtime.so`` under ``build/lib`` directory. | ||
|
||
Update environment variables | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To allow Python interpreter to find hidet package under ``python`` directory of the repository, we should append the | ||
directory to ``PYTHONPATH`` variable. To allow the system find the shared libraries we built in the previous step, | ||
we should append ``build/lib`` directory to ``LD_LIBRARY_PATH`` variable. | ||
|
||
.. code-block:: console | ||
$ export HIDET_HOME=<The Path to Hidet Repo> | ||
$ export PYTHONPATH=$PYTHONPATH:$HIDET_HOME/python | ||
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HIDET_HOME/build/lib | ||
To avoid repeating above commands, it is recommended to put above commands to your shell's initialization script | ||
(e.g., ``~/.bashrc`` for Bash and ``~/.zshrc`` for Zsh). | ||
|
||
Validation | ||
~~~~~~~~~~ | ||
|
||
To make sure we have successfully installed hidet, run the following command in a new shell: | ||
|
||
.. code-block:: console | ||
$ python -c "import hidet" | ||
If no error reports, then hidet has been successfully installed on your computer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,21 @@ | ||
Installation | ||
============ | ||
|
||
Install via pip | ||
---------------- | ||
|
||
.. todo:: | ||
:class: margin | ||
|
||
Coming soon. | ||
|
||
Run the following command to install ``hidet`` package directly using python pip: | ||
Run the following command to install ``hidet`` package via python pip: | ||
|
||
.. code-block:: console | ||
$ 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 | ||
~~~~~~~~~~~~~~ | ||
|
||
First clone the repository to local: | ||
|
||
.. code-block:: console | ||
$ git clone https://github.com/hidet-org/hidet | ||
Build shared libraries | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Create the directory to build the shared libraries: | ||
|
||
.. code-block:: console | ||
$ cd hidet | ||
$ mkdir build | ||
$ cd build | ||
$ cp ../config.cmake . # copy the cmake config to build directory | ||
You could customize the build by update the ``config.cmake`` file, according the instructions in the default config file. Usually, | ||
just leave it as default. | ||
|
||
Build hidet shared libraries (under ``build`` directory): | ||
|
||
.. code-block:: console | ||
$ cmake .. | ||
$ make -j4 | ||
After building, you could find two libraries ``libhidet.so`` and ``libhidet_runtime.so`` under ``build/lib`` directory. | ||
|
||
Update environment variables | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To allow Python interpreter to find hidet package under ``python`` directory of the repository, we should append the directory to ``PYTHONPATH`` variable. | ||
To allow the system find the shared libraries we built in the previous step, we should append ``build/lib`` directory to ``LD_LIBRARY_PATH`` variable. | ||
|
||
.. code-block:: console | ||
$ export HIDET_HOME=<The Path to Hidet Repo> | ||
$ export PYTHONPATH=$PYTHONPATH:$HIDET_HOME/python | ||
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HIDET_HOME/build/lib | ||
To avoid repeating above commands, it is recommended to put above commands to your shell's initialization script (e.g., ``~/.bashrc`` for Bash and ``~/.zshrc`` for Zsh). | ||
|
||
Validation | ||
~~~~~~~~~~ | ||
|
||
To make sure we have successfully installed hidet, run the following command in a new shell: | ||
To verify the installation, run the following command: | ||
|
||
.. code-block:: console | ||
$ python -c "import hidet" | ||
If no error reports, then hidet has been successfully installed on your computer. | ||
If you want, you can also :doc:`build from source </getting-started/build-from-source>`. | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
build-from-source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
hidet.graph.frontend | ||
==================== | ||
|
||
.. toctree:: | ||
:caption: Submodules | ||
|
||
onnx | ||
torch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
hidet.graph.frontend | ||
-------------------- | ||
hidet.graph.frontend.onnx | ||
------------------------- | ||
|
||
.. autofunction:: hidet.graph.frontend.from_onnx | ||
|
||
.. automodule:: hidet.graph.frontend.onnx | ||
:members: | ||
:autosummary: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
hidet.graph.frontend.torch | ||
-------------------------- | ||
|
||
.. autofunction:: hidet.graph.frontend.from_torch | ||
|
||
.. autoclass:: hidet.graph.frontend.torch.DynamoConfig | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
docs/source/python_api/graph/ops/index.rst → docs/source/python_api/ops/index.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
hidet.Tensor | ||
============ | ||
|
||
|
||
.. autoclass:: hidet.Tensor | ||
|
||
.. autoattribute:: shape | ||
.. autoattribute:: dtype | ||
.. autoattribute:: device | ||
.. autoattribute:: size | ||
.. autoattribute:: nbytes | ||
.. autoattribute:: storage | ||
.. autoattribute:: trace | ||
.. autoattribute:: op | ||
.. autoattribute:: layout | ||
.. automethod:: tolist | ||
.. automethod:: to_device | ||
.. automethod:: astype | ||
.. automethod:: cpu | ||
.. automethod:: cuda | ||
.. automethod:: copy | ||
.. automethod:: cpu_async | ||
.. automethod:: cuda_async | ||
.. automethod:: copy_async | ||
.. automethod:: detach | ||
.. automethod:: numpy | ||
.. automethod:: torch | ||
.. automethod:: to | ||
.. automethod:: item | ||
.. automethod:: signature | ||
.. automethod:: is_symbolic | ||
.. automethod:: contiguous | ||
.. automethod:: reshape | ||
.. automethod:: squeeze | ||
.. automethod:: unsqueeze | ||
.. automethod:: rearrange | ||
.. automethod:: sum | ||
.. automethod:: mean |
Oops, something went wrong.