Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ xcuserdata/
/include/
/share/
/version.py
*.csv
*_etdump

# Android
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ executorch
│ ├── <a href="backends/qualcomm">qualcomm</a> - Qualcomm-specific backends. See <a href="docs/source/backends-qualcomm.md">doc</a>.
│ ├── <a href="backends/transforms">transforms</a> - Transformations for backend optimization.
│ ├── <a href="backends/vulkan">vulkan</a> - Vulkan backend for cross-platform GPU support. See <a href="docs/source/backends-vulkan.md">doc</a>.
│ └── <a href="backends/xnnpack">xnnpack</a> - XNNPACK backend for optimized neural network operations. See <a href="docs/source/backends-xnnpack.md">doc</a>.
│ └── <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>.
├── <a href="codegen">codegen</a> - Tooling to autogenerate bindings between kernels and the runtime.
├── <a href="configurations">configurations</a> - Configuration files.
├── <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.
Expand Down
2 changes: 1 addition & 1 deletion README-wheel.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `executorch` pip package is in beta.
The prebuilt `executorch.runtime` module included in this package provides a way
to run ExecuTorch `.pte` files, with some restrictions:
* Only [core ATen operators](docs/source/ir-ops-set-definition.md) are linked into the prebuilt module
* Only the [XNNPACK backend delegate](docs/source/backends-xnnpack.md) is linked into the prebuilt module.
* Only the [XNNPACK backend delegate](docs/source/backends/xnnpack/xnnpack-overview.md) is linked into the prebuilt module.
* \[macOS only] [Core ML](docs/source/backends/coreml/coreml-overview.md) and [MPS](docs/source/backends/mps/mps-overview.md) backend
are also linked into the prebuilt module.

Expand Down
2 changes: 1 addition & 1 deletion backends/xnnpack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ create an issue on [github](https://www.github.com/pytorch/executorch/issues).
## See Also
For more information about the XNNPACK Backend, please check out the following resources:
- [XNNPACK Backend](https://pytorch.org/executorch/main/backends-xnnpack)
- [XNNPACK Backend Internals](https://pytorch.org/executorch/main/backend-delegates-xnnpack-reference)
- [XNNPACK Backend Internals](https://pytorch.org/executorch/main/backends/xnnpack/backend-delegates-xnnpack-reference)
2 changes: 1 addition & 1 deletion docs/source/android-xnnpack.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
```{include} backends-xnnpack.md
```{include} backends/xnnpack/xnnpack-overview.md
5 changes: 0 additions & 5 deletions docs/source/backend-delegate-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

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

## XNNPACK Reference

- {doc}`backend-delegates-xnnpack-reference` — Deep dive into XNNPACK delegate internals and implementation details

## Dependency Management

- {doc}`backend-delegates-dependencies` — Manage third-party dependencies for backend delegates
Expand All @@ -27,7 +23,6 @@
:maxdepth: 1

backend-delegates-integration
backend-delegates-xnnpack-reference
backend-delegates-dependencies
compiler-delegate-and-partitioner
debug-backend-delegate
1 change: 0 additions & 1 deletion docs/source/backend-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
:maxdepth: 1

backend-delegates-integration
backend-delegates-xnnpack-reference
backend-delegates-dependencies
compiler-delegate-and-partitioner
debug-backend-delegate
Expand Down
4 changes: 2 additions & 2 deletions docs/source/backends-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Backends are the bridge between your exported model and the hardware it runs on.

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

backends-xnnpack
backends/xnnpack/xnnpack-overview
backends/coreml/coreml-overview
backends/mps/mps-overview
backends-vulkan
Expand Down
182 changes: 0 additions & 182 deletions docs/source/backends-xnnpack.md

This file was deleted.

53 changes: 53 additions & 0 deletions docs/source/backends/template/README.md
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.
8 changes: 8 additions & 0 deletions docs/source/backends/template/backend-arch-internals.md
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
Expand Up @@ -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

Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor

Choose a reason for hiding this comment

The 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)

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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,

  • partitioner, quantizer (two entry point, separate pages)
  • tutorials (curious why it is not here?)
  • internals (can also house reference material facts which can't be part of parishioner or quantizer)
  • guide/troubleshooting/gotcha/faq (one page with a title reflecting it is for all these :p)

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing " ``` " missing

```
Loading
Loading