Skip to content

Commit 4a9952e

Browse files
authored
Update tutorial-arm-ethos-u.md (#11625)
- Explicitly specify paths to FVP simulator with different examples / usages ### Summary [PLEASE REMOVE] See [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests) for ExecuTorch PR guidelines. [PLEASE REMOVE] If this PR closes an issue, please add a `Fixes #<issue-id>` line. [PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: <area>" label. For a list of available release notes labels, check out [CONTRIBUTING.md's Pull Requests](https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#pull-requests). ### Test plan [PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.
1 parent 3d3cf2a commit 4a9952e

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

docs/source/tutorial-arm-ethos-u.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ python3 -m examples.arm.aot_arm_compiler --model_name="add" --delegate
250250
### Delegated Quantized Workflow
251251
Generating the `.pte` file can be done using the aot_arm_compiler:
252252
```bash
253-
python3 -m examples.arm.aot_arm_compiler --model_name="mv2" --delegate --quantize"
253+
python3 -m examples.arm.aot_arm_compiler --model_name="mv2" --delegate --quantize
254254
# should produce ./mv2_arm_delegate_ethos-u55-128.pte
255255
```
256256

@@ -312,25 +312,60 @@ The SDK dir is the same one prepared [earlier](#setup-the-arm-ethos-u-software-d
312312

313313
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 you have for Corstone-300/Corstone-320 platforms.
314314

315-
This is performed by the `backends/arm/scripts/build_executor_runner.sh` script runned from `run.sh`.
315+
This step is executed by the build_executor_runner.sh script, which is invoked from the run.sh in the backends/arm/scripts folder.
316316

317317
```{tip}
318318
The `run.sh` script takes in `--target` option, which provides a way to provide a specific target, Corstone-300(ethos-u55-128) or Corstone-320(ethos-u85-128)
319319
```
320320

321321
## Running on Corstone FVP Platforms
322322

323-
Once the elf is prepared, regardless of the `.pte` file variant is used to generate the bare metal elf. `run.sh` will run the FVP for you via the `backends/arm/scripts/run_fvp.sh` script but you can also run it directly.
323+
Once the elf is prepared, regardless of the `.pte` file variant is used to generate the bare metal elf. `run.sh` will run the FVP for you via the `backends/arm/scripts/run_fvp.sh` script.
324324

325+
#### Automatic FVP Selection
325326

326-
The below command is used to run the [MV2Model](#mv2module) on Corstone-320 FVP
327+
- To run a specific test model with the compiler flag and target
328+
```bash
329+
./run.sh --model_name=mv2 --delegate --quantize --target=ethos-u85-128
330+
```
331+
332+
- To run a specific test model and target
333+
```bash
334+
./run.sh --model_name=mv2 --delegate --target=ethos-u85-128
335+
```
336+
337+
- To run all the test models iteratively in a loop
338+
```bash
339+
./run.sh --pte=mv2_arm_ethos_u55.pte --target=ethos-u55-128
340+
```
341+
342+
Note that you could use `build_executor_runner.sh` and `run_fvp.sh` scripts in tandem by passing the relevant --target argument (e.g., --target=ethos-u55-128), the correct FVP binary will be chosen automatically. For more details, see the [section on Runtime Integration](https://docs.pytorch.org/executorch/main/backends-arm-ethos-u.html#runtime-integration).
343+
344+
345+
#### Manual FVP Binary Selection
346+
347+
- If you build for the Ethos delegate U55/U65 target (e.g., using --target=ethos-u55-128 or --target=ethos-u65-256 with `build_executor_runner.sh` and `run_fvp.sh`), you should use the corresponding FVP binary:
348+
- For U55:
349+
```bash
350+
examples/arm/ethos-u-scratch/FVP-corstone300/models/Linux64_GCC-9.3/FVP_Corstone_SSE-300_Ethos-U55
351+
```
352+
- For U65:
353+
```bash
354+
examples/arm/ethos-u-scratch/FVP-corstone300/models/Linux64_GCC-9.3/FVP_Corstone_SSE-300_Ethos-U65
355+
```
356+
- And say if you are not building for an Ethos target, use:
357+
```bash
358+
examples/arm/ethos-u-scratch/FVP-corstone320/models/Linux64_GCC-9.3/FVP_Corstone_SSE-320
359+
```
360+
361+
Following is an example usage:
327362

328363
```bash
329364
ethos_u_build_dir=examples/arm/executor_runner/
330365
331366
elf=$(find ${ethos_u_build_dir} -name "arm_executor_runner")
332367
333-
FVP_Corstone_SSE-320_Ethos-U85 \
368+
FVP_Corstone_SSE-320 \
334369
-C mps4_board.subsystem.ethosu.num_macs=128 \
335370
-C mps4_board.visualisation.disable-visualisation=1 \
336371
-C vis_hdlcd.disable_visualisation=1 \
@@ -341,7 +376,8 @@ FVP_Corstone_SSE-320_Ethos-U85 \
341376
--timelimit 120 || true # seconds- after which sim will kill itself
342377
```
343378

344-
If successful, the simulator should produce something like the following on the shell,
379+
#### Verification of Successful FVP Execution
380+
After running the FVP command, either automatically or manually, you should see output similar to the following on your shell if the execution is successful:
345381

346382
```console
347383
I [executorch:arm_executor_runner.cpp:364] Model in 0x70000000 $

0 commit comments

Comments
 (0)