diff --git a/.ci/docker/requirements-ci.txt b/.ci/docker/requirements-ci.txt index daea5048832..f6ff1cf59f9 100644 --- a/.ci/docker/requirements-ci.txt +++ b/.ci/docker/requirements-ci.txt @@ -5,3 +5,13 @@ ruamel.yaml==0.17.32 sympy==1.12 tomli==2.0.1 zstd==1.5.5.1 + +# Doc build requirements + +sphinx==5.0.0 +sphinx-gallery +matplotlib +# PyTorch Theme +-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme +myst-parser +sphinx_design diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml new file mode 100644 index 00000000000..31795aa50c9 --- /dev/null +++ b/.github/workflows/doc-build.yml @@ -0,0 +1,80 @@ +name: Build documentation + +on: + pull_request: + push: + branches: + - main + - release/* + tags: + - v[0-9]+.[0-9]+.[0-9] + - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + build: + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + with: + job-name: Build doc + runner: linux.2xlarge + docker-image: executorch-ubuntu-22.04-clang12 + fetch-depth: 0 + submodules: 'true' + repository: pytorch/executorch + upload-artifact: docs + + script: | + # Set up Environment Variables + PYTHON_VERSION=3.10 + export PATH="/opt/conda/envs/py_${PYTHON_VERSION}/bin:${PATH}" + + if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then + export CHANNEL=test + else + export CHANNEL=nightly + fi + + set -ex + set +u + + # Build docset: + cd docs + make html + cd .. + + cp -rf docs/_build/html/* "${RUNNER_DOCS_DIR}" + mv docs/_build/html "${RUNNER_ARTIFACT_DIR}" + +# Enable preview later. Previews are available publicly +# +# upload-preview: +# if: github.repository == 'pytorch/executorch' && github.event_name == 'push' && +# (github.ref_type == 'branch' && github.ref_name == 'main') +# uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + + upload-gh-pages: + if: ${{ (github.repository == 'pytorch/executorch') && (github.ref_name == 'main') }} + permissions: + contents: write + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v3 + with: + ref: gh-pages + - uses: actions/download-artifact@v3 + with: + name: docs + - name: Upload docs + run: | + + set -x + git config user.name 'pytorchbot' + git config user.email 'soumith+bot@pytorch.org' + rm -rf main + mv html main + git add --all main || true + git commit -m "Auto-generating sphinx docs" || true + git push -f diff --git a/docs/.gitignore b/docs/.gitignore index f32a6cdd4de..6bd6a8b45d7 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,2 +1,4 @@ +/source/tutorials +/_build /sphinxbuild_py /sphinxbuild_cpp diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000000..b3a3ca20da5 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,22 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = -WT --keep-going +SPHINXBUILD = sphinx-build +SPHINXPROJ = ExecuTorch +SOURCEDIR = source +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". + +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +#html: +# $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css new file mode 100644 index 00000000000..6e88272cd16 --- /dev/null +++ b/docs/source/_static/css/custom.css @@ -0,0 +1,78 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* sphinx-design styles for cards/tabs +*/ +:root { + --sd-color-info: #ee4c2c; + --sd-color-primary: #6c6c6d; + --sd-color-primary-highlight: #f3f4f7; + --sd-color-card-border-hover: #ee4c2c; + --sd-color-card-border: #f3f4f7; + --sd-color-card-background: #fff; + --sd-color-card-text: inherit; + --sd-color-card-header: transparent; + --sd-color-card-footer: transparent; + --sd-color-tabs-label-active: #ee4c2c; + --sd-color-tabs-label-hover: #ee4c2c; + --sd-color-tabs-label-inactive: #6c6c6d; + --sd-color-tabs-underline-active: #ee4c2c; + --sd-color-tabs-underline-hover: #fabdbd; + --sd-color-tabs-underline-inactive: transparent; + --sd-color-tabs-overline: rgb(222, 222, 222); + --sd-color-tabs-underline: rgb(222, 222, 222); +} + +.sd-text-info { + color: #ee4c2c; +} + +.sd-card-img-top { + background: #ee4c2c; + height: 5px !important; +} + +.sd-card { + position: relative; + background-color: #fff; + opacity: 1.0; + border-radius: 0px; + width: 30%; + border: none; + padding-bottom: 0px; +} + + +.sd-card-img:hover { + opacity: 1.0; + background-color: #f3f4f7; +} + + +.sd-card:after { + display: block; + opacity: 1; + content: ''; + border-bottom: solid 1px #ee4c2c; + background-color: #fff; + transform: scaleX(0); + transition: transform .250s ease-in-out; + transform-origin: 0% 50%; +} + +.sd-card:hover { + background-color: #fff; + opacity: 1; + border-top: 1px solid #f3f4f7; + border-left: 1px solid #f3f4f7; + border-right: 1px solid #f3f4f7; +} + +.sd-card:hover:after { + transform: scaleX(1); +} diff --git a/docs/source/_static/img/card-background.svg b/docs/source/_static/img/card-background.svg new file mode 100644 index 00000000000..773515df6de --- /dev/null +++ b/docs/source/_static/img/card-background.svg @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/docs/source/_static/img/generic-pytorch-logo.png b/docs/source/_static/img/generic-pytorch-logo.png new file mode 100644 index 00000000000..426a14d98f5 Binary files /dev/null and b/docs/source/_static/img/generic-pytorch-logo.png differ diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html new file mode 100644 index 00000000000..c8a40c4d0d6 --- /dev/null +++ b/docs/source/_templates/layout.html @@ -0,0 +1,40 @@ +{% extends "!layout.html" %} + +{% block sidebartitle %} + {% include "searchbox.html" %} +{% endblock %} + +{%- block content %} + {% if 'tutorials' in pagename %} + + + + {% endif %} + {{ super() }} + +{% endblock %} + +{% block footer %} +{{ super() }} + +{% endblock %} diff --git a/docs/source/compiler-custom-compiler-passes.md b/docs/source/compiler-custom-compiler-passes.md new file mode 100644 index 00000000000..5ceda67867b --- /dev/null +++ b/docs/source/compiler-custom-compiler-passes.md @@ -0,0 +1,3 @@ +# Custom Compiler Passeis + +TBA diff --git a/docs/source/compiler-delegate-and-partitioner.md b/docs/source/compiler-delegate-and-partitioner.md new file mode 100644 index 00000000000..f2e95bc09c1 --- /dev/null +++ b/docs/source/compiler-delegate-and-partitioner.md @@ -0,0 +1,3 @@ +# Delegate and Partitioner + +TBA diff --git a/docs/source/compiler-kernel-fusion-pass.md b/docs/source/compiler-kernel-fusion-pass.md new file mode 100644 index 00000000000..320c90909f6 --- /dev/null +++ b/docs/source/compiler-kernel-fusion-pass.md @@ -0,0 +1,3 @@ +# Kernel Fusion Pass + +TBA diff --git a/docs/source/compiler-memory-planning.md b/docs/source/compiler-memory-planning.md new file mode 100644 index 00000000000..d4aa8905dc9 --- /dev/null +++ b/docs/source/compiler-memory-planning.md @@ -0,0 +1,3 @@ +# Memory Planning + +TBA diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000000..4964204f30b --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,149 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + + +# Configuration file for the Sphinx documentation builder. +# Created by isphinx-quickstart on Tue Jul 19 14:58:12 2022. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys + +import pytorch_sphinx_theme + +sys.path.insert(0, os.path.abspath(".")) + +# -- Project information ----------------------------------------------------- + +project = "ExecuTorch" +copyright = "2023, ExecuTorch" +author = "ExecuTorch Contributors" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. + +import os +import sys + +sys.path.insert(0, os.path.abspath("../../")) + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosectionlabel", + "sphinx.ext.autosummary", + "sphinx.ext.coverage", + "sphinx.ext.doctest", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "myst_parser", + "sphinx_design", + "sphinx_gallery.gen_gallery", +] + +templates_path = ["_templates"] + + +myst_enable_extensions = [ + "colon_fence", +] + +sphinx_gallery_conf = { + "examples_dirs": ["tutorials_source"], + "gallery_dirs": ["tutorials"], + "filename_pattern": "/tutorials/", + "promote_jupyter_magic": True, + "backreferences_dir": None, + "first_notebook_cell": ("%matplotlib inline"), +} + +source_suffix = [".rst", ".md"] + + +autodoc_typehints = "none" + +# Add any paths that contain templates here, relative to this directory. +# templates_path = ["../_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "pytorch_sphinx_theme" +html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()] + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = { + "pytorch_project": "executorch", + "display_version": True, + "logo_only": True, + "collapse_navigation": False, + "sticky_navigation": False, + "navigation_depth": 4, + "includehidden": True, + "titles_only": False, +} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +html_css_files = ["css/custom.css"] +html_js_files = ["js/custom.js"] + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("https://docs.python.org/", None), + "numpy": ("https://docs.scipy.org/doc/numpy/", None), + "torch": ("https://pytorch.org/docs/stable/", None), +} + +# Custom directives defintions to create cards on main TorchServe page + +from custom_directives import ( + CustomCardEnd, + CustomCardItem, + CustomCardStart, + SupportedDevices, + SupportedProperties, +) +from docutils.parsers import rst + +# Register custom directives + + +rst.directives.register_directive("devices", SupportedDevices) +rst.directives.register_directive("properties", SupportedProperties) +rst.directives.register_directive("customcardstart", CustomCardStart) +rst.directives.register_directive("customcarditem", CustomCardItem) +rst.directives.register_directive("customcardend", CustomCardEnd) diff --git a/docs/source/custom_directives.py b/docs/source/custom_directives.py new file mode 100644 index 00000000000..ee2c8adf968 --- /dev/null +++ b/docs/source/custom_directives.py @@ -0,0 +1,240 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +import hashlib +import os +from pathlib import Path +from typing import List +from urllib.parse import quote, urlencode + +import requests +from docutils import nodes +from docutils.parsers.rst import Directive, directives +from docutils.parsers.rst.directives.images import Image +from docutils.statemachine import StringList +from sphinx.util.docutils import SphinxDirective + +_THIS_DIR = Path(__file__).parent + +# Color palette from PyTorch Developer Day 2021 Presentation Template +YELLOW = "F9DB78" +GREEN = "70AD47" +BLUE = "00B0F0" +PINK = "FF71DA" +ORANGE = "FF8300" +TEAL = "00E5D1" +GRAY = "7F7F7F" + + +def _get_cache_path(key, ext): + filename = f"{hashlib.sha256(key).hexdigest()}{ext}" + cache_dir = _THIS_DIR / "gen_images" + cache_dir.mkdir(parents=True, exist_ok=True) + return cache_dir / filename + + +def _download(url, path): + response = requests.get(url) + response.raise_for_status() + with open(path, "wb") as file: + file.write(response.content) + + +def _fetch_image(url): + path = _get_cache_path(url.encode("utf-8"), ext=".svg") + if not path.exists(): + _download(url, path) + return os.sep + str(path.relative_to(_THIS_DIR)) + + +def _get_relpath(target, base): + target = os.sep + target + base = os.sep + base + target_path, filename = os.path.split(target) + rel_path = os.path.relpath(target_path, os.path.dirname(base)) + return os.path.normpath(os.path.join(rel_path, filename)) + + +class BaseShield(Image, SphinxDirective): + def run(self, params, alt, section) -> List[nodes.Node]: + url = f"https://img.shields.io/static/v1?{urlencode(params, quote_via=quote)}" + path = _fetch_image(url) + self.arguments = [path] + self.options["alt"] = alt + if "class" not in self.options: + self.options["class"] = [] + self.options["class"].append("shield-badge") + target = _get_relpath("supported_features.html", self.env.docname) + self.options["target"] = f"{target}#{section}" + return super().run() + + +def _parse_devices(arg: str): + devices = sorted(arg.strip().split()) + + valid_values = {"CPU", "CUDA"} + if any(val not in valid_values for val in devices): + raise ValueError( + f"One or more device values are not valid. The valid values are {valid_values}. Given value: '{arg}'" + ) + return ", ".join(sorted(devices)) + + +def _parse_properties(arg: str): + properties = sorted(arg.strip().split()) + + valid_values = {"Autograd", "TorchScript"} + if any(val not in valid_values for val in properties): + raise ValueError( + "One or more property values are not valid. " + f"The valid values are {valid_values}. " + f"Given value: '{arg}'" + ) + return ", ".join(sorted(properties)) + + +class SupportedDevices(BaseShield): + """List the supported devices""" + + required_arguments = 1 + final_argument_whitespace = True + + def run(self) -> List[nodes.Node]: + devices = _parse_devices(self.arguments[0]) + alt = f"This feature supports the following devices: {devices}" + params = { + "label": "Devices", + "message": devices, + "labelColor": GRAY, + "color": BLUE, + "style": "flat-square", + } + return super().run(params, alt, "devices") + + +class SupportedProperties(BaseShield): + """List the supported properties""" + + required_arguments = 1 + final_argument_whitespace = True + + def run(self) -> List[nodes.Node]: + properties = _parse_properties(self.arguments[0]) + alt = f"This API supports the following properties: {properties}" + params = { + "label": "Properties", + "message": properties, + "labelColor": GRAY, + "color": GREEN, + "style": "flat-square", + } + return super().run(params, alt, "properties") + + +_CARDLIST_START = """ +.. raw:: html + +
+ + +
+ +
+
+
+""" + +_CARD_TEMPLATE = """ +.. raw:: html + + +""" + +_CARDLIST_END = """ +.. raw:: html + +
+ +
+
+
+""" + + +class CustomCardStart(Directive): + def run(self): + para = nodes.paragraph() + self.state.nested_parse( + StringList(_CARDLIST_START.split("\n")), self.content_offset, para + ) + return [para] + + +class CustomCardItem(Directive): + option_spec = { + "header": directives.unchanged, + "image": directives.unchanged, + "link": directives.unchanged, + "card_description": directives.unchanged, + "tags": directives.unchanged, + } + + def run(self): + for key in ["header", "card_description", "link"]: + if key not in self.options: + raise ValueError(f"Key: `{key}` is missing") + + header = self.options["header"] + link = self.options["link"] + card_description = self.options["card_description"] + tags = self.options.get("tags", "") + + if "image" in self.options: + image = "" + else: + image = "_static/img/thumbnails/default.png" + + card_rst = _CARD_TEMPLATE.format( + header=header, + image=image, + link=link, + card_description=card_description, + tags=tags, + ) + card_list = StringList(card_rst.split("\n")) + card = nodes.paragraph() + self.state.nested_parse(card_list, self.content_offset, card) + return [card] + + +class CustomCardEnd(Directive): + def run(self): + para = nodes.paragraph() + self.state.nested_parse( + StringList(_CARDLIST_END.split("\n")), self.content_offset, para + ) + return [para] diff --git a/docs/source/export-overview.md b/docs/source/export-overview.md new file mode 100644 index 00000000000..6a1f88c920a --- /dev/null +++ b/docs/source/export-overview.md @@ -0,0 +1,3 @@ +# Exporting to ExecuTorch + +TBA diff --git a/docs/source/export-user-guide.md b/docs/source/export-user-guide.md new file mode 100644 index 00000000000..b2d34a600a8 --- /dev/null +++ b/docs/source/export-user-guide.md @@ -0,0 +1,3 @@ +# Export User Guide + +TBA diff --git a/docs/source/getting-started-architecture.md b/docs/source/getting-started-architecture.md new file mode 100644 index 00000000000..351faa6e828 --- /dev/null +++ b/docs/source/getting-started-architecture.md @@ -0,0 +1,3 @@ +# High-level Architecture and Components of ExecuTorch + +TBA diff --git a/docs/source/getting-started-setup.md b/docs/source/getting-started-setup.md new file mode 100644 index 00000000000..3663bf95cb9 --- /dev/null +++ b/docs/source/getting-started-setup.md @@ -0,0 +1,3 @@ +# Setting Up ExecuTorch + +TBA diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000000..e21135a3a18 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,184 @@ +.. _home: + +Welcome to the ExecuTorch Documentation +======================================= + +**ExecuTorch** is a PyTorch platform that provides infrastructure to run +PyTorch programs everywhere from AR/VR wearables to standard on-device +iOS and Android mobile deployments. One of the main +goals for ExecuTorch is to enable wider customization and deployment +capabilities of the PyTorch programs. + +ExecuTorch heavily relies on such PyTorch technologies as TorchDynamo +and torch.export. If you are not familiar with these APIs, you might want +to read about them in the PyTorch documentation before diving into +the ExecuTorch documentation. + +Features described in this documentation are classified by release status: + + *Stable:* These features will be maintained long-term and there should + generally be no major performance limitations or gaps in documentation. + We also expect to maintain backwards compatibility (although + breaking changes can happen and notice will be given one release ahead + of time). + + *Beta:* These features are tagged as Beta because the API may change based on + user feedback, because the performance needs to improve, or because + coverage across operators is not yet complete. For Beta features, we are + committing to seeing the feature through to the Stable classification. + We are not, however, committing to backwards compatibility. + + *Prototype:* These features are typically not available as part of + binary distributions like PyPI or Conda, except sometimes behind run-time + flags, and are at an early stage for feedback and testing. + +Getting Started +~~~~~~~~~~~~~~~ + +Topics in this section will help you get started with ExecuTorch. + +.. grid:: 3 + + .. grid-item-card:: :octicon:`file-code;1em` + What is ExecuTorch? + :img-top: _static/img/card-background.svg + :link: intro-overview.html + :link-type: url + + A gentle introduction to ExecuTorch. In this section, + you will learn about main features of ExecuTorch + and how you can use them in your projects. + + .. grid-item-card:: :octicon:`file-code;1em` + Getting started with ExecuTorch + :img-top: _static/img/card-background.svg + :link: getting-started-setup.html + :link-type: url + + A step-by-step tutorial on how to get started with + ExecuTorch. + + .. grid-item-card:: :octicon:`file-code;1em` + ExecuTorch Intermediate Representation API + :img-top: _static/img/card-background.svg + :link: ir-exir.html + :link-type: url + + Learn about EXIR, a graph-based intermediate + representation (IR) of PyTorch programs. + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Introduction + :hidden: + + intro-overview + intro-how-it-works + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Getting Started + :hidden: + + getting-started-architecture + getting-started-setup + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Exporting to ExecuTorch + :hidden: + + export-overview + export-user-guide + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Intermediate Representation (IR) Specification + :hidden: + + ir-exir + ir-ops-set-definition + ir-high-order-operators + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Compiler Entry Points + :hidden: + + compiler-delegate-and-partitioner + compiler-kernel-fusion-pass + compiler-custom-compiler-passes + compiler-memory-planning + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Runtime + :hidden: + + runtime-overview + runtime-build-and-cross-compilation + runtime-backend-delegate-implementation-and-linking + runtime-api + runtime-custom-memory-allocator + runtime-error-handling + runtime-platform-abstraction-layer + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Quantization + :hidden: + + quantization-custom-quantization + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Kernel Library + :hidden: + + kernel-library-overview + kernel-library-custom-aten-kernel + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: SDK + :hidden: + + sdk-profiling + sdk-debugging + sdk-bundled-io + sdk-delegate-integration + +.. toctree:: + :glob: + :maxdepth: 1 + :caption: Tutorials + :hidden: + + tutorials/template_tutorial + +Tutorials and Examples +~~~~~~~~~~~~~~~~~~~~~~ + +Ready to experiment? Check out some of the interactive +ExecuTorch tutorials. + +.. customcardstart:: + +.. customcarditem:: + :header: Template Tutorial + :card_description: A template tutorial. To be deleted. + :image: _static/img/generic-pytorch-logo.png + :link: tutorials/template_tutorial.html + :tags: Template + +.. customcardend:: + diff --git a/docs/source/intro-how-it-works.md b/docs/source/intro-how-it-works.md new file mode 100644 index 00000000000..52ef441c41e --- /dev/null +++ b/docs/source/intro-how-it-works.md @@ -0,0 +1,3 @@ +# How it works + +TBA diff --git a/docs/source/intro-overview.md b/docs/source/intro-overview.md new file mode 100644 index 00000000000..a9fe9ba4eea --- /dev/null +++ b/docs/source/intro-overview.md @@ -0,0 +1,3 @@ +# ExecuTorch Overview + +TBA diff --git a/docs/source/ir-exir.md b/docs/source/ir-exir.md new file mode 100644 index 00000000000..3cb7554c055 --- /dev/null +++ b/docs/source/ir-exir.md @@ -0,0 +1,3 @@ +# EXIR + +Title TBA diff --git a/docs/source/ir-high-order-operators.md b/docs/source/ir-high-order-operators.md new file mode 100644 index 00000000000..94d445a367b --- /dev/null +++ b/docs/source/ir-high-order-operators.md @@ -0,0 +1,3 @@ +# High-order Operators + +TBA diff --git a/docs/source/ir-ops-set-definition.md b/docs/source/ir-ops-set-definition.md new file mode 100644 index 00000000000..730d27c0846 --- /dev/null +++ b/docs/source/ir-ops-set-definition.md @@ -0,0 +1,3 @@ +# OpSet definition + +TBA diff --git a/docs/source/kernel-library-custom-aten-kernel.md b/docs/source/kernel-library-custom-aten-kernel.md new file mode 100644 index 00000000000..fa2d7f14c6f --- /dev/null +++ b/docs/source/kernel-library-custom-aten-kernel.md @@ -0,0 +1,3 @@ +# Custom ATen Compliant Kernel Implementation and Linking + +TBA diff --git a/docs/source/kernel-library-overview.md b/docs/source/kernel-library-overview.md new file mode 100644 index 00000000000..1c1de8d90a7 --- /dev/null +++ b/docs/source/kernel-library-overview.md @@ -0,0 +1,3 @@ +# Kernel Library Overview + +TBA diff --git a/docs/source/quantization-custom-quantization.md b/docs/source/quantization-custom-quantization.md new file mode 100644 index 00000000000..2a7feb57cc2 --- /dev/null +++ b/docs/source/quantization-custom-quantization.md @@ -0,0 +1,3 @@ +# Custom Quantization + +TBA diff --git a/docs/source/runtime-api.md b/docs/source/runtime-api.md new file mode 100644 index 00000000000..ba49788a23e --- /dev/null +++ b/docs/source/runtime-api.md @@ -0,0 +1,3 @@ +# Runtime API + +TBA (This might need to be an .rst file) diff --git a/docs/source/runtime-backend-delegate-implementation-and-linking.md b/docs/source/runtime-backend-delegate-implementation-and-linking.md new file mode 100644 index 00000000000..5d1a3435030 --- /dev/null +++ b/docs/source/runtime-backend-delegate-implementation-and-linking.md @@ -0,0 +1,3 @@ +# Backend Delegate Implementation and Linking + +TBA diff --git a/docs/source/runtime-build-and-cross-compilation.md b/docs/source/runtime-build-and-cross-compilation.md new file mode 100644 index 00000000000..c4f4f544339 --- /dev/null +++ b/docs/source/runtime-build-and-cross-compilation.md @@ -0,0 +1,3 @@ +# Build and cross-compilation + +TBA diff --git a/docs/source/runtime-custom-memory-allocator.md b/docs/source/runtime-custom-memory-allocator.md new file mode 100644 index 00000000000..5c72a8db526 --- /dev/null +++ b/docs/source/runtime-custom-memory-allocator.md @@ -0,0 +1,3 @@ +# Custom Memory Allocator + +TBA diff --git a/docs/source/runtime-error-handling.md b/docs/source/runtime-error-handling.md new file mode 100644 index 00000000000..f87d302140f --- /dev/null +++ b/docs/source/runtime-error-handling.md @@ -0,0 +1,3 @@ +# Runtime Error Handling + +TBA diff --git a/docs/source/runtime-overview.md b/docs/source/runtime-overview.md new file mode 100644 index 00000000000..0f0ff2c594b --- /dev/null +++ b/docs/source/runtime-overview.md @@ -0,0 +1,3 @@ +# Runtime Overview + +TBA diff --git a/docs/source/runtime-platform-abstraction-layer.md b/docs/source/runtime-platform-abstraction-layer.md new file mode 100644 index 00000000000..df8c8e4fd72 --- /dev/null +++ b/docs/source/runtime-platform-abstraction-layer.md @@ -0,0 +1,3 @@ +# Platform Abstraction Layer + +TBA diff --git a/docs/source/sdk-bundled-io.md b/docs/source/sdk-bundled-io.md new file mode 100644 index 00000000000..50e6947344b --- /dev/null +++ b/docs/source/sdk-bundled-io.md @@ -0,0 +1,3 @@ +# BundledIO + +TBA diff --git a/docs/source/sdk-debugging.md b/docs/source/sdk-debugging.md new file mode 100644 index 00000000000..732d06504ab --- /dev/null +++ b/docs/source/sdk-debugging.md @@ -0,0 +1,3 @@ +# Debugging + +TBA diff --git a/docs/source/sdk-delegate-integration.md b/docs/source/sdk-delegate-integration.md new file mode 100644 index 00000000000..59eaf832f7c --- /dev/null +++ b/docs/source/sdk-delegate-integration.md @@ -0,0 +1,3 @@ +# Delegate Integration + +TBA diff --git a/docs/source/sdk-profiling.md b/docs/source/sdk-profiling.md new file mode 100644 index 00000000000..534f60d5220 --- /dev/null +++ b/docs/source/sdk-profiling.md @@ -0,0 +1,3 @@ +# Profiling + +TBA diff --git a/docs/source/tutorials_source/README.txt b/docs/source/tutorials_source/README.txt new file mode 100644 index 00000000000..b8717197d14 --- /dev/null +++ b/docs/source/tutorials_source/README.txt @@ -0,0 +1,6 @@ +Tutorials +--------- + +1. tutorials/* + Getting Started Tutorials + https://pytorch.org/executorch/tutorials/template_tutorial.html diff --git a/docs/source/tutorials_source/template_tutorial.py b/docs/source/tutorials_source/template_tutorial.py new file mode 100644 index 00000000000..02d7fa89e13 --- /dev/null +++ b/docs/source/tutorials_source/template_tutorial.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +""" +Template Tutorial +================= + +**Author:** `FirstName LastName `_ + +.. grid:: 2 + + .. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn + + * Item 1 + * Item 2 + * Item 3 + + .. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites + + * PyTorch v2.0.0 + * GPU ??? + * Other items 3 + +If you have a video, add it here like this: + +.. raw:: html + +
+ +
+ +To test your tutorial locally, you can do one of the following: + +* You can control specific files that generate the results by using + ``GALLERY_PATTERN`` environment variable. The GALLERY_PATTERN variable + respects regular expressions. + For example to run only ``neural_style_transfer_tutorial.py``, + use the following command: + + .. code-block:: sh + + GALLERY_PATTERN="neural_style_transfer_tutorial.py" make html + + or + + .. code-block:: sh + + GALLERY_PATTERN="neural_style_transfer_tutorial.py" sphinx-build . _build + +* Make a copy of this repository and add only your + tutorial to the `beginner_source` directory removing all other tutorials. + Then run ``make html``. + +Verify that all outputs were generated correctly in the created HTML. +""" + +######################################################################### +# Overview +# -------- +# +# Describe Why is this topic important? Add Links to relevant research papers. +# +# This tutorial walks you through the process of.... +# +# Steps +# ----- +# +# Example code (the output below is generated automatically): +# + +import torch + +x = torch.rand(5, 3) +print(x) + +###################################################################### +# (Optional) Additional Exercises +# ------------------------------- +# +# Add additional practice exercises for users to test their knowledge. +# Example: `NLP from Scratch `__. +# + +###################################################################### +# Conclusion +# ---------- +# + +# Summarize the steps and concepts covered. Highlight key takeaways. +# +# Further Reading +# --------------- +# +# * Link1 +# * Link2