-
Notifications
You must be signed in to change notification settings - Fork 689
Update XNNPACK doc structure and add template #14873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ xcuserdata/ | |
/include/ | ||
/share/ | ||
/version.py | ||
*.csv | ||
*_etdump | ||
|
||
# Android | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
```{include} backends-xnnpack.md | ||
```{include} backends/xnnpack/xnnpack-overview.md |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Backend Documentation Template | ||
|
||
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. | ||
|
||
## Template Structure | ||
|
||
The template includes the following files: | ||
|
||
### Required Pages | ||
|
||
- `backend-overview.md` - Main backend overview and introduction | ||
|
||
### Recommended Pages | ||
|
||
- `backend-quantization.md` - Quantization support and API documentation | ||
- `backend-partitioner.md` - Partitioner API reference | ||
- `op-support.csv` - Operator support data in CSV format | ||
|
||
### Optional Pages (and Subsections) | ||
|
||
- `backend-troubleshooting.md` - Common issues and troubleshooting guide | ||
- `backend-op-support.rst` - Operator support documentation (RST format) | ||
- `backend-arch-internals.md` - Architecture and internals documentation | ||
- `tutorials/backend-tutorials.md` - Tutorial sub-section | ||
- Use this sub-section to provide tutorials for your backend. | ||
- Tutorials should explain how a user can accomplish a task, in a step by step manner. | ||
- Some examples might include: | ||
- An end to end example of lowering and running a model on a specific platform. | ||
- `tutorials/backend-guides.md` - Guides sub-section | ||
- Use this sub-section to provide guides or how-tos for backend-specific functionality. | ||
- Guides should focus on providing information and building conceptual understanding, rather than giving step by step directions. | ||
- Some examples might include: | ||
- LLM attention management / static attention | ||
- Performance optimization guide | ||
|
||
## Using the Template | ||
|
||
To use this template for a new backend: | ||
|
||
1. Copy the entire `template` directory contents to your backend's documentation directory | ||
2. Rename files to match your backend name (e.g., `backend-overview.md` → `mybackend-overview.md`) | ||
3. Populate the content for your backend. | ||
|
||
### Additional Customization | ||
|
||
You may need to: | ||
- Add backend-specific sections to any file | ||
- Remove sections that don't apply to your backend | ||
- Update the operator support CSV with your backend's supported operators | ||
- Add backend-specific images or diagrams | ||
- Update cross-references and links | ||
|
||
Try to keep the landing page (`backend-overview.md`) simple and straigtforward. Use the child pages and sections to provide more detailed information. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# {BACKEND_NAME} Architecture and Internals | ||
|
||
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. | ||
|
||
Some topics to consider: | ||
* High-level design of the backend | ||
* Details on the lowering flow | ||
* Internal debugging tools and techniques |
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 | |
|
||
## Features | ||
|
||
List high-level features of backend, such as general operator and hardware support. | ||
List high-level features of backend, such as operator and hardware support. | ||
|
||
## Target Requirements | ||
|
||
|
@@ -18,27 +18,37 @@ What software and hardware is needed to create a .PTE file targeting this backen | |
|
||
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. | ||
|
||
### Partitioner API | ||
## Runtime Integration | ||
|
||
What options, if any, does the partitioner take? Are there any other export-time configurations that can be applied? Document each option. | ||
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. | ||
- What CMake targets should they link to? | ||
- How is this backend compiled from source? | ||
- Is the backend bundled by default in iOS and/or Android pre-built libraries? | ||
|
||
### Quantization | ||
## Reference | ||
|
||
What quantization schemes does this backend support? Consider including the following, as appropriate. | ||
- What operators are supported? | ||
- Number of bits? | ||
- Static vs dynamic activations? | ||
- Weight only vs activations + weights? | ||
- Symmetric vs asymmetric weights? | ||
- Per-tensor, per-chanel, group/blockwise? | ||
**→{doc}`backend-partitioner` — Partitioner options.** | ||
|
||
If using a PT2E quantizer, document how to initialize the quantizer and all relevant configs and options. | ||
**→{doc}`backend-quantization` — Supported quantization schemes.** | ||
|
||
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. | ||
**→{doc}`backend-troubleshooting` — Debug common issues.** | ||
|
||
## Runtime Integration | ||
**→{doc}`backend-arch-internals` — Backend internals.** | ||
|
||
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. | ||
- What CMake targets should they link to? | ||
- How is this backend compiled from source? | ||
- Is the backend bundled by default in iOS and/or Android pre-built libraries? | ||
**→{doc}`tutorials/backend-tutorials` — Tutorials.** | ||
|
||
**→{doc}`guides/backend-guides` — Tutorials.** | ||
|
||
```{toctree} | ||
:maxdepth: 2 | ||
:hidden: | ||
:caption: {BACKEND} Backend | ||
|
||
backend-troubleshooting | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np: do you wanna put the troubleshooting section a bit further back in the list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we went back and forth (literally on the list too :p) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated to put it after partitioner and quant docs, but before arch + internals. Does that work? |
||
backend-partitioner | ||
backend-quantization | ||
backend-op-support | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thinking more, technically op-support can be under partitioner. So thinking out loud,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems reasonable. I've updated to move op support into the partitioner page. I also added tutorials to the TOC in the template - good catch. |
||
backend-arch-internals | ||
tutorials/backend-tutorials | ||
guides/backend-guides | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Closing " ``` " missing |
||
``` |
Uh oh!
There was an error while loading. Please reload this page.