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
Android maintained its position as the leading mobile operating system worldwide in the fourth quarter of 2023 with <b><ahref="https://www.statista.com/statistics/272698/global-market-share-held-by-mobile-operating-systems-since-2009/">a market share of 70.1 percent </a></b> . Qualcomm is No.1 mobile SoC semiconductor company in our planet currently.
15
+
16
+
17
+
**QNN**(Qualcomm Neural Network, aka Qualcomm AI Engine Direct) SDK is verified to work with the following versions of the ML frameworks:
18
+
19
+
<ul>
20
+
<li>TensorFlow: tf-1.15.0, or tf-2.10.1 </li>
21
+
<li>TFLite: tflite-2.3.0 </li>
22
+
<li> PyTorch: torch-1.13.1</li>
23
+
<li> ONNX: onnx-1.11.0 </li>
24
+
</ul>
25
+
26
+
27
+
The Qualcomm® AI Engine Direct architecture is designed to be modular and allows for clean separation in the software for different hardware cores/accelerators such as the CPU, GPU and DSP that are designated as backends. Learn more about Qualcomm® AI Engine Direct backends here.
28
+
29
+

30
+
31
+
The Qualcomm® AI Engine Direct backends for different hardware cores/accelerators are compiled into individual core-specific libraries that come packaged with the SDK.
32
+
33
+
34
+
One of the key highlights of Qualcomm® AI Engine Direct is that it provides a unified API to delegate operations such as graph creation and execution across all hardware accelerator backends. This allows users to treat Qualcomm® AI Engine Direct as a hardware abstraction API and port applications easily to different cores.
35
+
36
+
37
+
The Qualcomm® AI Engine Direct API is designed to support an efficient execution model with capabilities such as graph optimizations to be taken care of internally. At the same time however, it leaves out broader functionality such as model parsing and network partitioning to higher level frameworks.
38
+
39
+
Qualcomm® AI Engine Direct API and the associated software stack provides all the constructs required by an application to construct, optimize and execute network models on the desired hardware accelerator core. Key constructs are illustrated by the Qualcomm AI Engine Direct Components - High Level View diagram.
The llama.cpp QNN backend is intented to support **Qualcomm mobile SoC** firstly.
49
+
50
+
51
+
## News
52
+
53
+
- 2024.4.24
54
+
- PR to ggml community
55
+
- data path works fine as expected with whisper.cpp and llama.cpp using QNN backend and verified on both low-end and high-end Android phones based on Qualcomm mobile SoC
56
+
- Support OPs
57
+
- GGML_OP_ADD
58
+
- GGML_OP_MUL
59
+
- GGML_OP_MUL_MAT
60
+
61
+
- 2024.3.29
62
+
- launch "PoC:add QNN backend for Qualcomm mobile SoC"
| Qualcomm SM8650-AB Snapdragon 8 Gen 3 | Support | Xiaomi 14 |
81
+
| Qualcomm low-end mobile SoC Series | Support | Vivo |
82
+
83
+
### Qualcomm SoC based Windows
84
+
85
+
TBD
86
+
87
+
## Android
88
+
89
+
### I. Setup Environment
90
+
91
+
Any **mainstream** Android phone based on Qualcomm's mobile SoC should be supported by llama.cpp + QNN. Qualcomm SM8650-AB Snapdragon 8 Gen 3 based Android phone is preferred.
92
+
93
+
### II. Build llama.cpp + QNN backend
94
+
95
+
96
+
Please refer to [project kantv](https://github.com/zhouwg/kantv) firstly.
97
+
98
+
99
+
A small and standalone Android example(or re-use [the existing Android example in llama.cpp](https://github.com/ggerganov/llama.cpp/tree/master/examples/llama.android)) for purpose of facilitate community developers to participate in develop/verify QNN backend.
100
+
101
+
102
+
### III. Run the inference on Qualcomm mobile SoC based Android phone
Please add the **[ggml-qnn]** prefix/tag in issues/PRs titles to help the community check/address them without delay.
118
+
119
+
## TODO
120
+
121
+
- only support FP32 / FP16 and the input and output tensors must be of the <b>same data type</b>
122
+
123
+
- lack of [implementation of other GGML-OPs using QNN API](https://github.com/zhouwg/llama.cpp/blob/qualcomm_qnn_backend_for_ggml/ggml-qnn.cpp#L3452). this work is very similar to <ahref="https://github.com/zhouwg/llama.cpp/blob/qualcomm_qnn_backend_for_ggml/ggml-qnn.cpp#L2983">GGML_OP_ADD / GGML_OP_MUL / GGML_OP_MULMAT</a> in ggml-qnn.cpp
124
+
125
+
- multithreading not working with QNN GPU&HTP (aka DSP) backend
126
+
127
+
128
+
- QNN's RPC feature(which useful for QNN HTP(aka DSP) backend) not used
129
+
130
+
- multi QNN backend(CPU/GPU/DSP) simultaneously not support
0 commit comments