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
Summary:
Removing code snippets, given they will get quickly outdated. Instead referring directly to the functions in the `setup.sh` and `run.sh`.
We can figure out a way to do some better automation but since what we had was outdated I feel this is the right thing to do in the short term.
Pull Request resolved: pytorch#6040
Reviewed By: mergennachin
Differential Revision: D64113182
Pulled By: digantdesai
fbshipit-source-id: 1c195afc7a26c062f6db8fc44d254c80232a761b
@@ -48,14 +48,9 @@ In the following sections we will walk through the steps to download each of the
48
48
49
49
## Set Up the Developer Environment
50
50
51
-
In this section, we will do a one-time setup, like downloading and installing necessary software, for the platform support files needed to run ExecuTorch programs in this tutorial. There are two approaches available:
51
+
In this section, we will do a one-time setup, like downloading and installing necessary software, for the platform support files needed to run ExecuTorch programs in this tutorial.
52
52
53
-
1. Method 1: Use the `examples/arm/setup.sh` script to pull each item in an automated fashion (recommended). It is recommended to run the script in a conda environment. Upon successful execution, you can directly go to [the next step](#convert-the-pytorch-model-to-the-pte-file).
54
-
2. Method 2: Follow the guide step by step to understand all the components and the logic of the script. You may want to use this method if you intend to change the behavior of the flow significantly.
55
-
56
-
```{tip}
57
-
In the ExecuTorch repository we have a functioning script which follows the exact same steps to speed things up. It is located at `examples/arm/setup.sh`. Feel free to use that instead if it is convenient, or use it as a reference if some of the steps in the manual instruction aren't very clear.
58
-
```
53
+
For that we will use the `examples/arm/setup.sh` script to pull each item in an automated fashion. It is recommended to run the script in a conda environment. Upon successful execution, you can directly go to [the next step](#convert-the-pytorch-model-to-the-pte-file).
59
54
60
55
As mentioned before, we currently support only Linux based platforms with x86_64 or aarch64 processor architecture. Let’s make sure we are indeed on a supported platform.
61
56
@@ -67,7 +62,7 @@ uname -m
67
62
# x86_64 or aarch64
68
63
```
69
64
70
-
Let's create an empty directory, and use this as a top level development directory.
65
+
Next we will walk through the steps performed by the `setup.sh` script to better understand the development setup.
71
66
72
67
### Download and Set Up the Corstone-300 FVP
73
68
@@ -77,126 +72,25 @@ Fixed Virtual Platforms (FVPs) are pre-configured, functionally accurate simulat
77
72
By downloading and running the FVP software, you will be agreeing to the FVP [End-user license agreement (EULA)](https://developer.arm.com/downloads/-/arm-ecosystem-fvps/eula).
78
73
```
79
74
80
-
To download, we can either download `Corstone-300 Ecosystem FVP` from [here](https://developer.arm.com/downloads/-/arm-ecosystem-fvps). Alternatively, you can download the same version we tested with like this,
hash FVP_Corstone_SSE-300_Ethos-U55 # To make sure we are ready to use
114
-
```
75
+
To download, we can either download `Corstone-300 Ecosystem FVP` from [here](https://developer.arm.com/downloads/-/arm-ecosystem-fvps). or `setup.sh` script will does that for you under `setup_fvp` function.
115
76
116
77
### Download and Install the Arm GNU AArch32 Bare-Metal Toolchain
117
78
118
79
Similar to the FVP, we would also need a tool-chain to cross-compile ExecuTorch runtime, executor-runner bare-metal application, as well as the rest of the bare-metal stack for Cortex-M55 CPU available on the Corstone-300 platform.
119
80
120
-
These toolchains are available [here](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads). We will be using GCC 12.3 targeting `arm-none-eabi` here for our tutorial. Just like FVP, to download the same version as we tested with in the top-level development dir,
hash arm-none-eabi-gcc # To make sure we are ready to use
141
-
```
81
+
These toolchains are available [here](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads). We will be using GCC 12.3 targeting `arm-none-eabi` here for our tutorial. Just like FVP, `setup.sh` script will down the toolchain for you. See `setup_toolchain` function.
142
82
143
83
### Setup the Arm Ethos-U Software Development
144
84
145
-
This git repository is the root directory for all Arm Ethos-U software. It is to help us download required repositories and place them in a tree structure. In the top-level devlopment dir,
This git repository is the root directory for all Arm Ethos-U software. It is to help us download required repositories and place them in a tree structure. See `setup_ethos_u` function of the setup script for more details.
162
86
163
87
Once this is done, you should have a working FVP simulator, a functioning toolchain for cross compilation, and the Ethos-U software development setup ready for the bare-metal developement.
164
88
165
-
#### Applying Local Patches
166
-
Since this is under active development, we have some patches for the Arm Ethos-u software development kit. Let's apply them on the download SDK and the Vela compiler.
167
-
168
-
```bash
169
-
cd ethos-u # this is the top level Ethos-U software directory
@@ -367,11 +261,7 @@ Now let's try to run these `.pte` files on a Corstone-300 platform in a bare-met
367
261
368
262
## Getting a Bare-Metal Executable
369
263
370
-
In this section, we will go over steps that you need to go through to build the runtime application. This then run on the target device.
371
-
372
-
```{tip}
373
-
In the executorch repository we have a functioning script which does the exact same steps. It is located at `executorch/examples/arm/run.sh`. Feel free to use that instead if it is convenient, or use it as a reference if some of the steps in the manual instruction aren't very clear.
374
-
```
264
+
In this section, we will go over steps that you need to go through to build the runtime application. This then run on the target device. In the executorch repository we have a functioning script which does the exact same steps. It is located at `executorch/examples/arm/run.sh`. We will use that to build necessary pieces and finally run the previously generated PTE file on an FVP.
375
265
376
266
Also before we get started, make sure that you have completed ExecuTorch cmake build setup, and the instructions to setup the development environment described [earlier](#set-up-the-developer-environment).
377
267
@@ -394,68 +284,19 @@ To run a `.pte` file with the Arm backend delegate call instructions, we will ne
394
284
-`libexecutorch_delegate_ethos_u.a`
395
285
396
286
397
-
To generate these libraries, use following commands,
287
+
These libraries are generated in `build_executorch` function of the `run.sh` script.
398
288
399
-
```bash
400
-
# Empty and already created
401
-
cd<executorch_source_root_dir>
402
-
403
-
# Use provided cmake toolchain for bare-metal builds
In this function, `EXECUTORCH_SELECT_OPS_LIST` will decide the number of portable operators included in the build and are available at runtime. It must match with `.pte` file's requirements, otherwise you will get `Missing Operator` error at runtime.
431
290
432
-
`EXECUTORCH_SELECT_OPS_LIST` will decide the number of portable operators included in the build and are available at runtime. It must match with `.pte` file's requirements, otherwise you will get `Missing Operator` error at runtime.
433
-
434
-
For example, here in the command line above, to run SoftmaxModule, we only included the softmax CPU operator. Similarly, to run AddModule in a non-delegated manner you will need add op and so on. As you might have already realized, for the delegated operators, which will be executed by the Arm backend delegate, we do not need to include those operators in this list. This is only for *non-delegated* operators.
291
+
For example, there in the command line above, to run SoftmaxModule, we only included the softmax CPU operator. Similarly, to run AddModule in a non-delegated manner you will need add op and so on. As you might have already realized, for the delegated operators, which will be executed by the Arm backend delegate, we do not need to include those operators in this list. This is only for *non-delegated* operators.
435
292
436
293
### Building the executor_runner Bare-Metal Application
437
294
438
295
The SDK dir is the same one prepared [earlier](#setup-the-arm-ethos-u-software-development). And, we will be passing the `.pte` file (any one of them) generated above.
439
296
440
297
Note, you have to generate a new `executor-runner` binary if you want to change the model or the `.pte` file. This constraint is from the constrained bare-metal runtime environment we have for Corstone-300 platform.
0 commit comments