You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
- 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.
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.
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.
Copy file name to clipboardExpand all lines: docs/source/backends/template/backend-overview.md
+23-18Lines changed: 23 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Provide a brief overview/description of the backend. At a high-level, what does
4
4
5
5
## Features
6
6
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.
8
8
9
9
## Target Requirements
10
10
@@ -18,27 +18,32 @@ What software and hardware is needed to create a .PTE file targeting this backen
18
18
19
19
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.
20
20
21
-
### Partitioner API
21
+
##Runtime Integration
22
22
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?
24
27
25
-
### Quantization
28
+
##Reference
26
29
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.**
34
31
35
-
If using a PT2E quantizer, document how to initialize the quantizer and all relevant configs and options.
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.
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?
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:
0 commit comments