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
Copy file name to clipboardExpand all lines: docs/source/backends-arm-ethos-u.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@
7
7
:::{grid-item-card} Tutorials we recommend you complete before this:
8
8
:class-card: card-prerequisites
9
9
*[Introduction to ExecuTorch](./intro-how-it-works.md)
10
-
*[Setting up ExecuTorch](./getting-started-setup.md)
11
-
*[Building ExecuTorch with CMake](./runtime-build-and-cross-compilation.md)
10
+
*[Getting Started](./getting-started.md)
11
+
*[Building ExecuTorch with CMake](./using-executorch-building-from-source.md)
12
12
:::
13
13
14
14
:::{grid-item-card} What you will learn in this tutorial:
@@ -280,7 +280,7 @@ The `generate_pte_file` function in `run.sh` script produces the `.pte` files ba
280
280
281
281
ExecuTorch's CMake build system produces a set of build pieces which are critical for us to include and run the ExecuTorch runtime with-in the bare-metal environment we have for Corstone FVPs from Ethos-U SDK.
282
282
283
-
[This](./runtime-build-and-cross-compilation.md) document provides a detailed overview of each individual build piece. For running either variant of the `.pte` file, we will need a core set of libraries. Here is a list,
283
+
[This](./using-executorch-building-from-source.md) document provides a detailed overview of each individual build piece. For running either variant of the `.pte` file, we will need a core set of libraries. Here is a list,
ExecuTorch backends provide hardware acceleration for a specific hardware target. In order to achieve maximum performance on target hardware, ExecuTorch optimizes the model for a specific backend during the export and lowering process. This means that the resulting .pte file is specialized for the specific hardware. In order to deploy to multiple backends, such as Core ML on iOS and Arm CPU on Android, it is common to generate a dedicated .pte file for each.
4
+
5
+
The choice of hardware backend is informed by the hardware that the model is intended to be deployed on. Each backend has specific hardware requires and level of model support. See the documentation for each hardware backend for more details.
6
+
7
+
As part of the .pte file creation process, ExecuTorch identifies portions of the model (partitions) that are supported for the given backend. These sections are processed by the backend ahead of time to support efficient execution. Portions of the model that are not supported on the delegate, if any, are executed using the portable fallback implementation on CPU. This allows for partial model acceleration when not all model operators are supported on the backend, but may have negative performance implications. In addition, multiple partitioners can be specified in order of priority. This allows for operators not supported on GPU to run on CPU via XNNPACK, for example.
8
+
9
+
### Available Backends
10
+
11
+
Commonly used hardware backends are listed below. For mobile, consider using XNNPACK for Android and XNNPACK or Core ML for iOS. To create a .pte file for a specific backend, pass the appropriate partitioner class to `to_edge_transform_and_lower`. See the appropriate backend documentation for more information.
Copy file name to clipboardExpand all lines: docs/source/getting-started.md
+30-28Lines changed: 30 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Pip is the recommended way to install the ExecuTorch python package. This packag
14
14
pip install executorch
15
15
```
16
16
17
-
To build the framework from source, see [Building From Source](TODO).
17
+
To build the framework from source, see [Building From Source](using-executorch-building-from-source.md).
18
18
19
19
Backend delegates may require additional dependencies. See the appropriate backend documentation for more information.
20
20
@@ -29,7 +29,9 @@ The following are required to install the ExecuTorch host libraries, needed to e
29
29
<hr/>
30
30
31
31
## Preparing the Model
32
-
Exporting is the process of taking a PyTorch model and converting it to the .pte file format used by the ExecuTorch runtime. This is done using Python APIs. PTE files for common models can be found on HuggingFace (TODO add link).
32
+
Exporting is the process of taking a PyTorch model and converting it to the .pte file format used by the ExecuTorch runtime. This is done using Python APIs. PTE files for common models, such as Llama 3.2, can be found on HuggingFace under [ExecuTorch Community](https://huggingface.co/executorch-community). These models have been exported and lowered for ExecuTorch, and can be directly deployed without needing to go through the lowering process.
33
+
34
+
A complete example of exporting, lowering, and verifying MobileNet V2 is available as a [Colab notebook](https://colab.research.google.com/drive/1qpxrXC3YdJQzly3mRg-4ayYiOjC6rue3?usp=sharing).
33
35
34
36
### Requirements
35
37
- A PyTorch model.
@@ -39,7 +41,7 @@ Exporting is the process of taking a PyTorch model and converting it to the .pte
39
41
### Selecting a Backend
40
42
ExecuTorch provides hardware acceleration for a wide variety of hardware. The most commonly used backends are XNNPACK, for Arm and x86 CPU, Core ML (for iOS), Vulkan (for Android GPUs), and Qualcomm (for Qualcomm-powered Android phones).
41
43
42
-
For mobile use cases, consider using XNNPACK for Android and Core ML or XNNPACK for iOS as a first step. See [Delegates](/TODO.md) for a description of available backends.
44
+
For mobile use cases, consider using XNNPACK for Android and Core ML or XNNPACK for iOS as a first step. See [Hardware Backends](backends-overview.md) for more information.
43
45
44
46
### Exporting
45
47
Exporting is done using Python APIs. ExecuTorch provides a high degree of customization during the export process, but the typical flow is as follows:
@@ -50,13 +52,13 @@ model = MyModel() # The PyTorch model to export
50
52
example_inputs = (torch.randn(1,3,64,64),) # A tuple of inputs
51
53
52
54
et_program =
53
-
executorch.exir.to_edge_transform_and_lower(
54
-
torch.export.export(model, example_inputs)
55
+
executorch.exir.to_edge_transform_and_lower(
56
+
torch.export.export(model, example_inputs)
55
57
partitioner=[XnnpackPartitioner()]
56
58
).to_executorch()
57
59
58
60
withopen(“model.pte”, “wb”) as f:
59
-
f.write(et_program.buffer)
61
+
f.write(et_program.buffer)
60
62
```
61
63
62
64
If the model requires varying input sizes, you will need to specify the varying dimensions and bounds as part of the `export` call. See [Model Export and Lowering](using-executorch-export.md) for more information.
@@ -96,7 +98,7 @@ Quick Links:
96
98
97
99
#### Installation
98
100
ExecuTorch provides Java bindings for Android usage, which can be consumed from both Java and Kotlin.
99
-
To add the library to your app, download the AAR, and add it to the gradle build rule. TODO Replace with Maven/Gradle package management when available.
101
+
To add the library to your app, download the AAR, and add it to the gradle build rule.
100
102
101
103
```
102
104
mkdir -p app/libs
@@ -113,39 +115,39 @@ dependencies {
113
115
#### Runtime APIs
114
116
Models can be loaded and run using the `Module` class:
For more information on Android development, including building from source, a full description of the Java APIs, and information on using ExecuTorch from Android native code, see [Using ExecuTorch on Android](/TODO.md).
132
+
For a full example of running a model on Android, see the [ExecuTorch Android Demo App](https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/ExecuTorchDemo/app/src/main/java/com/example/executorchdemo/ClassificationActivity.java). For more information on Android development, including building from source, a full description of the Java APIs, and information on using ExecuTorch from Android native code, see [Using ExecuTorch on Android](using-executorch-android.md).
128
133
129
134
### iOS
130
135
131
136
#### Installation
132
-
ExecuTorch supports both iOS and MacOS via C++ and Objective-C bindings, as well as hardware backends for CoreML, MPS, and CPU. The iOS runtime library is provided as a collection of .xcframework targets and are made available as a Swift PM package.
137
+
ExecuTorch supports both iOS and MacOS via C++, as well as hardware backends for CoreML, MPS, and CPU. The iOS runtime library is provided as a collection of .xcframework targets and are made available as a Swift PM package.
133
138
134
-
To get started with Xcode, go to File > Add Package Dependencies. Paste the URL of the ExecuTorch repo into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version in format “swiftpm-”, (e.g. “swiftpm-0.5.0”). The ExecuTorch dependency can also be added to the package file manually. See [Using ExecuTorch on iOS](/TODO.md) for more information.
139
+
To get started with Xcode, go to File > Add Package Dependencies. Paste the URL of the ExecuTorch repo into the search bar and select it. Make sure to change the branch name to the desired ExecuTorch version in format “swiftpm-”, (e.g. “swiftpm-0.5.0”). The ExecuTorch dependency can also be added to the package file manually. See [Using ExecuTorch on iOS](using-executorch-ios.md) for more information.
135
140
136
141
#### Runtime APIs
137
-
Models can be loaded and run from Swift as follows:
138
-
```swift
139
-
// TODO Code sample
140
-
```
142
+
Models can be loaded and run from Objective-C using the C++ APIs.
141
143
142
-
For more information on iOS integration, including an API reference, logging setup, and building from source, see [Using ExecuTorch on iOS](/TODO.md).
144
+
For more information on iOS integration, including an API reference, logging setup, and building from source, see [Using ExecuTorch on iOS](using-executorch-ios.md).
143
145
144
146
### C++
145
147
ExecuTorch provides C++ APIs, which can be used to target embedded or mobile devices. The C++ APIs provide a greater level of control compared to other language bindings, allowing for advanced memory management, data loading, and platform integration.
146
148
147
149
#### Installation
148
-
CMake is the preferred build system for the ExecuTorch C++ runtime. To use with CMake, clone the ExecuTorch repository as a subdirectory of your project, and use CMake's `add_subdirectory("executorch")` to include the dependency. The `executorch` target, as well as kernel and backend targets will be made available to link against. The runtime can also be built standalone to support diverse toolchains. See [Using ExecuTorch with C++](/TODO.md) for a detailed description of build integration, targets, and cross compilation.
150
+
CMake is the preferred build system for the ExecuTorch C++ runtime. To use with CMake, clone the ExecuTorch repository as a subdirectory of your project, and use CMake's `add_subdirectory("executorch")` to include the dependency. The `executorch` target, as well as kernel and backend targets will be made available to link against. The runtime can also be built standalone to support diverse toolchains. See [Using ExecuTorch with C++](using-executorch-cpp.md) for a detailed description of build integration, targets, and cross compilation.
@@ -199,9 +201,9 @@ For more information on the C++ APIs, see [Running an ExecuTorch Model Using the
199
201
ExecuTorch provides a high-degree of customizability to support diverse hardware targets. Depending on your use cases, consider exploring one or more of the following pages:
200
202
201
203
- [Export and Lowering](using-executorch-export.md) for advanced model conversion options.
202
-
- [Delegates](/TODO.md) for available backends and configuration options.
203
-
- [Using ExecuTorch on Android](/TODO.md) and [Using ExecuTorch on iOS](TODO.md) for mobile runtime integration.
204
-
- [Using ExecuTorch with C++](/TODO.md) for embedded and mobile native development.
205
-
- [Troubleshooting, Profiling, and Optimization](/TODO.md) for developer tooling and debugging.
206
-
- [API Reference](/TODO.md) for a full description of available APIs.
207
-
- [Examples](https://github.com/pytorch/executorch/tree/main/examples) for demo apps and example code.
204
+
- [Backend Overview](backends-overview.md) for available backends and configuration options.
205
+
- [Using ExecuTorch on Android](using-executorch-android.md) and [Using ExecuTorch on iOS](using-executorch-ios.md) for mobile runtime integration.
206
+
- [Using ExecuTorch with C++](using-executorch-cpp.md) for embedded and mobile native development.
207
+
- [Profiling and Debugging](using-executorch-troubleshooting.md) for developer tooling and debugging.
208
+
- [API Reference](export-to-executorch-api-reference.md) for a full description of available APIs.
209
+
- [Examples](https://github.com/pytorch/executorch/tree/main/examples) for demo apps and example code.
0 commit comments