Skip to content

Commit 968de64

Browse files
authored
Merge branch 'ArmDeveloperEcosystem:main' into main
2 parents cb78d39 + d3be902 commit 968de64

File tree

8 files changed

+208
-10
lines changed

8 files changed

+208
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
jobs:
2727
build_and_deploy:
2828
# The type of runner that the job will run on
29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-24.04-arm
3030
permissions:
3131
id-token: write
3232
contents: read
@@ -59,7 +59,7 @@ jobs:
5959
run: |
6060
hugo --minify
6161
cp learn-image-sitemap.xml public/learn-image-sitemap.xml
62-
bin/pagefind --site "public"
62+
bin/pagefind.aarch64 --site "public"
6363
env:
6464
HUGO_LLM_API: ${{ secrets.HUGO_LLM_API }}
6565
HUGO_RAG_API: ${{ secrets.HUGO_RAG_API }}

content/learning-paths/mobile-graphics-and-gaming/profiling-ml-on-arm/app-profiling-streamline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ Now add the code below to the `build.gradle` file of the Module you wish to prof
128128
```gradle
129129
externalNativeBuild {
130130
cmake {
131-
path file('src/main/cpp/CMakeLists.txt')
132-
version '3.22.1'
131+
path = file("src/main/cpp/CMakeLists.txt")
132+
version = "3.22.1"
133133
}
134134
}
135135
```
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: ML Profiling of an ExecuTorch model
3+
weight: 7
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## ExecuTorch Profiling Tools
10+
You can use [ExecuTorch](https://pytorch.org/executorch/stable/index.html) for running PyTorch models on constrained devices like mobile. As so many models are developed in PyTorch, this is a useful way to quickly deploy them to mobile devices, without the requirement for conversion tools such as Google's [ai-edge-torch](https://github.com/google-ai-edge/ai-edge-torch) to convert them into tflite.
11+
12+
To get started on ExecuTorch, you can follow the instructions on the [PyTorch website](https://pytorch.org/executorch/stable/getting-started-setup). To then deploy on Android, you can also find instructions on the [Pytorch website](https://pytorch.org/executorch/stable/demo-apps-android.html). If you do not already have ExecuTorch running on Android, follow these instructions first.
13+
14+
ExecuTorch comes with a set of profiling tools, but currently they are aimed at Linux, and not Android. The instructions to profile on Linux are [here](https://pytorch.org/executorch/main/tutorials/devtools-integration-tutorial.html), and you can adapt them for use on Android.
15+
16+
## Profiling on Android
17+
18+
To profile on Android, the steps are the same as for [Linux](https://pytorch.org/executorch/main/tutorials/devtools-integration-tutorial.html), except that you need to generate the ETDump file on an Android device.
19+
20+
To start, generate the ETRecord in exactly the same way as described for the Linux instructions.
21+
22+
Next, follow the instructions to create the ExecuTorch bundled program that you will need to generate the ETDump. You will copy this to your Android device together with the runner program that you are about to compile.
23+
24+
To compile the runner program, you will need to adapt the `build_example_runner.sh` script in the instructions that are located in the `examples/devtools` subfolder of the ExecuTorch repository to compile it for Android. Copy the script and rename the file to `build_android_example_runner.sh`, ready for editing. Remove all lines with `coreml` in them, and the options dependent on it, as these are not needed for Android.
25+
26+
You then need to set the `ANDROID_NDK` environment variable to point to your Android NDK installation.
27+
28+
At the top of the `main()` function add:
29+
30+
```bash
31+
export ANDROID_NDK=~/Android/Sdk/ndk/28.0.12674087 # replace this with the correct path for your NDK installation
32+
export ANDROID_ABI=arm64-v8a
33+
```
34+
35+
Next, add Android options to the first `cmake` configuration line in `main()`, that configures the building of the ExecuTorch library.
36+
37+
Change it to:
38+
39+
```bash
40+
cmake -DCMAKE_INSTALL_PREFIX=cmake-out \
41+
-DCMAKE_BUILD_TYPE=Release \
42+
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
43+
-DANDROID_ABI="${ANDROID_ABI}" \
44+
-DEXECUTORCH_BUILD_XNNPACK=ON \
45+
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
46+
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
47+
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
48+
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
49+
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
50+
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
51+
-Bcmake-out .
52+
```
53+
54+
The `cmake` build step for the ExecuTorch library stays the same, as do the next lines setting up local variables.
55+
56+
Next you will adapt the options to Android in the second `cmake` configuration line, which is the one that configures the building of the runner.
57+
58+
Change it to:
59+
60+
```bash
61+
cmake -DCMAKE_PREFIX_PATH="${cmake_prefix_path}" \
62+
-Dexecutorch_DIR="${PWD}/cmake-out/lib/cmake/ExecuTorch" -Dgflags_DIR="${PWD}/cmake-out/third-party/gflags" \
63+
-DCMAKE_BUILD_TYPE=Release \
64+
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
65+
-DANDROID_ABI="${ANDROID_ABI}" \
66+
-B"${build_dir}" \
67+
"${example_dir}"
68+
```
69+
70+
Once you have changed the configuration lines, you can now run the script `./build_android_example_runner.sh` to build the runner program.
71+
72+
Once compiled, find the executable `example_runner` in `cmake-out/examples/devtools/`.
73+
74+
Copy `example_runner` and the ExecuTorch bundled program to your Android device.
75+
76+
Do this with adb:
77+
78+
```bash
79+
adb push example_runner /data/local/tmp/
80+
adb push bundled_program.bp /data/local/tmp/
81+
adb shell
82+
chmod 777 /data/local/tmp/example_runner
83+
./example_runner --bundled_program_path="bundled_program.bp"
84+
exit
85+
adb pull /data/local/tmp/etdump.etdp .
86+
```
87+
88+
You now have the ETDump file ready to analyze with an ExecuTorch Inspector, in line with the Linux instructions.
89+
90+
To get a full display of the operators and their timings, use the following:
91+
92+
```python
93+
from executorch.devtools import Inspector
94+
95+
etrecord_path = "etrecord.bin"
96+
etdump_path = "etdump.etdp"
97+
inspector = Inspector(etdump_path=etdump_path, etrecord=etrecord_path)
98+
inspector.print_data_tabular()
99+
```
100+
101+
However, as the [ExecuTorch profiling page](https://pytorch.org/executorch/main/tutorials/devtools-integration-tutorial.html) explains, there are data analysis options available. These enable you to quickly find specified criteria such as the slowest layer or group operators. Both the `EventBlock` and `DataFrame` approaches work well. However, at time of writing, the `find_total_for_module()` function has a [bug](https://github.com/pytorch/executorch/issues/7200) and returns incorrect values - hopefully this will soon be fixed.

content/learning-paths/servers-and-cloud-computing/refinfra-quick-start/_index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ learning_objectives:
1111
- Test the reference firmware stack.
1212

1313
prerequisites:
14-
- Some understanding of the Reference Design software stack architecture.
14+
- Some understanding of the [Reference Design software stack architecture](https://neoverse-reference-design.docs.arm.com/en/latest/about/software_stack.html).
15+
- Some understanding of the Linux command line.
16+
- Optionally a basic understanding of Docker and containers.
1517

16-
author_primary: Tom Pilar
18+
author_primary: Tom Pilar, Daniel Nguyen
1719

1820
### Tags
1921
skilllevels: Introductory

content/learning-paths/servers-and-cloud-computing/refinfra-quick-start/build-2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ lrwxrwxrwx 1 ubuntu ubuntu 30 Jan 12 15:35 tf-bl31.bin -> ../components/rdn
7979
lrwxrwxrwx 1 ubuntu ubuntu 33 Jan 12 15:35 uefi.bin -> ../components/css-common/uefi.bin
8080
```
8181

82-
The `fip-uefi.bin` firmware image will contain the `TF-A BL2` boot loader image which is responsible for unpacking the rest of the firmware as well as the firmware that TF-A BL2 unpacks. This includes the `SCP BL2` (`scp_ramfw.bin`) image that is unpacked by the AP firmware and transferred over to the SCP TCMs using the SCP shared data store module. Along with the FIP image, the FVP also needs the `TF-A BL1` image and the `SCP BL1` (`scp_romfw.bin`) image files.
82+
The `fip-uefi.bin` [firmware image package](https://trustedfirmware-a.readthedocs.io/en/v2.5/getting_started/tools-build.html) will contain the `TF-A BL2` boot loader image which is responsible for unpacking the rest of the firmware as well as the firmware that TF-A BL2 unpacks. This includes the `SCP BL2` (`scp_ramfw.bin`) image that is unpacked by the AP firmware and transferred over to the SCP TCMs using the SCP shared data store module. Along with the FIP image, the FVP also needs the `TF-A BL1` image and the `SCP BL1` (`scp_romfw.bin`) image files.
8383

content/learning-paths/servers-and-cloud-computing/refinfra-quick-start/environment-setup-1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This learning path is based on the `Neoverse N2` Reference Design (`RD-N2`).
1212

1313
## Before you begin
1414

15-
You can use either an AArch64 or x86_64 host machine running Ubuntu Linux 22.04. 64GB of free disk space and 32GB of RAM is minimum requirement to sync and build the platform software stack. 48GB of RAM is recommended.
15+
You can use either an AArch64 or x86_64 host machine running **Ubuntu Linux 22.04**. 64GB of free disk space and 32GB of RAM is minimum requirement to sync and build the platform software stack. 48GB of RAM is recommended.
1616

1717
Follow the instructions to set up your environment using the information found at the [Neoverse RD-N2 documentation site](https://neoverse-reference-design.docs.arm.com/en/latest/platforms/rdn2.html).
1818

@@ -53,7 +53,7 @@ Bug reports: https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+
5353

5454
Create a new directory in to which you can download the source code, build the stack, and then obtain the manifest file.
5555

56-
To obtain the manifest, choose a tag of the platform reference firmware. [RD-INFRA-2023.09.29](https://neoverse-reference-design.docs.arm.com/en/latest/releases/RD-INFRA-2023.09.29/release_note.html) is used here. See the [release notes](https://neoverse-reference-design.docs.arm.com/en/latest/) for more information.
56+
To obtain the manifest, choose a tag of the platform reference firmware. [RD-INFRA-2023.09.29](https://neoverse-reference-design.docs.arm.com/en/latest/releases/RD-INFRA-2023.09.29/release_note.html) is used here, although it is recommended to use the latest version available. See the [release notes](https://neoverse-reference-design.docs.arm.com/en/latest/) for more information.
5757

5858
Specify the platform you would like with the manifest. In the [manifest repo](https://git.gitlab.arm.com/infra-solutions/reference-design/infra-refdesign-manifests) there are a number of available platforms. In this case, select `pinned-rdn2.xml`.
5959

content/learning-paths/servers-and-cloud-computing/refinfra-quick-start/test-with-fvp-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ In your original terminal, launch the FVP using the supplied script:
127127
Observe the platform is running successfully:
128128
![fvp terminals alt-text#center](images/uefi.png "Figure 2. FVP Terminals")
129129

130-
To boot into `busy-box`, use:
130+
You can also boot into `busy-box`, using the command:
131131
```bash
132132
./boot.sh -p rdn2
133133
```

data/stats_weekly_data.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4716,3 +4716,98 @@
47164716
avg_close_time_hrs: 0
47174717
num_issues: 16
47184718
percent_closed_vs_total: 0.0
4719+
- a_date: '2025-01-27'
4720+
content:
4721+
automotive: 1
4722+
cross-platform: 28
4723+
embedded-and-microcontrollers: 40
4724+
install-guides: 93
4725+
iot: 5
4726+
laptops-and-desktops: 33
4727+
mobile-graphics-and-gaming: 26
4728+
servers-and-cloud-computing: 97
4729+
total: 323
4730+
contributions:
4731+
external: 45
4732+
internal: 373
4733+
github_engagement:
4734+
num_forks: 30
4735+
num_prs: 12
4736+
individual_authors:
4737+
alaaeddine-chakroun: 2
4738+
alexandros-lamprineas: 1
4739+
annie-tallund: 1
4740+
arm: 3
4741+
arnaud-de-grandmaison: 1
4742+
arnaud-de-grandmaison,-paul-howard,-and-pareena-verma: 1
4743+
basma-el-gaabouri: 1
4744+
ben-clark: 1
4745+
bolt-liu: 2
4746+
brenda-strech: 1
4747+
chaodong-gong,-alex-su,-kieran-hejmadi: 1
4748+
chen-zhang: 1
4749+
christopher-seidl: 7
4750+
cyril-rohr: 1
4751+
daniel-gubay: 1
4752+
daniel-nguyen: 1
4753+
david-spickett: 2
4754+
dawid-borycki: 31
4755+
diego-russo: 1
4756+
diego-russo-and-leandro-nunes: 1
4757+
elham-harirpoush: 2
4758+
florent-lebeau: 5
4759+
"fr\xE9d\xE9ric--lefred--descamps": 2
4760+
gabriel-peterson: 5
4761+
gayathri-narayana-yegna-narayanan: 1
4762+
georgios-mermigkis-and-konstantinos-margaritis,-vectorcamp: 1
4763+
graham-woodward: 1
4764+
han-yin: 1
4765+
iago-calvo-lista,-arm: 1
4766+
james-whitaker,-arm: 1
4767+
jason-andrews: 95
4768+
joe-stech: 1
4769+
johanna-skinnider: 2
4770+
jonathan-davies: 2
4771+
jose-emilio-munoz-lopez,-arm: 1
4772+
julie-gaskin: 4
4773+
julio-suarez: 5
4774+
kasper-mecklenburg: 1
4775+
kieran-hejmadi: 1
4776+
koki-mitsunami: 2
4777+
konstantinos-margaritis: 7
4778+
kristof-beyls: 1
4779+
liliya-wu: 1
4780+
mathias-brossard: 1
4781+
michael-hall: 5
4782+
nikhil-gupta,-pareena-verma,-nobel-chowdary-mandepudi,-ravi-malhotra: 1
4783+
nobel-chowdary-mandepudi: 1
4784+
odin-shen: 1
4785+
owen-wu,-arm: 2
4786+
pareena-verma: 34
4787+
pareena-verma,-annie-tallund: 1
4788+
pareena-verma,-jason-andrews,-and-zach-lasiuk: 1
4789+
pareena-verma,-joe-stech,-adnan-alsinan: 1
4790+
paul-howard: 1
4791+
pranay-bakre: 4
4792+
pranay-bakre,-masoud-koleini,-nobel-chowdary-mandepudi,-na-li: 1
4793+
preema-merlin-dsouza: 1
4794+
przemyslaw-wirkus: 2
4795+
rin-dobrescu: 1
4796+
roberto-lopez-mendez: 2
4797+
ronan-synnott: 46
4798+
thirdai: 1
4799+
tianyu-li: 1
4800+
tom-pilar: 1
4801+
uma-ramalingam: 1
4802+
varun-chari,-albin-bernhardsson: 1
4803+
varun-chari,-pareena-verma: 1
4804+
visualsilicon: 1
4805+
willen-yang: 1
4806+
ying-yu: 1
4807+
ying-yu,-arm: 1
4808+
zach-lasiuk: 1
4809+
zhengjun-xing: 2
4810+
issues:
4811+
avg_close_time_hrs: 0
4812+
num_issues: 15
4813+
percent_closed_vs_total: 0.0

0 commit comments

Comments
 (0)