Skip to content

Add ExecuTorch docs TOC #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .ci/docker/requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
80 changes: 80 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/source/tutorials
/_build
/sphinxbuild_py
/sphinxbuild_cpp
22 changes: 22 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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
78 changes: 78 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -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);
}
13 changes: 13 additions & 0 deletions docs/source/_static/img/card-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% extends "!layout.html" %}

{% block sidebartitle %}
{% include "searchbox.html" %}
{% endblock %}

{%- block content %}
{% if 'tutorials' in pagename %}

<div class="pytorch-call-to-action-links">
<div id="tutorial-type">{{ pagename }}</div>

<div id="google-colab-link">
<img class="call-to-action-img" src="{{ pathto('_static/images/pytorch-colab.svg', 1) }}"/>
<div class="call-to-action-desktop-view">Run in Google Colab</div>
<div class="call-to-action-mobile-view">Colab</div>
</div>
<div id="download-notebook-link">
<img class="call-to-action-notebook-img" src="{{ pathto('_static/images/pytorch-download.svg', 1) }}"/>
<div class="call-to-action-desktop-view">Download Notebook</div>
<div class="call-to-action-mobile-view">Notebook</div>
</div>
<div id="github-view-link">
<img class="call-to-action-img" src="{{ pathto('_static/images/pytorch-github.svg', 1) }}"/>
<div class="call-to-action-desktop-view">View on GitHub</div>
<div class="call-to-action-mobile-view">GitHub</div>
</div>
</div>

{% endif %}
{{ super() }}

{% endblock %}

{% block footer %}
{{ super() }}
<script script type="text/javascript">
var collapsedSections = ['Introduction', 'Getting Started', 'Exporting to ExecuTorch', 'Intermediate Representation (IR) Specification','Compiler Entry Points', 'Runtime', 'Quantization', 'Kernel Library', 'SDK', 'Tutorials']
</script>
{% endblock %}
3 changes: 3 additions & 0 deletions docs/source/compiler-custom-compiler-passes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Custom Compiler Passeis

TBA
3 changes: 3 additions & 0 deletions docs/source/compiler-delegate-and-partitioner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Delegate and Partitioner

TBA
3 changes: 3 additions & 0 deletions docs/source/compiler-kernel-fusion-pass.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Kernel Fusion Pass

TBA
3 changes: 3 additions & 0 deletions docs/source/compiler-memory-planning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Memory Planning

TBA
Loading