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: content/learning-paths/embedded-and-microcontrollers/training-inference-pytorch/_index.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
---
2
2
title: Edge AI with PyTorch & ExecuTorch - Tiny Sentiment Analysis on Arm
3
3
4
+
draft: true
5
+
cascade:
6
+
draft: true
7
+
4
8
minutes_to_complete: 90
5
9
6
10
who_is_this_for: This topic is for machine learning engineers, embedded AI developers, and researchers interested in deploying TinyML models for NLP on Arm-based edge devices using PyTorch and ExecuTorch.
Copy file name to clipboardExpand all lines: content/learning-paths/mobile-graphics-and-gaming/Vision-LLM-inference-on-Android-with-KleidiAI-and-MNN/1-devenv-and-model.md
+38-23Lines changed: 38 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,53 +5,69 @@ weight: 3
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
+
## Install Required Software
8
9
9
-
In this section, you will set up a development environment by installing dependencies and preparing the Qwen vision model.
10
+
In this section, you'll set up your development environment by installing dependencies and preparing the Qwen vision model.
10
11
11
-
## Install required software
12
+
Install the Android NDK (Native Development Kit) and git-lfs. This Learning Path was tested with NDK version `28.0.12916984` and CMake version `4.0.0-rc1`.
12
13
13
-
Install the Android NDK (Native Development Kit) and git-lfs. This learning path was tested with NDK version `28.0.12916984` and CMake version `4.0.0-rc1`.
14
-
15
-
For Ubuntu or Debian systems, you can install CMake and git-lfs with the following command:
14
+
For Ubuntu or Debian systems, install CMake and git-lfs with the following commands:
16
15
17
16
```bash
18
17
sudo apt update
19
18
sudo apt install cmake git-lfs -y
20
19
```
21
20
22
-
You can use Android Studio to obtain the NDK. Click **Tools > SDK Manager**, and navigate to the the SDK Tools tab. Select the NDK (Side by side) and CMake checkboxes, as shown below:
21
+
You can use Android Studio to obtain the NDK.
22
+
23
+
Click **Tools > SDK Manager** and navigate to the **SDK Tools** tab.
24
+
25
+
Select the **NDK (Side by side)** and **CMake** checkboxes, as shown below:
23
26
24
27

25
28
26
-
Refer to[Install NDK and CMake](https://developer.android.com/studio/projects/install-ndk) for other installation methods.
29
+
See[Install NDK and CMake](https://developer.android.com/studio/projects/install-ndk) for other installation methods.
27
30
28
-
Make sure Python and pip is installed by verifying a version is printed on running this command:
31
+
Ensure that Python and pip are installed by verifying the version with these commands:
29
32
30
33
```bash
31
34
python --version
32
35
pip --version
33
36
```
34
37
38
+
You see the versions printed:
39
+
40
+
```output
41
+
Python 3.12.3
42
+
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
43
+
```
44
+
35
45
{{% notice Note %}}
36
-
The above commands may fail when Python is installed if Python 3.x is not the default version. You can try running `python3 --version` and `pip3 --version` to be sure.
46
+
If Python 3.x is not the default version, try running `python3 --version` and `pip3 --version`.
37
47
{{% /notice %}}
38
48
39
-
## Set up phone connection
49
+
## Set up Phone Connection
50
+
51
+
You need to set up an authorized connection with your phone. The Android SDK Platform Tools package, included with Android Studio, provides Android Debug Bridge (ADB) for transferring files.
40
52
41
-
You will need to set up an authorized connection with your phone. The Android SDK Platform Tools package, included in Android Studio, comes with Android Debug Bridge (ADB). You will use this tool to transfer files later on.
53
+
Connect your phone to your computer using a USB cable, and enable USB debugging on your phone. To do this, tap the **Build Number** in your **Settings** app 7 times, then enable **USB debugging** in **Developer Options**.
42
54
43
-
Connect your phone to the computer using a USB cable. You will need to activate USB debugging on your phone. Find the **Build Number** in your **Settings** app and tap it 7 times. Then, enable **USB debugging** in **Developer Options**.
55
+
Verify the connection by running:
44
56
45
-
You should now see your device listed upon running `adb devices`:
57
+
```console
58
+
adb devices
59
+
```
60
+
61
+
If your device is connected you see it listed with your device id:
46
62
47
63
```output
48
64
List of devices attached
49
65
<DEVICE ID> device
50
66
```
51
67
52
-
## Download and convert the model
68
+
## Download and Convert the Model
53
69
54
-
The following commands download the model from Hugging Face, and clones a tool for exporting LLM model to the MNN framework.
70
+
The following commands download the model from Hugging Face, and clone a tool for exporting the LLM model to the MNN framework.
|`--sym`|Symmetric quantization (without zeropoint); default is False. | The quantization parameter that enables symmetrical quantization. |
78
93
79
-
To learn more about the parameters, refer to the [transformers README.md](https://github.com/alibaba/MNN/tree/master/transformers).
94
+
To learn more about the parameters, see the [transformers README.md](https://github.com/alibaba/MNN/tree/master/transformers).
80
95
81
-
Verify the model is built correct by checking the size of the resulting model. The `Qwen2-VL-2B-Instruct-convert-4bit-per_channel` directory should be at least 1 GB in size.
96
+
Verify that the model was built correctly by checking that the `Qwen2-VL-2B-Instruct-convert-4bit-per_channel` directory is at least 1 GB in size.
Copy file name to clipboardExpand all lines: content/learning-paths/mobile-graphics-and-gaming/Vision-LLM-inference-on-Android-with-KleidiAI-and-MNN/2-generate-apk.md
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,13 @@ weight: 4
6
6
layout: learningpathall
7
7
---
8
8
9
-
In this section, you will try the Qwen model in action using a demo application using a Android Package Kit (APK)
10
-
11
9
## Clone MNN repo
12
10
13
-
A fork of the upstream MNN repository is set up to enable building the app as an Android Studio project. Run the following to clone the repository and checkout the source tree:
11
+
In this section, you will run the Qwen model in action using a demo application using a Android Package Kit (APK).
12
+
13
+
A fork of the upstream MNN repository is set up to enable building the app as an Android Studio project.
14
+
15
+
Run the following commands to clone the repository and checkout the source tree:
14
16
15
17
```bash
16
18
cd$HOME
@@ -19,19 +21,25 @@ cd MNN
19
21
git checkout origin/llm_android_demo
20
22
```
21
23
22
-
## Build the app using Android Studio
24
+
## Build the App Using Android Studio
25
+
26
+
You can use Android Studio to build the app and create an APK.
23
27
24
28
### Open project and build
25
29
26
-
Open Android Studio. Go to **File > Open**. Navigate to the MNN repository you just cloned. Expand the `transformers/llm/engine/` directories, select the `android` one and click `Open`.
30
+
Open Android Studio.
31
+
32
+
Go to **File > Open**.
33
+
34
+
Navigate to the cloned MNN repository, expand the `transformers/llm/engine/` directories, select the `android` directory, and click `Open`.
27
35
28
-
This will trigger a build of the project, and you should see a similar output on completion:
36
+
This triggers a build of the project, and you should see output similar to the following on completion:
29
37
30
38
```output
31
39
BUILD SUCCESSFUL in 1m 42s
32
40
```
33
41
34
-
### Generate and run the APK
42
+
### Generate and Run the APK
35
43
36
44
Navigate to **Build > Generate App Bundles or APKs**. Select **Generate APKs**.
0 commit comments