Skip to content

Commit b577bd8

Browse files
committed
Add op support table
1 parent 0c47d79 commit b577bd8

24 files changed

+369
-145
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)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
- `backend-op-support.rst` - Operator support documentation (RST format)
18+
- `op-support.csv` - Operator support data in CSV format
19+
20+
### Optional Pages (and Subsections)
21+
22+
- `backend-troubleshooting.md` - Common issues and troubleshooting guide
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. Tutorials should present information about a use case in an end to end manner.
26+
- `tutorials/backend-guides.md` - Guides sub-section
27+
- Use this sub-section to provide guides or how-tos for backend-specific use cases or functionality. Examples might be static attention or device-specific memory management. These are intended to be used as a reference.
28+
29+
## Using the Template
30+
31+
To use this template for a new backend:
32+
33+
1. Copy the entire `template` directory contents to your backend's documentation directory
34+
2. Rename files to match your backend name (e.g., `backend-overview.md``mybackend-overview.md`)
35+
3. Populate the content for your backend.
36+
37+
### Additional Customization
38+
39+
You may need to:
40+
- Add backend-specific sections to any file
41+
- Remove sections that don't apply to your backend
42+
- Update the operator support CSV with your backend's supported operators
43+
- Add backend-specific images or diagrams
44+
- Update cross-references and links
45+
46+
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}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Using {FEATURE} on {BACKEND_NAME}
2+
3+
This is a placeholder guide.

0 commit comments

Comments
 (0)