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-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,26 +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. A retail restocking workflow that combines local image and audio inputs is used as the example throughout.
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 device 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
24
## Why use an Omni multimodal model
25
25
26
-
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.
27
27
28
28
In this Learning Path, you use the model to:
29
29
@@ -49,6 +49,12 @@ To keep the workflow reproducible, this Learning Path uses a deliberately narrow
49
49
50
50
This scope keeps the focus on setup, validation, and multimodal application flow.
51
51
52
-
## Next steps
52
+
## What you've learned and what's next
53
53
54
-
In the next section, you will build MNN on Armv9 and prepare the model files and local assets used in the remaining examples.
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
59
+
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
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ weight: 3
4
4
layout: learningpathall
5
5
---
6
6
7
-
## Introduction
7
+
## Build MNN for Armv9 multimodal inference
8
8
9
-
In this section, you will 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.
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 section 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 section, 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`
@@ -28,7 +28,7 @@ cd ~/mnn
28
28
29
29
## Why build natively on Armv9
30
30
31
-
Building, running inference, and deploying all happen directly on the Armv9 device. There is 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 would hit in production.
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.
32
32
33
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.
34
34
@@ -168,9 +168,7 @@ ls -lh ~/mnn/Qwen2.5-Omni-7B-MNN/llm.mnn ~/mnn/Qwen2.5-Omni-7B-MNN/llm.mnn.weigh
168
168
169
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
170
171
-
{{% notice Note %}}
172
-
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.
173
-
{{% /notice %}}
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 %}}
174
172
175
173
## Check your setup
176
174
@@ -182,3 +180,14 @@ cd ~/mnn/MNN/build
182
180
```
183
181
184
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.
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/multimodel_mnn_v9/3_mnn_text_baseline.md
+26-20Lines changed: 26 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ weight: 4
4
4
layout: learningpathall
5
5
---
6
6
7
-
## Introduction
7
+
## Run text-only baseline inference with MNN Omni
8
8
9
9
In this section, you run a **text-only baseline** using the Omni model on an Armv9 Linux system. Before adding image and audio inputs, this baseline helps you confirm that the core inference path is working correctly with a simple prompt and predictable output behavior.
10
10
@@ -24,11 +24,9 @@ You are an on-device inference assistant. In one short sentence, describe the be
24
24
EOF
25
25
```
26
26
27
-
{{% notice Note %}}
28
-
`llm_demo` commonly treats each line in the file as a separate prompt. Keep each prompt on a single line.
29
-
{{% /notice %}}
27
+
{{% notice Note %}}`llm_demo` commonly treats each line in the file as a separate prompt. Keep each prompt on a single line.{{% /notice %}}
30
28
31
-
## Run `llm_demo` with the prompt file
29
+
## Run llm_demo with the prompt file
32
30
33
31
Run `llm_demo` from the MNN build directory and pass both the model configuration and prompt file:
34
32
@@ -39,7 +37,7 @@ cd ~/mnn/MNN/build
39
37
40
38
A successful run should load the model, report the detected CPU features, and return a text response for the prompt.
41
39
42
-
Example output:
40
+
The output is similar to:
43
41
44
42
```text
45
43
config path is /home/radxa/mnn/Qwen2.5-Omni-7B-MNN/config.json
@@ -59,12 +57,21 @@ prompt file is /home/radxa/mnn/text_baseline_prompt.txt
59
57
Multimodal on-device inference has several benefits, including reducing the need for cloud-based services, allowing usage in areas with poor internet connectivity, saving on data transfer costs, enabling real-time processing, and enhancing privacy during data processing. It's a great way to handle various tasks efficiently, especially when you don't want to rely too much on the cloud.
This shows the Arm architecture features are available on your CPU:
68
+
-**i8sdot** - 8-bit integer dot product
69
+
-**fp16** - 16-bit floating point
70
+
-**i8mm** - 8-bit integer matrix multiplication
71
+
-**sve2** - Scalable Vector Extension 2
72
+
-**sme2** - Scalable Matrix Extension 2
73
+
74
+
A value of `1` means supported, `0` means not supported.
68
75
{{% /notice %}}
69
76
70
77
## Check how prompt files are processed
@@ -106,7 +113,7 @@ Arm is a processor architecture. It's used in mobile phones, embedded systems, e
106
113
Output length and coherence can vary significantly without a generation length limit. If a response repeats itself, this is normal model behavior without a `max_new_tokens` constraint. Focus on confirming that two distinct responses appear, one for each prompt line.
107
114
{{% /notice %}}
108
115
109
-
If you want to quickly sanity-check interactive mode:
116
+
If you want to quickly verify interactive mode:
110
117
111
118
```bash
112
119
cd~/mnn/MNN/build
@@ -115,15 +122,14 @@ cd ~/mnn/MNN/build
115
122
116
123
Enter a short prompt and confirm that the model returns a reply. Press Ctrl+C to quit.
117
124
118
-
## Check your results
125
+
## What you've learned and what's next
119
126
120
-
You have completed this section when:
127
+
In this section, you:
121
128
122
-
-`llm_demo` loads `config.json` successfully
123
-
- the prompt file produces one response per line
124
-
- the model returns non-empty text output
125
-
- the runtime completes without crashes or missing-library errors
129
+
- Ran a text-only baseline to confirm the MNN runtime and Omni model load correctly
130
+
- Verified that prompt files are processed line by line
131
+
- Established a working text inference baseline on Armv9 CPU
126
132
127
-
## Next steps
133
+
You've confirmed that `llm_demo` loads `config.json` successfully, processes prompts correctly, and returns non-empty text output without crashes.
128
134
129
-
In the next section, you will add an image input and validate the vision path of the Omni model on Armv9.
135
+
In the next section, you'll add an image input and validate the vision path of the Omni model on Armv9.
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/multimodel_mnn_v9/4_mnn_vision.md
+20-14Lines changed: 20 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ weight: 5
4
4
layout: learningpathall
5
5
---
6
6
7
-
## Introduction
7
+
## Analyze retail shelf images with vision inference
8
8
9
9
This section shows how Armv9 can run lightweight operational vision reasoning locally without requiring cloud round trips, making it a practical fit for store-side restocking workflows.
10
10
@@ -27,22 +27,22 @@ Create a local directory for assets:
27
27
mkdir -p ~/mnn/assets
28
28
```
29
29
30
-
Download the tutorial image and verify that it is a valid JPEG file:
30
+
Download the tutorial image and verify that it's a valid JPEG file:
The key detail is that the output starts with `JPEG image data`, confirming the file is a valid JPEG. The remaining EXIF metadata can be ignored.
44
44
45
-

45
+

config path is /home/radxa/mnn/Qwen2.5-Omni-7B-MNN/config.json
@@ -98,23 +98,29 @@ The exact wording can vary, but the structured fields should be present. If the
98
98
99
99
## Why a coarse coverage estimate is enough for edge workflows
100
100
101
-
In many edge retail workflows, you do not need a perfectly precise inventory measurement to make a useful decision. A coarse estimate such as `High`, `Medium`, or `Low` coverage is often enough to identify which shelf area needs attention first and to generate a practical restocking signal.
101
+
In many edge retail workflows, you don't need a perfectly precise inventory measurement to make a useful decision. A coarse estimate such as `High`, `Medium`, or `Low` coverage is often enough to identify which shelf area needs attention first and to generate a practical restocking signal.
102
102
103
-
This keeps the prompt and output simple, reduces post-processing requirements, and makes the result easier to validate during early on-device prototyping. For this Learning Path, the goal is not to build a full inventory counting system, but to show how local vision reasoning on Armv9 can produce an operationally useful input for a restocking workflow.
103
+
Keeping the prompt and output simple reduces post-processing requirements and makes the result easier to validate during early on-device prototyping. For this Learning Path, the goal isn't to build a full inventory counting system, but to show how local vision reasoning on Armv9 can produce an operationally useful input for a restocking workflow.
104
104
105
105
## Verify the result
106
106
107
107
Check that the output meets these conditions:
108
108
109
-
-it includes coverage estimates for **top**, **middle**, and **bottom**
110
-
-it identifies one **priority zone**, such as `middle-center`
111
-
-it provides a short reason tied to visible shelf sparsity
112
-
-it uses `NOT_SURE` only when the image is genuinely ambiguous
109
+
- includes coverage estimates for **top**, **middle**, and **bottom**
110
+
- identifies one **priority zone**, such as `middle-center`
111
+
- provides a short reason tied to visible shelf sparsity
112
+
- uses `NOT_SURE` only when the image is genuinely ambiguous
113
113
114
114
If the model returns extra conversational text, tighten the prompt further by repeating `Output ONE line only`.
115
115
116
-
## Next steps
116
+
## What you've learned and what's next
117
117
118
-
You have now validated image-based multimodal inference with MNN Omni on Armv9.
118
+
In this section, you:
119
119
120
-
In the next section, you extend this workflow by running an audio-based restock instruction demo using an `<audio>...</audio>` prompt.
120
+
- Ran vision-based inference using a shelf image as input
121
+
- Generated a structured shelf audit with coverage estimates and priority zones
122
+
- Validated that MNN Omni can process local images on Armv9 CPU for operational retail workflows
123
+
124
+
You've confirmed that image-based multimodal inference works correctly and produces actionable output.
125
+
126
+
In the next section, you'll extend this workflow by running an audio-based restock instruction demo using an `<audio>...</audio>` prompt.
0 commit comments