From 178302d520d54b747d2e964d33bafe8f7afdabda Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Thu, 4 Jan 2024 14:53:35 +0100
Subject: [PATCH 01/16] Rework doc homepage
---
docs/source/index.mdx | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/docs/source/index.mdx b/docs/source/index.mdx
index b8d0d44aae4..9f7599b5eb7 100644
--- a/docs/source/index.mdx
+++ b/docs/source/index.mdx
@@ -19,6 +19,11 @@ As such, Optimum enables developers to efficiently use any of these platforms wi
🤗 Optimum is distributed as a collection of packages - check out the links below for an in-depth look at each one.
+
+## Hardware partners
+
+The packages below enable you to get the best of the 🤗 Hugging Face ecosystem on various types of devices.
+
+
+
+## Open-source integrations
+
+🤗 Optimum also supports a variety of open-source frameworks to make model optimization very easy.
+
+
From af703cec809afdb34b8402dc25a5a80c8213ee01 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Thu, 4 Jan 2024 15:42:10 +0100
Subject: [PATCH 02/16] Fix
---
docs/source/index.mdx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/source/index.mdx b/docs/source/index.mdx
index 9f7599b5eb7..fae7b6ebfac 100644
--- a/docs/source/index.mdx
+++ b/docs/source/index.mdx
@@ -65,7 +65,7 @@ The packages below enable you to get the best of the 🤗 Hugging Face ecosystem
Apply quantization and graph optimization to accelerate Transformers models training and inference with ONNX Runtime
Exporters
+ >Exporters
Export your PyTorch or TensorFlow model to different formats such as ONNX and TFLite
Torch FX
- Create and compose custom graph transformations to optimize PyTorch Transformers models with Torch FX
+ Create and compose custom graph transformations to optimize PyTorch Transformers models with Torch FX
From 3c9c914a82dbfd347cf0ba37696cb19b86e7a639 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Thu, 4 Jan 2024 18:54:08 +0100
Subject: [PATCH 03/16] Reorder tiles
---
docs/source/index.mdx | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/docs/source/index.mdx b/docs/source/index.mdx
index fae7b6ebfac..5ad360a2ea5 100644
--- a/docs/source/index.mdx
+++ b/docs/source/index.mdx
@@ -26,9 +26,13 @@ The packages below enable you to get the best of the 🤗 Hugging Face ecosystem
-
Habana
- Maximize training throughput and efficiency with Habana's Gaudi processor
+ NVIDIA
+ Accelerate inference with NVIDIA TensorRT-LLM on the NVIDIA platform
+
+
AMD
+ Enable performance optimizations for AMD Instinct GPUs and AMD Ryzen AI NPUs
Intel
@@ -38,13 +42,9 @@ The packages below enable you to get the best of the 🤗 Hugging Face ecosystem
>AWS Trainium/Inferentia
Accelerate your training and inference workflows with AWS Trainium and AWS Inferentia
-
NVIDIA
- Accelerate inference with NVIDIA TensorRT-LLM on the NVIDIA platform
-
-
AMD
- Enable performance optimizations for AMD Instinct GPUs and AMD Ryzen AI NPUs
+ Habana
+ Maximize training throughput and efficiency with Habana's Gaudi processor
FuriosaAI
From 366b2e21fb1dccd963645b4693302b99534e4821 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Thu, 4 Jan 2024 20:58:14 +0100
Subject: [PATCH 04/16] Reorder side bar
---
.../workflows/build_main_documentation.yml | 2 +-
.github/workflows/build_pr_documentation.yml | 2 +-
docs/combine_docs.py | 28 +++++++++++++++++++
docs/source/_toctree.yml | 24 ++++++++--------
4 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/build_main_documentation.yml b/.github/workflows/build_main_documentation.yml
index 6cc2fd800d2..b5bf7dab2a2 100644
--- a/.github/workflows/build_main_documentation.yml
+++ b/.github/workflows/build_main_documentation.yml
@@ -142,7 +142,7 @@ jobs:
- name: Combine subpackage documentation
run: |
cd optimum
- sudo python docs/combine_docs.py --subpackages graphcore habana intel neuron furiosa amd --version ${{ env.VERSION }}
+ sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron habana furiosa graphcore --version ${{ env.VERSION }}
cd ..
- name: Push to repositories
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
index ddbc211c1ed..e453eb179ef 100644
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -128,7 +128,7 @@ jobs:
- name: Combine subpackage documentation
run: |
cd optimum
- sudo python docs/combine_docs.py --subpackages graphcore habana intel neuron furiosa --version pr_$PR_NUMBER
+ sudo python docs/combine_docs.py --subpackages nvidia amd intel neuron habana furiosa graphcore --version pr_$PR_NUMBER
sudo mv optimum-doc-build ../
cd ..
diff --git a/docs/combine_docs.py b/docs/combine_docs.py
index ea36c800d4a..2bb9bfe7a8d 100755
--- a/docs/combine_docs.py
+++ b/docs/combine_docs.py
@@ -105,6 +105,31 @@ def add_neuron_doc(base_toc: List):
)
+def add_nvidia_doc(base_toc: List):
+ """
+ Extends the table of content with a section about Optimum Neuron.
+
+ Args:
+ base_toc (List): table of content for the doc of Optimum.
+ """
+ # Update optimum table of contents
+ base_toc.insert(
+ 1,
+ {
+ "sections": [
+ {
+ # Ideally this should directly point at https://huggingface.co/docs/optimum-neuron/index
+ # Current hacky solution is to have a redirection in _redirects.yml
+ "local": "https://github.com/huggingface/optimum-nvidia",
+ "title": "🤗 Optimum Nvidia",
+ }
+ ],
+ "title": "Nvidia",
+ "isExpanded": False,
+ },
+ )
+
+
def main():
args = parser.parse_args()
optimum_path = Path("optimum-doc-build")
@@ -118,6 +143,9 @@ def main():
if subpackage == "neuron":
# Neuron has its own doc so it is managed differently
add_neuron_doc(base_toc)
+ elif subpackage == "nvidia":
+ # At the moment, Optimum Nvidia's doc is the README of the GitHub repo
+ add_nvidia_doc(base_toc)
else:
subpackage_path = Path(f"{subpackage}-doc-build")
diff --git a/docs/source/_toctree.yml b/docs/source/_toctree.yml
index 4d3f4e11dbd..aac015b56a7 100644
--- a/docs/source/_toctree.yml
+++ b/docs/source/_toctree.yml
@@ -95,6 +95,18 @@
title: "TFLite"
title: Exporters
isExpanded: false
+- sections:
+ - local: bettertransformer/overview
+ title: Overview
+ - sections:
+ - local: bettertransformer/tutorials/convert
+ title: Convert Transformers models to use BetterTransformer
+ - local: bettertransformer/tutorials/contribute
+ title: How to add support for new architectures?
+ title: Tutorials
+ isExpanded: false
+ title: BetterTransformer
+ isExpanded: false
- sections:
- local: torch_fx/overview
title: Overview
@@ -115,18 +127,6 @@
isExpanded: false
title: Torch FX
isExpanded: false
-- sections:
- - local: bettertransformer/overview
- title: Overview
- - sections:
- - local: bettertransformer/tutorials/convert
- title: Convert Transformers models to use BetterTransformer
- - local: bettertransformer/tutorials/contribute
- title: How to add support for new architectures?
- title: Tutorials
- isExpanded: false
- title: BetterTransformer
- isExpanded: false
- sections:
- local: llm_quantization/usage_guides/quantization
title: GPTQ quantization
From b66d07bc5817f1b1a9134359b137179089047462 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Thu, 4 Jan 2024 21:27:40 +0100
Subject: [PATCH 05/16] Add AMD doc to PR doc build
---
.github/workflows/build_pr_documentation.yml | 13 +++++++++++++
docs/combine_docs.py | 5 ++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
index e453eb179ef..954e55ec488 100644
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -64,6 +64,11 @@ jobs:
repository: 'huggingface/optimum-furiosa'
path: optimum-furiosa
+ - uses: actions/checkout@v2
+ with:
+ repository: 'huggingface/optimum-amd'
+ path: optimum-amd
+
- name: Setup environment
run: |
pip uninstall -y doc-builder
@@ -118,6 +123,14 @@ jobs:
mv furiosa-doc-build ../optimum
cd ..
+ - name: Make AMD documentation
+ run: |
+ sudo docker system prune -a -f
+ cd optimum-amd
+ make doc BUILD_DIR=amd-doc-build VERSION=${{ env.VERSION }}
+ sudo mv amd-doc-build ../optimum
+ cd ..
+
- name: Make Optimum documentation
run: |
sudo docker system prune -a -f
diff --git a/docs/combine_docs.py b/docs/combine_docs.py
index 2bb9bfe7a8d..5424441de1c 100755
--- a/docs/combine_docs.py
+++ b/docs/combine_docs.py
@@ -164,7 +164,10 @@ def main():
# Extend table of contents sections with the subpackage name as the parent folder
rename_subpackage_toc(subpackage, subpackage_toc)
# Just keep the name of the partner in the TOC title
- subpackage_toc[0]["title"] = subpackage_toc[0]["title"].split("Optimum ")[-1]
+ if subpackage == "amd":
+ subpackage_toc[0]["title"] = subpackage_toc[0]["title"].split("Optimum-")[-1]
+ else:
+ subpackage_toc[0]["title"] = subpackage_toc[0]["title"].split("Optimum ")[-1]
if subpackage != "graphcore":
# Update optimum table of contents
base_toc.insert(1, subpackage_toc[0])
From f6e1448d6d05f6dcb022b8b4792119cff56e1384 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Fri, 5 Jan 2024 15:32:28 +0100
Subject: [PATCH 06/16] Test
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d42e9454277..8bb932f4065 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
# Hugging Face Optimum
+TEST
+
🤗 Optimum is an extension of 🤗 Transformers and Diffusers, providing a set of optimization tools enabling maximum efficiency to train and run models on targeted hardware, while keeping things easy to use.
## Installation
@@ -39,7 +41,7 @@ python -m pip install optimum[onnxruntime]@git+https://github.com/huggingface/op
## Accelerated Inference
-🤗 Optimum provides multiple tools to export and run optimized models on various ecosystems:
+🤗 Optimum provides multiple tools to export and run optimized models on various ecosystems:
- [ONNX](https://huggingface.co/docs/optimum/exporters/onnx/usage_guides/export_a_model) / [ONNX Runtime](https://huggingface.co/docs/optimum/onnxruntime/usage_guides/models)
- TensorFlow Lite
From 8b55c7e89113c1f2c8cb60ce9027fab039bfe93a Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Mon, 15 Jan 2024 15:06:58 +0100
Subject: [PATCH 07/16] Trigger PR doc build for real?
---
README.md | 2 --
docs/source/index.mdx | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 8bb932f4065..4907ca62839 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,6 @@
# Hugging Face Optimum
-TEST
-
🤗 Optimum is an extension of 🤗 Transformers and Diffusers, providing a set of optimization tools enabling maximum efficiency to train and run models on targeted hardware, while keeping things easy to use.
## Installation
diff --git a/docs/source/index.mdx b/docs/source/index.mdx
index 5ad360a2ea5..79b7be70f93 100644
--- a/docs/source/index.mdx
+++ b/docs/source/index.mdx
@@ -12,6 +12,8 @@ specific language governing permissions and limitations under the License.
# 🤗 Optimum
+TEST
+
🤗 Optimum is an extension of [Transformers](https://huggingface.co/docs/transformers) that provides a set of performance optimization tools to train and run models on targeted hardware with maximum efficiency.
The AI ecosystem evolves quickly, and more and more specialized hardware along with their own optimizations are emerging every day.
From 36400bc0494b2e4873f16ba51171c0dcde5b59ee Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Mon, 15 Jan 2024 15:17:42 +0100
Subject: [PATCH 08/16] Fix?
---
.github/workflows/build_pr_documentation.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
index 954e55ec488..05487214964 100644
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -18,7 +18,7 @@ concurrency:
jobs:
authorize:
- if: (github.event.action == 'labeled' && github.event.label.name == 'build-pr-doc') || github.event_name != 'pull_request_target' || (! github.event.pull_request.head.repo.fork)
+ if: (github.event.action == 'labeled' && github.event.label.name == 'build-pr-doc') || github.event_name != 'pull_request_target' || (! github.event.pull_request_target.head.repo.fork)
runs-on: ubuntu-latest
steps:
- run: true
@@ -27,10 +27,10 @@ jobs:
needs: authorize
runs-on: ubuntu-latest
env:
- COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
+ COMMIT_SHA: ${{ github.event.pull_request_target.head.sha }}
PR_NUMBER: ${{ github.event.number }}
EVENT_CONTEXT: ${{ toJSON(github.event) }}
- PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}
+ PR_CLONE_URL: ${{ github.event.pull_request_target.head.repo.clone_url }}
steps:
- uses: actions/checkout@v2
@@ -42,7 +42,7 @@ jobs:
with:
repository: 'huggingface/optimum'
path: optimum
- ref: ${{ github.event.pull_request.merge_commit_sha }}
+ ref: ${{ github.event.pull_request_target.merge_commit_sha }}
- uses: actions/checkout@v2
with:
From 19104fac0b0ce11e3d8ad3b62d5b9d8a3cea019a Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Mon, 15 Jan 2024 15:46:54 +0100
Subject: [PATCH 09/16] Fix??
---
.github/workflows/build_pr_documentation.yml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
index 05487214964..91b05233ea1 100644
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -5,7 +5,6 @@ name: Build PR documentation
on:
workflow_dispatch:
pull_request_target:
- branches: [ main ]
types: [ opened, synchronize, reopened, labeled ]
paths:
- "optimum/**.py"
@@ -18,7 +17,7 @@ concurrency:
jobs:
authorize:
- if: (github.event.action == 'labeled' && github.event.label.name == 'build-pr-doc') || github.event_name != 'pull_request_target' || (! github.event.pull_request_target.head.repo.fork)
+ if: (github.event.action == 'labeled' && github.event.label.name == 'build-pr-doc') || github.event_name != 'pull_request_target' || (! github.event.pull_request.head.repo.fork)
runs-on: ubuntu-latest
steps:
- run: true
@@ -27,10 +26,10 @@ jobs:
needs: authorize
runs-on: ubuntu-latest
env:
- COMMIT_SHA: ${{ github.event.pull_request_target.head.sha }}
+ COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.number }}
EVENT_CONTEXT: ${{ toJSON(github.event) }}
- PR_CLONE_URL: ${{ github.event.pull_request_target.head.repo.clone_url }}
+ PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}
steps:
- uses: actions/checkout@v2
@@ -42,7 +41,7 @@ jobs:
with:
repository: 'huggingface/optimum'
path: optimum
- ref: ${{ github.event.pull_request_target.merge_commit_sha }}
+ ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: actions/checkout@v2
with:
From 8fbf5485e48245e19cdd243b790c4cc4d298c771 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Wed, 17 Jan 2024 14:57:07 +0100
Subject: [PATCH 10/16] Fix AMD doc build in PRs
---
.github/workflows/build_pr_documentation.yml | 3 ++-
docs/source/index.mdx | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
index 91b05233ea1..4a1ff30ed19 100644
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -5,6 +5,7 @@ name: Build PR documentation
on:
workflow_dispatch:
pull_request_target:
+ branches: [ main ]
types: [ opened, synchronize, reopened, labeled ]
paths:
- "optimum/**.py"
@@ -126,7 +127,7 @@ jobs:
run: |
sudo docker system prune -a -f
cd optimum-amd
- make doc BUILD_DIR=amd-doc-build VERSION=${{ env.VERSION }}
+ make doc BUILD_DIR=amd-doc-build VERSION=pr_$PR_NUMBER
sudo mv amd-doc-build ../optimum
cd ..
diff --git a/docs/source/index.mdx b/docs/source/index.mdx
index 79b7be70f93..5ad360a2ea5 100644
--- a/docs/source/index.mdx
+++ b/docs/source/index.mdx
@@ -12,8 +12,6 @@ specific language governing permissions and limitations under the License.
# 🤗 Optimum
-TEST
-
🤗 Optimum is an extension of [Transformers](https://huggingface.co/docs/transformers) that provides a set of performance optimization tools to train and run models on targeted hardware with maximum efficiency.
The AI ecosystem evolves quickly, and more and more specialized hardware along with their own optimizations are emerging every day.
From 6ecc06ab52d54ecc2353fc12b180b9ac172adb7f Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Fri, 19 Jan 2024 14:54:43 +0100
Subject: [PATCH 11/16] Fix?
---
.github/workflows/build_pr_documentation.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
index 4a1ff30ed19..631151dfdb8 100644
--- a/.github/workflows/build_pr_documentation.yml
+++ b/.github/workflows/build_pr_documentation.yml
@@ -42,7 +42,6 @@ jobs:
with:
repository: 'huggingface/optimum'
path: optimum
- ref: ${{ github.event.pull_request.merge_commit_sha }}
- uses: actions/checkout@v2
with:
From a21f0e67f986a7952406c0dd363f752ba2810209 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Tue, 20 Feb 2024 05:15:52 +0100
Subject: [PATCH 12/16] Add comment about hardware-agnostic libraries
---
docs/source/index.mdx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/docs/source/index.mdx b/docs/source/index.mdx
index 5ad360a2ea5..4e61e960d58 100644
--- a/docs/source/index.mdx
+++ b/docs/source/index.mdx
@@ -53,6 +53,9 @@ The packages below enable you to get the best of the 🤗 Hugging Face ecosystem
+> [!TIP]
+> Some packages provide hardware-agnostic features (e.g. INC interface in Optimum Intel).
+
## Open-source integrations
From 86ec9ac61df0db54ff8f36235316d3b3c81d8a3e Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Wed, 21 Feb 2024 02:40:22 +0100
Subject: [PATCH 13/16] Workaround for Optimum Nvidia link
---
docs/combine_docs.py | 2 +-
docs/source/nvidia_overview.mdx | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
create mode 100644 docs/source/nvidia_overview.mdx
diff --git a/docs/combine_docs.py b/docs/combine_docs.py
index 6dd5c01c60f..1b543f8cd14 100755
--- a/docs/combine_docs.py
+++ b/docs/combine_docs.py
@@ -120,7 +120,7 @@ def add_nvidia_doc(base_toc: List):
{
# Ideally this should directly point at https://huggingface.co/docs/optimum-neuron/index
# Current hacky solution is to have a redirection in _redirects.yml
- "local": "https://github.com/huggingface/optimum-nvidia",
+ "local": "nvidia_overview",
"title": "🤗 Optimum Nvidia",
}
],
diff --git a/docs/source/nvidia_overview.mdx b/docs/source/nvidia_overview.mdx
new file mode 100644
index 00000000000..f78583c27d5
--- /dev/null
+++ b/docs/source/nvidia_overview.mdx
@@ -0,0 +1,3 @@
+# 🤗 Optimum Nvidia
+
+Find more information about 🤗 Optimum Nvidia [here](https://github.com/huggingface/optimum-nvidia).
From e16c3febc0f3215b0a4c880072165c0d60305a40 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Wed, 21 Feb 2024 03:26:32 +0100
Subject: [PATCH 14/16] Fix
---
docs/combine_docs.py | 28 ++--------------------------
docs/source/_toctree.yml | 5 +++++
2 files changed, 7 insertions(+), 26 deletions(-)
diff --git a/docs/combine_docs.py b/docs/combine_docs.py
index 1b543f8cd14..f97fb16ad29 100755
--- a/docs/combine_docs.py
+++ b/docs/combine_docs.py
@@ -105,31 +105,6 @@ def add_neuron_doc(base_toc: List):
)
-def add_nvidia_doc(base_toc: List):
- """
- Extends the table of content with a section about Optimum Neuron.
-
- Args:
- base_toc (List): table of content for the doc of Optimum.
- """
- # Update optimum table of contents
- base_toc.insert(
- 1,
- {
- "sections": [
- {
- # Ideally this should directly point at https://huggingface.co/docs/optimum-neuron/index
- # Current hacky solution is to have a redirection in _redirects.yml
- "local": "nvidia_overview",
- "title": "🤗 Optimum Nvidia",
- }
- ],
- "title": "Nvidia",
- "isExpanded": False,
- },
- )
-
-
def main():
args = parser.parse_args()
optimum_path = Path("optimum-doc-build")
@@ -145,7 +120,8 @@ def main():
add_neuron_doc(base_toc)
elif subpackage == "nvidia":
# At the moment, Optimum Nvidia's doc is the README of the GitHub repo
- add_nvidia_doc(base_toc)
+ # It is linked to in optimum/docs/source/nvidia_overview.mdx
+ continue
else:
subpackage_path = Path(f"{subpackage}-doc-build")
diff --git a/docs/source/_toctree.yml b/docs/source/_toctree.yml
index aac015b56a7..8444da1b9a9 100644
--- a/docs/source/_toctree.yml
+++ b/docs/source/_toctree.yml
@@ -12,6 +12,11 @@
title: Quantization
title: Conceptual guides
title: Overview
+- sections:
+ - local: nvidia_overview
+ title: 🤗 Optimum Nvidia
+ title: Nvidia
+ isExpanded: false
- sections:
- local: onnxruntime/overview
title: Overview
From 38c1afa9175895780ef94bc0b54c9460548c633e Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Wed, 21 Feb 2024 03:47:49 +0100
Subject: [PATCH 15/16] Fix
---
docs/combine_docs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/combine_docs.py b/docs/combine_docs.py
index f97fb16ad29..e9df07caaf1 100755
--- a/docs/combine_docs.py
+++ b/docs/combine_docs.py
@@ -150,7 +150,7 @@ def main():
subpackage_toc[0]["title"] = subpackage_toc[0]["title"].split("Optimum ")[-1]
if subpackage != "graphcore":
# Update optimum table of contents
- base_toc.insert(1, subpackage_toc[0])
+ base_toc.insert(2, subpackage_toc[0])
# Write final table of contents
with open(base_toc_path, "w") as f:
From a445a3629f49429de92cd82869f1d6de477545f6 Mon Sep 17 00:00:00 2001
From: regisss <15324346+regisss@users.noreply.github.com>
Date: Wed, 21 Feb 2024 04:18:12 +0100
Subject: [PATCH 16/16] Fix insert index
---
docs/combine_docs.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/docs/combine_docs.py b/docs/combine_docs.py
index e9df07caaf1..17d99a3a021 100755
--- a/docs/combine_docs.py
+++ b/docs/combine_docs.py
@@ -6,6 +6,9 @@
import yaml
+SUBPACKAGE_TOC_INSERT_INDEX = 2
+
+
parser = argparse.ArgumentParser(
description="Script to combine doc builds from subpackages with base doc build of Optimum. "
"Assumes all subpackage doc builds are present in the root of the `optimum` repo."
@@ -89,7 +92,7 @@ def add_neuron_doc(base_toc: List):
"""
# Update optimum table of contents
base_toc.insert(
- 1,
+ SUBPACKAGE_TOC_INSERT_INDEX,
{
"sections": [
{
@@ -150,7 +153,7 @@ def main():
subpackage_toc[0]["title"] = subpackage_toc[0]["title"].split("Optimum ")[-1]
if subpackage != "graphcore":
# Update optimum table of contents
- base_toc.insert(2, subpackage_toc[0])
+ base_toc.insert(SUBPACKAGE_TOC_INSERT_INDEX, subpackage_toc[0])
# Write final table of contents
with open(base_toc_path, "w") as f: