Skip to content

Commit aff9ed2

Browse files
Merge pull request #3210 from madeline-underwood/v9
V9 retail
2 parents f44a764 + 1500394 commit aff9ed2

7 files changed

Lines changed: 145 additions & 76 deletions

File tree

content/learning-paths/cross-platform/multimodel_mnn_v9/1_mnn_v9.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ layout: learningpathall
44
weight: 2
55
---
66

7-
## Introduction
7+
## Understand MNN and multimodal inference on Armv9
88

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.
1010

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.
1212

1313
## Why use MNN on Armv9
1414

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:
1616

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
2121

2222
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.
2323

2424
## Why use an Omni multimodal model
2525

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.
2727

2828
In this Learning Path, you use the model to:
2929

@@ -49,6 +49,12 @@ To keep the workflow reproducible, this Learning Path uses a deliberately narrow
4949

5050
This scope keeps the focus on setup, validation, and multimodal application flow.
5151

52-
## Next steps
52+
## What you've learned and what's next
5353

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.

content/learning-paths/cross-platform/multimodel_mnn_v9/2_mnn_build.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ weight: 3
44
layout: learningpathall
55
---
66

7-
## Introduction
7+
## Build MNN for Armv9 multimodal inference
88

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.
1010

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.
1212

13-
At the end of this section, you will have:
13+
At the end of this section, you'll have:
1414

1515
- a working `llm_demo` binary
1616
- a validated model directory that includes `config.json`
@@ -28,7 +28,7 @@ cd ~/mnn
2828

2929
## Why build natively on Armv9
3030

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.
3232

3333
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.
3434

@@ -168,9 +168,7 @@ ls -lh ~/mnn/Qwen2.5-Omni-7B-MNN/llm.mnn ~/mnn/Qwen2.5-Omni-7B-MNN/llm.mnn.weigh
168168

169169
If either file is only a few hundred bytes, the LFS download did not complete. Run `git lfs pull` again to resume it.
170170

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 %}}
174172

175173
## Check your setup
176174

@@ -182,3 +180,14 @@ cd ~/mnn/MNN/build
182180
```
183181

184182
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.

content/learning-paths/cross-platform/multimodel_mnn_v9/3_mnn_text_baseline.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ weight: 4
44
layout: learningpathall
55
---
66

7-
## Introduction
7+
## Run text-only baseline inference with MNN Omni
88

99
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.
1010

@@ -24,11 +24,9 @@ You are an on-device inference assistant. In one short sentence, describe the be
2424
EOF
2525
```
2626

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 %}}
3028

31-
## Run `llm_demo` with the prompt file
29+
## Run llm_demo with the prompt file
3230

3331
Run `llm_demo` from the MNN build directory and pass both the model configuration and prompt file:
3432

@@ -39,7 +37,7 @@ cd ~/mnn/MNN/build
3937

4038
A successful run should load the model, report the detected CPU features, and return a text response for the prompt.
4139

42-
Example output:
40+
The output is similar to:
4341

4442
```text
4543
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
5957
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.
6058
```
6159

62-
6360
{{% notice Note %}}
64-
When you run `llm_demo`, you may see a line like:
65-
`The device supports: i8sdot:1, fp16:1, i8mm: 1, sve2: 1, sme2: 0`
66-
This line reports hardware feature support on your CPU: **i8sdot**, **fp16**, **i8mm**, **sve2**, and **sme2**.
67-
A value of `1` means the feature is supported in hardware, and `0` means it is not.
61+
When you run `llm_demo`, you may see a line reporting CPU hardware features:
62+
63+
```
64+
The device supports: i8sdot:1, fp16:1, i8mm: 1, sve2: 1, sme2: 0
65+
```
66+
67+
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.
6875
{{% /notice %}}
6976

7077
## Check how prompt files are processed
@@ -106,7 +113,7 @@ Arm is a processor architecture. It's used in mobile phones, embedded systems, e
106113
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.
107114
{{% /notice %}}
108115

109-
If you want to quickly sanity-check interactive mode:
116+
If you want to quickly verify interactive mode:
110117

111118
```bash
112119
cd ~/mnn/MNN/build
@@ -115,15 +122,14 @@ cd ~/mnn/MNN/build
115122

116123
Enter a short prompt and confirm that the model returns a reply. Press Ctrl+C to quit.
117124

118-
## Check your results
125+
## What you've learned and what's next
119126

120-
You have completed this section when:
127+
In this section, you:
121128

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
126132

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.
128134

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.

content/learning-paths/cross-platform/multimodel_mnn_v9/4_mnn_vision.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ weight: 5
44
layout: learningpathall
55
---
66

7-
## Introduction
7+
## Analyze retail shelf images with vision inference
88

99
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.
1010

@@ -27,22 +27,22 @@ Create a local directory for assets:
2727
mkdir -p ~/mnn/assets
2828
```
2929

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:
3131

3232
```bash
3333
wget -P ~/mnn/assets https://upload.wikimedia.org/wikipedia/commons/e/e6/Pet_Food_Aisle.jpg
3434
file ~/mnn/assets/Pet_Food_Aisle.jpg
3535
```
3636

37-
You should see output similar to:
37+
The output is similar to:
3838

3939
```text
4040
JPEG image data, JFIF standard 1.02, resolution (DPI), density 72x72, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=12, description= , manufacturer=SONY, model=DSC-W50, orientation=upper-left, xresolution=203, yresolution=211, resolutionunit=2, software=Adobe Photoshop CS Macintosh, datetime=2007:04:10 17:45:47], progressive, precision 8, 2816x2112, components 3
4141
```
4242

4343
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.
4444

45-
![Pet food aisle shelf with multiple levels stocked with pet food products, used as the vision prompt input for the shelf audit#center](pet_food_aisle.jpg "Pet food aisle shelf used for the vision audit prompt")
45+
![Pet food aisle shelf with multiple levels stocked with pet food products, showing top, middle, and bottom shelf zones that will be analyzed by the vision model#center](pet_food_aisle.jpg "Pet food shelf for vision audit")
4646

4747
## Create the vision prompt
4848

@@ -76,7 +76,7 @@ cd ~/mnn/MNN/build
7676
./llm_demo ~/mnn/Qwen2.5-Omni-7B-MNN/config.json ~/mnn/prompt_picture_coverage.txt
7777
```
7878

79-
You should see output similar to:
79+
The output is similar to:
8080

8181
```text
8282
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
9898

9999
## Why a coarse coverage estimate is enough for edge workflows
100100

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.
102102

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.
104104

105105
## Verify the result
106106

107107
Check that the output meets these conditions:
108108

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
113113

114114
If the model returns extra conversational text, tighten the prompt further by repeating `Output ONE line only`.
115115

116-
## Next steps
116+
## What you've learned and what's next
117117

118-
You have now validated image-based multimodal inference with MNN Omni on Armv9.
118+
In this section, you:
119119

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

Comments
 (0)