Skip to content

Commit 0a1dfb2

Browse files
authored
Update XNNPACK doc structure and add template (pytorch#14873)
### Summary Prototype an updated doc structure for the XNNPACK backend. Extract a common template out under docs/source/backends/tempate/ This PR updates the doc structure as follows. Under the template, the landing page is required, partitioner, quantization, and op support docs are recommended, and the rest are optional. - XNNPACK Backend - Quantization (recommended) - Partitioner APIs (recommended) - Operator Support (optional) - Architecture and Internals (optional) - Tutorials (optional) - Guides (optional)
1 parent f68b4de commit 0a1dfb2

37 files changed

+597
-233
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ xcuserdata/
6262
/include/
6363
/share/
6464
/version.py
65-
*.csv
6665
*_etdump
6766

6867
# Android

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ executorch
3434
│ ├── <a href="backends/qualcomm">qualcomm</a> - Qualcomm-specific backends. See <a href="docs/source/backends-qualcomm.md">doc</a>.
3535
│ ├── <a href="backends/transforms">transforms</a> - Transformations for backend optimization.
3636
│ ├── <a href="backends/vulkan">vulkan</a> - Vulkan backend for cross-platform GPU support. See <a href="docs/source/backends-vulkan.md">doc</a>.
37-
│ └── <a href="backends/xnnpack">xnnpack</a> - XNNPACK backend for optimized neural network operations. See <a href="docs/source/backends-xnnpack.md">doc</a>.
37+
│ └── <a href="backends/xnnpack">xnnpack</a> - XNNPACK backend for optimized neural network operations. See <a href="docs/source/backends/xnnpack/xnnpack-overview.md">doc</a>.
3838
├── <a href="codegen">codegen</a> - Tooling to autogenerate bindings between kernels and the runtime.
3939
├── <a href="configurations">configurations</a> - Configuration files.
4040
├── <a href="devtools">devtools</a> - Model profiling, debugging, and inspection. Please refer to the <a href="docs/source/devtools-overview.md">tools documentation</a> for more information.

README-wheel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `executorch` pip package is in beta.
1111
The prebuilt `executorch.runtime` module included in this package provides a way
1212
to run ExecuTorch `.pte` files, with some restrictions:
1313
* Only [core ATen operators](docs/source/ir-ops-set-definition.md) are linked into the prebuilt module
14-
* Only the [XNNPACK backend delegate](docs/source/backends-xnnpack.md) is linked into the prebuilt module.
14+
* Only the [XNNPACK backend delegate](docs/source/backends/xnnpack/xnnpack-overview.md) is linked into the prebuilt module.
1515
* \[macOS only] [Core ML](docs/source/backends/coreml/coreml-overview.md) and [MPS](docs/source/backends/mps/mps-overview.md) backend
1616
are also linked into the prebuilt module.
1717

backends/xnnpack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ create an issue on [github](https://www.github.com/pytorch/executorch/issues).
134134
## See Also
135135
For more information about the XNNPACK Backend, please check out the following resources:
136136
- [XNNPACK Backend](https://pytorch.org/executorch/main/backends-xnnpack)
137-
- [XNNPACK Backend Internals](https://pytorch.org/executorch/main/backend-delegates-xnnpack-reference)
137+
- [XNNPACK Backend Internals](https://pytorch.org/executorch/main/backends/xnnpack/backend-delegates-xnnpack-reference)

docs/source/android-xnnpack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
```{include} backends-xnnpack.md
1+
```{include} backends/xnnpack/xnnpack-overview.md

docs/source/backend-delegate-advanced.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77
- {doc}`backend-delegates-integration` — Learn how to integrate a backend delegate into ExecuTorch
88

9-
## XNNPACK Reference
10-
11-
- {doc}`backend-delegates-xnnpack-reference` — Deep dive into XNNPACK delegate internals and implementation details
12-
139
## Dependency Management
1410

1511
- {doc}`backend-delegates-dependencies` — Manage third-party dependencies for backend delegates
@@ -27,7 +23,6 @@
2723
:maxdepth: 1
2824
2925
backend-delegates-integration
30-
backend-delegates-xnnpack-reference
3126
backend-delegates-dependencies
3227
compiler-delegate-and-partitioner
3328
debug-backend-delegate

docs/source/backend-development.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
:maxdepth: 1
55
66
backend-delegates-integration
7-
backend-delegates-xnnpack-reference
87
backend-delegates-dependencies
98
compiler-delegate-and-partitioner
109
debug-backend-delegate

docs/source/backends-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Backends are the bridge between your exported model and the hardware it runs on.
2020

2121
| Backend | Platform(s) | Hardware Type | Typical Use Case |
2222
|-----------------------------------------------------------------|---------------------|---------------|---------------------------------|
23-
| [XNNPACK](backends-xnnpack) | All | CPU | General-purpose, fallback |
23+
| [XNNPACK](backends/xnnpack/xnnpack-overview.md) | All | CPU | General-purpose, fallback |
2424
| [Core ML](/backends/coreml/coreml-overview.md) | iOS, macOS | NPU/GPU/CPU | Apple devices, high performance |
2525
| [Metal Performance Shaders](/backends/mps/mps-overview.md) | iOS, macOS | GPU | Apple GPU acceleration |
2626
| [Vulkan ](/backends/vulkan/vulkan-overview.md) | Android | GPU | Android GPU acceleration |
@@ -50,7 +50,7 @@ Backends are the bridge between your exported model and the hardware it runs on.
5050
:hidden:
5151
:caption: Backend Overview
5252
53-
backends-xnnpack
53+
backends/xnnpack/xnnpack-overview
5454
backends/coreml/coreml-overview
5555
backends/mps/mps-overview
5656
backends/vulkan/vulkan-overview

docs/source/backends-xnnpack.md

Lines changed: 0 additions & 182 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Backend Documentation Template
2+
3+
This template provides a standardized structure and starting point for backend documentation. It is intended to provide a uniform experience for users while allowing for backends to customize their documentation as needed.
4+
5+
## Template Structure
6+
7+
The template includes the following files:
8+
9+
### Required Pages
10+
11+
- `backend-overview.md` - Main backend overview and introduction
12+
13+
### Recommended Pages
14+
15+
- `backend-quantization.md` - Quantization support and API documentation
16+
- `backend-partitioner.md` - Partitioner API reference
17+
- `op-support.csv` - Operator support data in CSV format
18+
19+
### Optional Pages (and Subsections)
20+
21+
- `backend-troubleshooting.md` - Common issues and troubleshooting guide
22+
- `backend-op-support.rst` - Operator support documentation (RST format)
23+
- `backend-arch-internals.md` - Architecture and internals documentation
24+
- `tutorials/backend-tutorials.md` - Tutorial sub-section
25+
- Use this sub-section to provide tutorials for your backend.
26+
- Tutorials should explain how a user can accomplish a task, in a step by step manner.
27+
- Some examples might include:
28+
- An end to end example of lowering and running a model on a specific platform.
29+
- `tutorials/backend-guides.md` - Guides sub-section
30+
- Use this sub-section to provide guides or how-tos for backend-specific functionality.
31+
- Guides should focus on providing information and building conceptual understanding, rather than giving step by step directions.
32+
- Some examples might include:
33+
- LLM attention management / static attention
34+
- Performance optimization guide
35+
36+
## Using the Template
37+
38+
To use this template for a new backend:
39+
40+
1. Copy the entire `template` directory contents to your backend's documentation directory
41+
2. Rename files to match your backend name (e.g., `backend-overview.md``mybackend-overview.md`)
42+
3. Populate the content for your backend.
43+
44+
### Additional Customization
45+
46+
You may need to:
47+
- Add backend-specific sections to any file
48+
- Remove sections that don't apply to your backend
49+
- Update the operator support CSV with your backend's supported operators
50+
- Add backend-specific images or diagrams
51+
- Update cross-references and links
52+
53+
Try to keep the landing page (`backend-overview.md`) simple and straigtforward. Use the child pages and sections to provide more detailed information.

0 commit comments

Comments
 (0)