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/cross-platform/multimodel_mnn_v9/1_mnn_v9.md
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,26 @@ layout: learningpathall
4
4
weight: 2
5
5
---
6
6
7
-
## Introduction
7
+
## Understand MNN and multimodal inference on Armv9
8
8
9
-
This section introduces the software stack used throughout this Learning Path. You will use **[MNN](https://github.com/alibaba/MNN)** to run a prebuilt **Omni multimodal model** on an Armv9 Linux system using only the CPU.
9
+
This section introduces the software stack used throughout this Learning Path. You will use **[MNN](https://github.com/alibaba/MNN)**(Mobile Neural Network), a lightweight inference engine, to run a prebuilt **Omni multimodal model** on an Armv9 Linux system using only the CPU.
10
10
11
-
By the end of this section, you will understand why this combination is a practical starting point for reproducible multimodal inference on Armv9, and use retail restocking workflow as an example combines local image and audio inputs use case.
11
+
By the end of this section, you'll understand why this combination is a practical starting point for reproducible multimodal inference on Armv9. A retail restocking workflow that combines local image and audio inputs is used as the example throughout.
12
12
13
13
## Why use MNN on Armv9
14
14
15
-
MNN is a lightweight inference engine designed for deployment across mobile, embedded, and edge platforms. It is a good fit for this Learning Path for four reasons:
15
+
MNN is a lightweight inference engine designed for deployment across mobile, embedded, and edge platforms. It's a good fit for this Learning Path for four reasons:
16
16
17
-
-It provides a **portable runtime** that can be built and reused across different eevice classes.
18
-
-It supports a **CPU-first deployment flow**, which is useful when you want to validate multimodal inference on Armv9 without depending on a discrete GPU or dedicated accelerator.
19
-
- Native builds can take advantage of **Armv9-specific CPU features and optimizations** when they are enabled in the build, making this a practical path for efficient local inference.
20
-
- The same runtime approach can be reused across **Arm Linux, Android, iOS, and x86-based development hosts**, which improves portability from development to deployment.
17
+
-Provides a **portable runtime** that can be built and reused across different device classes
18
+
-Supports a **CPU-first deployment flow**, useful when you want to validate multimodal inference on Armv9 without depending on a discrete GPU or dedicated accelerator
19
+
- Native builds take advantage of **Armv9-specific CPU features and optimizations** when enabled in the build, making this a practical path for efficient local inference
20
+
- The same runtime approach can be reused across **Arm Linux, Android, iOS, and x86-based development hosts**, improving portability from development to deployment
21
21
22
22
For this Learning Path, MNN gives you a practical way to build a reproducible multimodal inference workflow on Armv9 while keeping the software stack compact and deployment-oriented.
23
23
24
-
A retail restocking workflow is also a good use case example for Arm because it benefits from local CPU execution, simple deployment, and the ability to process store inputs close to where they are captured.
25
-
26
24
## Why use an Omni multimodal model
27
25
28
-
An Omni model combines **text, image, and audio** understanding in a single inference pipeline. This makes it useful for building compact edge applications that need to reason over more than one input type.
26
+
An Omni model combines **text, image, and audio** understanding in a single inference pipeline, making it useful for building compact edge applications that need to reason over more than one input type.
29
27
30
28
In this Learning Path, you use the model to:
31
29
@@ -51,6 +49,12 @@ To keep the workflow reproducible, this Learning Path uses a deliberately narrow
51
49
52
50
This scope keeps the focus on setup, validation, and multimodal application flow.
53
51
54
-
## Next steps
52
+
## What you've learned and what's next
53
+
54
+
In this section, you learned:
55
+
56
+
- Why MNN is a practical inference engine for multimodal workflows on Armv9
57
+
- How an Omni model combines text, image, and audio understanding in one pipeline
58
+
- The deliberate scope choices that keep this Learning Path reproducible and focused on CPU-first inference
55
59
56
-
In the next section, you will build MNN on Armv9 and prepare the model files and local assets used in the remaining examples.
60
+
In the next section, you'll build MNN natively on Armv9 and prepare the model files and local assets used in the remaining examples.
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/multimodel_mnn_v9/2_mnn_build.md
+69-46Lines changed: 69 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,18 @@ weight: 3
4
4
layout: learningpathall
5
5
---
6
6
7
-
## Introduction
7
+
## Build MNN for Armv9 multimodal inference
8
8
9
-
In this module you will build **MNN** natively on your Arm v9 Linux system and verify that the `llm_demo` binary can load a **prebuilt Omni MNN model package**. This sets up everything needed for the text, vision, and audio demos in later modules.
9
+
In this section, you'll build **MNN** natively on your Armv9 Linux system and verify that the `llm_demo` binary can load a prebuilt Omni MNN model package. This sets up everything needed for the text, vision, and audio demos in later sections.
10
10
11
-
This module uses a native **CPU-only** MNN build on Armv9. That is a deliberate design choice, not a fallback. The goal is to show how a compact, reproducible, deployment-friendly software stack can run directly on an Armv9 CPU without depending on a discrete GPU or separate accelerator.
11
+
This section uses a native CPU-only MNN build on Armv9 — a deliberate design choice, not a fallback. The goal is to show how a compact, reproducible, deployment-friendly software stack can run directly on an Armv9 CPU without depending on a discrete GPU or separate accelerator.
12
12
13
-
At the end of this module, you will have:
13
+
At the end of this section, you'll have:
14
14
15
15
- a working `llm_demo` binary
16
16
- a validated model directory that includes `config.json`
17
17
- a runtime environment that resolves the correct MNN shared libraries
18
+
- the required Omni model files available locally
18
19
19
20
## Create a workspace
20
21
@@ -25,13 +26,13 @@ mkdir -p ~/mnn
25
26
cd~/mnn
26
27
```
27
28
28
-
## Why build natively on Armv9 first
29
+
## Why build natively on Armv9
29
30
30
-
This Learning Path uses a native build on the target Armv9 system before introducing any cross-compilation workflow. Building directly on the target helps reduce environment drift, makes library and toolchain issues easier to diagnose, and lets you validate the runtime in the same environment where you will execute the model.
31
+
Building, running inference, and deploying all happen directly on the Armv9 device. There's no cross-compilation involved. This keeps the toolchain simple, eliminates environment drift between build and target, and means any library or configuration issue you encounter is the same one you'd hit in production.
31
32
32
-
A native-first approach also makes it easier to confirm that the final binary, shared libraries, and model assets work together correctly on the Armv9 platform. For a reproducible Learning Path, this is usually the fastest way to get to a working baseline before optimizing or automating the workflow further.
33
+
Building on the target also makes it straightforward to confirm that the binary, shared libraries, and model assets all resolve correctly in the same environment where you will run the model.
This learning path uses a prebuilt [Omni model package](https://huggingface.co/taobao-mnn/Qwen2.5-Omni-7B-MNN) that is already in MNN deployable format.
138
+
This Learning Path uses a prebuilt [Omni model package](https://www.modelscope.cn/MNN/Qwen2.5-Omni-7B-MNN) that is already prepared for MNN deployment. The full package is approximately 15 GB, so ensure you have sufficient disk space and a stable internet connection before cloning.
After cloning, install Git LFS and pull the large model files:
126
151
127
152
```bash
128
-
cat ~/mnn/Qwen2.5-Omni-7B-MNN/config.json
129
-
```
130
-
131
-
A valid configuration looks similar to:
132
-
133
-
```json
134
-
{
135
-
"llm_model": "llm.mnn",
136
-
"llm_weight": "llm.mnn.weight",
137
-
"backend_type": "cpu",
138
-
"thread_num": 4,
139
-
"precision": "low",
140
-
"memory": "low",
141
-
"system_prompt": "You are Qwen, a virtual human developed by the Qwen Team, Alibaba Group, capable of perceiving auditory and visual inputs, as well as generating text and speech.",
142
-
"talker_max_new_tokens": 2048,
143
-
"talker_speaker": "Chelsie",
144
-
"dit_steps": 5,
145
-
"dit_solver": 1,
146
-
"mllm": {
147
-
"backend_type": "cpu",
148
-
"thread_num": 4,
149
-
"precision": "normal",
150
-
"memory": "low"
151
-
}
152
-
}
153
+
sudo apt-get install -y git-lfs
154
+
git lfs install
155
+
cd~/mnn/Qwen2.5-Omni-7B-MNN
156
+
git lfs pull
153
157
```
154
158
155
159
{{% notice Note %}}
156
-
This package is already prepared for MNN deployment.
157
-
158
-
You do not need to export the model from PyTorch or run additional quantization steps before using it in this learning path.
160
+
The full model weights are approximately 15 GB. Downloading can take a while depending on your network connection.
159
161
{{% /notice %}}
160
162
163
+
Verify that the main model files are present and several gigabytes in size:
164
+
165
+
```bash
166
+
ls -lh ~/mnn/Qwen2.5-Omni-7B-MNN/llm.mnn ~/mnn/Qwen2.5-Omni-7B-MNN/llm.mnn.weight
167
+
```
168
+
169
+
If either file is only a few hundred bytes, the LFS download did not complete. Run `git lfs pull` again to resume it.
170
+
171
+
{{% notice Note %}}This package is already prepared for MNN deployment. You do not need to export the model from PyTorch or run additional quantization steps before using it in this Learning Path.{{% /notice %}}
172
+
161
173
## Check your setup
162
174
163
-
Start`llm_demo` with the model configuration:
175
+
Run`llm_demo` with the model configuration to verify the binary loads correctly:
164
176
165
177
```bash
166
178
cd~/mnn/MNN/build
167
179
./llm_demo ~/mnn/Qwen2.5-Omni-7B-MNN/config.json
168
180
```
169
181
170
-
If the binary starts without `undefined symbol` errors or missing library messages, your environment is ready for the next module.
182
+
The binary starts an interactive session. Type `exit` or press Ctrl+C to quit. If the binary loads without `undefined symbol` errors or missing library messages, your environment is ready for the next section.
183
+
184
+
## What you've learned and what's next
185
+
186
+
In this section, you:
187
+
188
+
- Built MNN natively on Armv9 with multimodal and KleidiAI support enabled
189
+
- Verified that shared libraries resolve correctly to avoid runtime conflicts
190
+
- Downloaded and validated the prebuilt Omni model package and weights
191
+
- Confirmed that `llm_demo` can load the model configuration
192
+
193
+
In the next section, you'll run a text-only baseline to verify that the core inference path works correctly before adding vision and audio inputs.
0 commit comments