Skip to content

Commit 2175d59

Browse files
committed
Arm backend: Document standalone runner public docs
Update generated Ethos-U docs and docgen templates to point users at the standalone Arm executor runner CMake entry point. This replaces the old two-step install and direct runner configure flow. Signed-off-by: Usamah Zaheer <usamah.zaheer@arm.com> Change-Id: I582b87033c7d50a4219fc01a01f1b5ddd980e8e4
1 parent 9023d0f commit 2175d59

4 files changed

Lines changed: 21 additions & 35 deletions

File tree

backends/arm/scripts/docgen/ethos-u/backends-arm-ethos-u-overview.md.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Arm&reg; Ethos&trade;-U backend targets Edge/IoT-type AI use-cases by enabli
44
[Arm&reg; Ethos&trade;-U55 NPU](https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u55), [Arm&reg; Ethos&trade;-U65 NPU](https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u65), and
55
[Arm&reg; Ethos&trade;-U85 NPU](https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u85), leveraging [TOSA](https://www.mlplatform.org/tosa/) and the
66
[ethos-u-vela](https://pypi.org/project/ethos-u-vela/) graph compiler. This document is a technical reference for using the Ethos-U backend, for a top level view with code examples
7-
please refer to the [Arm Ethos-U Backend Tutorial](https://docs.pytorch.org/executorch/stable/tutorial-arm-ethos-u.html).
7+
please refer to the [Arm Ethos-U Backend Tutorial](tutorials/ethos-u-getting-started.md).
88

99
## Features
1010

@@ -27,7 +27,7 @@ For the AOT flow, compilation of a model to `.pte` format using the Ethos-U back
2727
- [TOSA Serialization Library](https://www.mlplatform.org/tosa/software.html) for serializing the Exir IR graph into TOSA IR.
2828
- [Ethos-U Vela graph compiler](https://pypi.org/project/ethos-u-vela/) for compiling TOSA flatbuffers into an Ethos-U command stream.
2929

30-
And for building and running the example application available in `examples/arm/executor_runner/`:
30+
And for building and running the example application available in `examples/arm/executor_runner/` through the standalone CMake entry point:
3131
- [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) for cross compilation.
3232
- [Arm&reg; Corstone&trade; SSE-300 FVP](https://developer.arm.com/documentation/100966/1128/Arm--Corstone-SSE-300-FVP) for testing on a Arm&reg; Cortex&reg;-M55+Ethos-U55 reference design.
3333
- [Arm&reg; Corstone&trade; SSE-320 FVP](https://developer.arm.com/documentation/109760/0000/SSE-320-FVP) for testing on a Arm&reg; Cortex&reg;-M85+Ethos-U85 reference design.
@@ -55,7 +55,7 @@ For more information on quantization, see [Quantization](arm-ethos-u-quantizatio
5555

5656
## Runtime Integration
5757

58-
An example runtime application is available in [examples/arm/executor_runner](https://github.com/pytorch/executorch/blob/main/examples/arm/executor_runner/), and the steps requried for building and deploying it on a FVP it is explained in the previously mentioned [Arm Ethos-U Backend Tutorial](https://docs.pytorch.org/executorch/stable/tutorial-arm-ethos-u.html).
58+
An example runtime application is available in [examples/arm/executor_runner](https://github.com/pytorch/executorch/blob/main/examples/arm/executor_runner/), with a standalone CMake entry point in `examples/arm/executor_runner/standalone`. The steps required for building and deploying it on an FVP are explained in the previously mentioned [Arm Ethos-U Backend Tutorial](tutorials/ethos-u-getting-started.md).
5959
The example application is recommended to use for testing basic functionality of your lowered models, as well as a starting point for developing runtime integrations for your own targets.
6060
For an in-depth explanation of the architecture of the executor_runner and the steps required for doing such an integration, please refer to [Ethos-U porting guide](https://github.com/pytorch/executorch/blob/main/examples/arm/ethos-u-porting-guide.md).
6161

backends/arm/scripts/docgen/ethos-u/ethos-u-getting-started-tutorial.md.in

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,35 +76,28 @@ To produce a pte file equivalent to the one above, run
7676

7777
### Runtime:
7878

79-
After the AOT compilation flow is done, the runtime can be cross compiled and linked to the produced `.pte`-file using the Arm cross-compilation toolchain. This is done in two steps:
79+
After the AOT compilation flow is done, the runtime can be cross compiled and linked to the produced `.pte`-file using the Arm cross-compilation toolchain. Configure the standalone Arm executor runner CMake project to pull in the ExecuTorch build graph, link the Ethos-U delegate, and generate kernel bindings for any non-delegated ops. This produces the `arm_executor_runner` program that will run on target.
8080

81-
First, build and install the ExecuTorch libraries and EthosUDelegate:
8281
```
8382
# In ExecuTorch top-level, with sourced setup_path.sh
84-
cmake -DCMAKE_BUILD_TYPE=Release --preset arm-baremetal -B cmake-out-arm .
85-
cmake --build cmake-out-arm --target install -j$(nproc)
86-
```
87-
Second, build and link the `arm_executor_runner` and generate kernel bindings for any non delegated ops. This is the actual program that will run on target.
88-
89-
```
90-
# In ExecuTorch top-level, with sourced setup_path.sh
91-
cmake -DCMAKE_TOOLCHAIN_FILE=`pwd`/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake \
83+
cmake -S examples/arm/executor_runner/standalone \
84+
-B ethos_u_minimal_example \
85+
-DEXECUTORCH_ROOT=$(pwd) \
86+
-DCMAKE_TOOLCHAIN_FILE=$(pwd)/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake \
9287
-DCMAKE_BUILD_TYPE=Release \
9388
-DET_PTE_FILE_PATH=ethos_u_minimal_example.pte \
9489
-DTARGET_CPU=cortex-m55 \
9590
-DETHOSU_TARGET_NPU_CONFIG=ethos-u55-128 \
9691
-DMEMORY_MODE=Shared_Sram \
97-
-DSYSTEM_CONFIG=Ethos_U55_High_End_Embedded \
98-
-Bethos_u_minimal_example \
99-
examples/arm/executor_runner
92+
-DSYSTEM_CONFIG=Ethos_U55_High_End_Embedded
10093
cmake --build ethos_u_minimal_example -j$(nproc) -- arm_executor_runner
10194
```
10295

10396
```{tip}
104-
For a quick start, you can use the script `backends/arm/scripts/build_executor_runner.sh` to build the runner.
97+
For a quick start, you can use the script `backends/arm/scripts/build_executor_runner.sh` to configure and build the standalone runner.
10598
To build a runner equivalent to the one above, run
10699
`./backends/arm/scripts/build_executor_runner.sh --pte=ethos_u_minimal_example.pte`
107-
````
100+
```
108101

109102
The block diagram below shows, at the high level, how the various build artifacts are generated and are linked together to generate the final bare-metal executable.
110103

docs/source/backends/arm-ethos-u/arm-ethos-u-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For the AOT flow, compilation of a model to `.pte` format using the Ethos-U back
2727
- [TOSA Serialization Library](https://www.mlplatform.org/tosa/software.html) for serializing the Exir IR graph into TOSA IR.
2828
- [Ethos-U Vela graph compiler](https://pypi.org/project/ethos-u-vela/) for compiling TOSA flatbuffers into an Ethos-U command stream.
2929

30-
And for building and running the example application available in `examples/arm/executor_runner/`:
30+
And for building and running the example application available in `examples/arm/executor_runner/` through the standalone CMake entry point:
3131
- [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) for cross compilation.
3232
- [Arm&reg; Corstone&trade; SSE-300 FVP](https://developer.arm.com/documentation/100966/1128/Arm--Corstone-SSE-300-FVP) for testing on a Arm&reg; Cortex&reg;-M55+Ethos-U55 reference design.
3333
- [Arm&reg; Corstone&trade; SSE-320 FVP](https://developer.arm.com/documentation/109760/0000/SSE-320-FVP) for testing on a Arm&reg; Cortex&reg;-M85+Ethos-U85 reference design.
@@ -111,7 +111,7 @@ For more information on quantization, see [Quantization](arm-ethos-u-quantizatio
111111

112112
## Runtime Integration
113113

114-
An example runtime application is available in [examples/arm/executor_runner](https://github.com/pytorch/executorch/blob/main/examples/arm/executor_runner/), and the steps requried for building and deploying it on a FVP it is explained in the previously mentioned [Arm Ethos-U Backend Tutorial](tutorials/ethos-u-getting-started.md).
114+
An example runtime application is available in [examples/arm/executor_runner](https://github.com/pytorch/executorch/blob/main/examples/arm/executor_runner/), with a standalone CMake entry point in `examples/arm/executor_runner/standalone`. The steps required for building and deploying it on an FVP are explained in the previously mentioned [Arm Ethos-U Backend Tutorial](tutorials/ethos-u-getting-started.md).
115115
The example application is recommended to use for testing basic functionality of your lowered models, as well as a starting point for developing runtime integrations for your own targets.
116116
For an in-depth explanation of the architecture of the executor_runner and the steps required for doing such an integration, please refer to [Ethos-U porting guide](https://github.com/pytorch/executorch/blob/main/examples/arm/ethos-u-porting-guide.md).
117117

docs/source/backends/arm-ethos-u/tutorials/ethos-u-getting-started.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,35 +149,28 @@ To produce a pte file equivalent to the one above, run
149149

150150
### Runtime:
151151

152-
After the AOT compilation flow is done, the runtime can be cross compiled and linked to the produced `.pte`-file using the Arm cross-compilation toolchain. This is done in two steps:
152+
After the AOT compilation flow is done, the runtime can be cross compiled and linked to the produced `.pte`-file using the Arm cross-compilation toolchain. Configure the standalone Arm executor runner CMake project to pull in the ExecuTorch build graph, link the Ethos-U delegate, and generate kernel bindings for any non-delegated ops. This produces the `arm_executor_runner` program that will run on target.
153153

154-
First, build and install the ExecuTorch libraries and EthosUDelegate:
155154
```
156155
# In ExecuTorch top-level, with sourced setup_path.sh
157-
cmake -DCMAKE_BUILD_TYPE=Release --preset arm-baremetal -B cmake-out-arm .
158-
cmake --build cmake-out-arm --target install -j$(nproc)
159-
```
160-
Second, build and link the `arm_executor_runner` and generate kernel bindings for any non delegated ops. This is the actual program that will run on target.
161-
162-
```
163-
# In ExecuTorch top-level, with sourced setup_path.sh
164-
cmake -DCMAKE_TOOLCHAIN_FILE=`pwd`/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake \
156+
cmake -S examples/arm/executor_runner/standalone \
157+
-B ethos_u_minimal_example \
158+
-DEXECUTORCH_ROOT=$(pwd) \
159+
-DCMAKE_TOOLCHAIN_FILE=$(pwd)/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake \
165160
-DCMAKE_BUILD_TYPE=Release \
166161
-DET_PTE_FILE_PATH=ethos_u_minimal_example.pte \
167162
-DTARGET_CPU=cortex-m55 \
168163
-DETHOSU_TARGET_NPU_CONFIG=ethos-u55-128 \
169164
-DMEMORY_MODE=Shared_Sram \
170-
-DSYSTEM_CONFIG=Ethos_U55_High_End_Embedded \
171-
-Bethos_u_minimal_example \
172-
examples/arm/executor_runner
165+
-DSYSTEM_CONFIG=Ethos_U55_High_End_Embedded
173166
cmake --build ethos_u_minimal_example -j$(nproc) -- arm_executor_runner
174167
```
175168

176169
```{tip}
177-
For a quick start, you can use the script `backends/arm/scripts/build_executor_runner.sh` to build the runner.
170+
For a quick start, you can use the script `backends/arm/scripts/build_executor_runner.sh` to configure and build the standalone runner.
178171
To build a runner equivalent to the one above, run
179172
`./backends/arm/scripts/build_executor_runner.sh --pte=ethos_u_minimal_example.pte`
180-
````
173+
```
181174

182175
The block diagram below shows, at the high level, how the various build artifacts are generated and are linked together to generate the final bare-metal executable.
183176

0 commit comments

Comments
 (0)