[DOCS] Updated and improved docs (#73)

This commit is contained in:
Philippe Tillet
2021-03-05 22:33:50 -05:00
committed by Philippe Tillet
parent 3ecf834a69
commit 0c13b8ff0e
5 changed files with 68 additions and 56 deletions

View File

@@ -21,7 +21,6 @@
# import sys # import sys
# sys.path.insert(0, os.path.abspath('.')) # sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
@@ -31,7 +30,8 @@
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [] extensions = ['sphinx.ext.autosectionlabel']
autosectionlabel_prefix_document = True
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@@ -77,7 +77,6 @@ pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing. # If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False todo_include_todos = False
# -- Options for HTML output ---------------------------------------------- # -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
@@ -110,13 +109,11 @@ html_sidebars = {
] ]
} }
# -- Options for HTMLHelp output ------------------------------------------ # -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'Tritondoc' htmlhelp_basename = 'Tritondoc'
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
latex_elements = { latex_elements = {
@@ -141,20 +138,14 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, 'Triton.tex', 'Triton Documentation', (master_doc, 'Triton.tex', 'Triton Documentation', 'Philippe Tillet', 'manual'),
'Philippe Tillet', 'manual'),
] ]
# -- Options for manual page output --------------------------------------- # -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [(master_doc, 'triton', 'Triton Documentation', [author], 1)]
(master_doc, 'triton', 'Triton Documentation',
[author], 1)
]
# -- Options for Texinfo output ------------------------------------------- # -- Options for Texinfo output -------------------------------------------
@@ -162,10 +153,8 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
(master_doc, 'Triton', 'Triton Documentation', (
author, 'Triton', 'One line description of project.', master_doc, 'Triton', 'Triton Documentation', author, 'Triton', 'One line description of project.',
'Miscellaneous'), 'Miscellaneous'
),
] ]

View File

@@ -8,14 +8,14 @@ Welcome to Triton's documentation!
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
:caption: Contents: :caption: Installation Instructions
installation/index installation/packaged-binaries
installation/from-source
.. toctree::
Indices and tables :maxdepth: 1
================== :caption: Tutorials
* :ref:`genindex` Vector Addition <https://github.com/ptillet/triton/blob/master/python/tutorials/01-vector-add.ipynb>
* :ref:`modindex` Fused Softmax <https://github.com/ptillet/triton/blob/master/python/tutorials/02-fused-softmax.ipynb>
* :ref:`search`

View File

@@ -1,21 +1,52 @@
*************** ==============
From Source From Source
*************** ==============
Triton is a fairly self-contained package and uses its own parser (forked from `wgtcc <https://github.com/wgtdkp/wgtcc>`_) and LLVM-8.0+ for code generation. +++++++++++++++
Python Package
+++++++++++++++
You can install the Python package from source by running the following commands:
.. code-block:: bash .. code-block:: bash
sudo apt-get install llvm-8-dev sudo apt-get install llvm-10-dev
git clone https://github.com/ptillet/triton.git; git clone https://github.com/ptillet/triton.git;
cd triton/python/; cd triton/python;
python setup.py develop; pip install -e .
This should take about 15-20 seconds to compile on a modern machine. You can then test your installation by running the unit tests:
You can then test your installation by running the *einsum.py* example in an environment that contains pytorch:
.. code-block:: bash .. code-block:: bash
cd examples; pytest -vs .
python einsum.py
and the benchmarks
.. code-block:: bash
cd bench/
python -m run --with-plots --result-dir /tmp/triton-bench
+++++++++++++++
C++ Package
+++++++++++++++
Those not interested in Python integration may want to use the internals of Triton (i.e, runtime, parser, codegen, driver, intermediate representation) directly. This can be done by running the following commands:
.. code-block:: bash
sudo apt-get install llvm-10-dev
git clone https://github.com/ptillet/triton.git;
mkdir build;
cd build;
cmake ../;
make -j8;
A custom llvm-config binary can also be provided:
.. code-block:: bash
cmake ../ -DLLVM_CONFIG=/path/to/llvm-config
Note that while direct usage of the C++ API is not officially supported, a usage tutorial can be found `here <https://github.com/ptillet/triton/blob/master/tutorials/01-matmul.cc>`_

View File

@@ -1,16 +0,0 @@
Installation
============
Triton can be installed directly from pip with the following command
.. code-block:: python
pip install triton
See the information below for more detailed information on custom builds.
.. toctree::
:maxdepth: 1
from-source

View File

@@ -0,0 +1,8 @@
Packaged Binaries
=================
Triton can be installed directly from pip with the following command
.. code-block:: python
pip install triton