Skip to content

Commit 592f698

Browse files
committed
Add op support table
1 parent 66e459f commit 592f698

25 files changed

+394
-163
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

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/backends-overview.md

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

1919
## Choosing a Backend
2020

21-
| Backend | Platform(s) | Hardware Type | Typical Use Case |
22-
|-----------------------------------------------|---------------------|---------------|---------------------------------|
23-
| [XNNPACK](backends/xnnpack/xnnpack-overview) | All | CPU | General-purpose, fallback |
24-
| [Core ML](backends-coreml) | iOS, macOS | NPU/GPU | Apple devices, high performance |
25-
| [Metal Performance Shaders](backends-mps) | iOS, macOS | GPU | Apple GPU acceleration |
26-
| [Vulkan ](backends-vulkan) | Android | GPU | Android GPU acceleration |
27-
| [Qualcomm](backends-qualcomm) | Android | NPU | Qualcomm SoCs |
28-
| [MediaTek](backends-mediatek) | Android | NPU | MediaTek SoCs |
29-
| [ARM EthosU](backends-arm-ethos-u) | Embedded | NPU | ARM MCUs |
30-
| [ARM VGF](backends-arm-vgf) | Android | NPU | ARM platforms |
31-
| [OpenVINO](build-run-openvino) | Embedded | CPU/GPU/NPU | Intel SoCs |
32-
| [NXP](backends-nxp) | Embedded | NPU | NXP SoCs |
33-
| [Cadence](backends-cadence) | Embedded | DSP | DSP-optimized workloads |
34-
| [Samsung Exynos](backends-samsung-exynos) | Android | NPU | Samsung Socs |
21+
| Backend | Platform(s) | Hardware Type | Typical Use Case |
22+
|-----------------------------------------------------------|---------------------|---------------|---------------------------------|
23+
| [XNNPACK](/backends/xnnpack/xnnpack-overview) | All | CPU | General-purpose, fallback |
24+
| [Core ML](backends-coreml) | iOS, macOS | NPU/GPU | Apple devices, high performance |
25+
| [Metal Performance Shaders](backends-mps) | iOS, macOS | GPU | Apple GPU acceleration |
26+
| [Vulkan ](backends-vulkan) | Android | GPU | Android GPU acceleration |
27+
| [Qualcomm](backends-qualcomm) | Android | NPU | Qualcomm SoCs |
28+
| [MediaTek](backends-mediatek) | Android | NPU | MediaTek SoCs |
29+
| [ARM EthosU](backends-arm-ethos-u) | Embedded | NPU | ARM MCUs |
30+
| [ARM VGF](backends-arm-vgf) | Android | NPU | ARM platforms |
31+
| [OpenVINO](build-run-openvino) | Embedded | CPU/GPU/NPU | Intel SoCs |
32+
| [NXP](backends-nxp) | Embedded | NPU | NXP SoCs |
33+
| [Cadence](backends-cadence) | Embedded | DSP | DSP-optimized workloads |
34+
| [Samsung Exynos](backends-samsung-exynos) | Android | NPU | Samsung Socs |
3535

3636
**Tip:** For best performance, export a `.pte` file for each backend you plan to support.
3737

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.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# {BACKEND_NAME} Architecture and Internals
2+
3+
This page covers internal implementation details of the backend, and is mainly aimed at contributors and heavy power users. This is an optional page for each backend and has no set structure.
4+
5+
Some topics to consider:
6+
* High-level design of the backend
7+
* Details on the lowering flow
8+
* Internal debugging tools and techniques
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
================
2+
Operator Support
3+
================
4+
5+
This page lists the operators supported by the {BACKEND_NAME} backend. Operators are the building blocks of the ML model. See `IRs <https://docs.pytorch.org/docs/stable/torch.compiler_ir.html>`_ for more information on the PyTorch operator set.
6+
7+
{OPERATOR_SUPPORT_NOTES}
8+
9+
.. csv-table:: Operator Support
10+
:file: op-support.csv
11+
:header-rows: 1
12+
:widths: 20 15 30 30
13+
:align: center

docs/source/backend-template.md renamed to docs/source/backends/template/backend-overview.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Provide a brief overview/description of the backend. At a high-level, what does
44

55
## Features
66

7-
List high-level features of backend, such as general operator and hardware support.
7+
List high-level features of backend, such as operator and hardware support.
88

99
## Target Requirements
1010

@@ -18,27 +18,32 @@ What software and hardware is needed to create a .PTE file targeting this backen
1818

1919
This section describes the steps users need to take in order to generate a .PTE targeting this backend. Include a full code sample for exporting and lowering a model to this backend. Make sure relevant imports for the backend partitioner are included.
2020

21-
### Partitioner API
21+
## Runtime Integration
2222

23-
What options, if any, does the partitioner take? Are there any other export-time configurations that can be applied? Document each option.
23+
This section is intended to tell the user all of the steps they'll need to take to be able to run a .PTE file on-device that is targeting the given backend.
24+
- What CMake targets should they link to?
25+
- How is this backend compiled from source?
26+
- Is the backend bundled by default in iOS and/or Android pre-built libraries?
2427

25-
### Quantization
28+
## Reference
2629

27-
What quantization schemes does this backend support? Consider including the following, as appropriate.
28-
- What operators are supported?
29-
- Number of bits?
30-
- Static vs dynamic activations?
31-
- Weight only vs activations + weights?
32-
- Symmetric vs asymmetric weights?
33-
- Per-tensor, per-chanel, group/blockwise?
30+
**→{doc}`backend-troubleshooting` — Debug common issues.**
3431

35-
If using a PT2E quantizer, document how to initialize the quantizer and all relevant configs and options.
32+
**→{doc}`backend-partitioner` — Partitioner options.**
3633

37-
Include a code snippet demonstrating how to perform quantization for this backend. Document, or link to, a description of the parameters that the user can specify.
34+
**→{doc}`backend-quantization` — Supported quantization schemes.**
3835

39-
## Runtime Integration
36+
**→{doc}`backend-op-support` — Supported operators.**
4037

41-
This section is intended to tell the user all of the steps they'll need to take to be able to run a .PTE file on-device that is targeting the given backend.
42-
- What CMake targets should they link to?
43-
- How is this backend compiled from source?
44-
- Is the backend bundled by default in iOS and/or Android pre-built libraries?
38+
**→{doc}`backend-arch-internals` — Backend internals.**
39+
40+
```{toctree}
41+
:maxdepth: 2
42+
:hidden:
43+
:caption: {BACKEND} Backend
44+
45+
backend-troubleshooting
46+
backend-partitioner
47+
backend-quantization
48+
backend-op-support
49+
backend-arch-internals
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# {BACKEND_NAME} Partitioner API
2+
3+
Document the partitioner API for the backend, including configuration options and compile specs.
4+
5+
* `option1` - description of the option and values.
6+
* `option2`
7+
* ...
8+
9+
...
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# {BACKEND_NAME} Quantization
2+
3+
Document quantization schemes and flows for the backend. This should include a description of each scheme and a code example to perform quantization. Example sections for PT2E and quantize_ are included below, to be replaced with details for the target backend.
4+
5+
For each supported quantization scheme, include the following:
6+
* What is the quantization scheme?
7+
* How are weights quantized?
8+
* How are activations quantized? Static or dynamic?
9+
* How many bits?
10+
* What is the granularity? Per-tensor, per-channel, group/block-wise?
11+
* What are the steps to quantize a model with this scheme?
12+
* Include a code sample.
13+
* If the quantization flow only supports a small set of operators - for example, linear only - note this.
14+
15+
### Supported Quantization Schemes
16+
The {BACKEND_NAME} delegate supports the following quantization schemes:
17+
18+
- {QUANTIZATION_SCHEME_1}
19+
- {QUANTIZATION_SCHEME_2}
20+
21+
### {QUANTIZATION_METHOD_1} using the PT2E Flow
22+
23+
[Description]
24+
25+
[Code Sample]
26+
27+
### LLM Quantization with quantize_
28+
29+
[Description]
30+
31+
[Code Sample]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# {BACKEND_NAME} Troubleshooting
2+
3+
This page describes common issues that you may encounter when using the {BACKEND_NAME} backend and how to debug and resolve them.
4+
5+
## {COMMON_ISSUE_1}
6+
7+
{ISSUE_DESCRIPTION_1}
8+
9+
{SOLUTION_STEPS_1}
10+
11+
## {COMMON_ISSUE_2}
12+
13+
{ISSUE_DESCRIPTION_2}
14+
15+
{SOLUTION_STEPS_2}

0 commit comments

Comments
 (0)