Skip to content

Commit

Permalink
Add executorch documentation section (#2193)
Browse files Browse the repository at this point in the history
Add executorch section
  • Loading branch information
echarlaix authored Mar 7, 2025
1 parent b04feae commit 3adbe7c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_main_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
- name: Combine subpackage documentation
run: |
cd optimum
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron tpu habana furiosa --version ${{ env.VERSION }}
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron tpu habana furiosa executorch --version ${{ env.VERSION }}
cd ..
- name: Push to repositories
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Combine subpackage documentation
run: |
cd optimum
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron tpu habana furiosa --version pr_$PR_NUMBER
sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron tpu habana furiosa executorch --version pr_$PR_NUMBER
sudo mv optimum-doc-build ../
cd ..
Expand Down
28 changes: 28 additions & 0 deletions docs/combine_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,31 @@ def add_tpu_doc(base_toc: List):
)


def add_executorch_doc(base_toc: List):
"""
Extends the table of content with a section about Optimum ExecuTorch.
Args:
base_toc (List): table of content for the doc of Optimum.
"""
# Update optimum table of contents
base_toc.insert(
SUBPACKAGE_TOC_INSERT_INDEX,
{
"sections": [
{
# Ideally this should directly point at https://huggingface.co/docs/optimum-executorch/index
# Current hacky solution is to have a redirection in _redirects.yml
"local": "docs/optimum-executorch/index",
"title": "🤗 Optimum ExecuTorch",
}
],
"title": "ExecuTorch",
"isExpanded": False,
},
)


def main():
args = parser.parse_args()
optimum_path = Path("optimum-doc-build")
Expand All @@ -153,6 +178,9 @@ def main():
# At the moment, Optimum Nvidia's doc is the README of the GitHub repo
# It is linked to in optimum/docs/source/nvidia_overview.mdx
continue
elif subpackage == "executorch":
# Optimum ExecuTorch has its own doc so it is managed differently
add_executorch_doc(base_toc)
else:
subpackage_path = Path(f"{subpackage}-doc-build")

Expand Down
3 changes: 3 additions & 0 deletions docs/source/_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ docs/optimum-neuron/index: /docs/optimum-neuron/index
# Optimum TPU
docs/optimum-tpu/index: /docs/optimum-tpu/index
tpu/index: /docs/optimum-tpu/index

# Optimum ExecuTorch
docs/optimum-executorch/index: /docs/optimum-executorch/index

0 comments on commit 3adbe7c

Please sign in to comment.