MNN README

The project's README from github.com/alibaba/MNN. As one markdown file: README.md.

MNN

License Documentation 簡體中文版本 繁體中文版本 日本語バージョン MNN Homepage zread

MNN Chat App TaoAvatar Sana

News 🔥

History News
  • [2026/03/05] Support Qwen3.5 Series.

Icon Icon Icon

  • [2026/02/13] MNN-Sana-Edit-V2 is now available at apps, offering cartoon-style photo editing based on Sana.

Icon

  • [2025/10/16] Support Qwen3-VL Series.
  • [2025/06/11] New App MNN TaoAvatar released, you can talk with 3DAvatar offline with LLM, ASR, TTS, A2BS and NNR models all run local on your device!! MNN TaoAvatar

Icon

  • [2025/05/12] android app support qwen2.5 omni 3b and 7b MNN Chat App.

Icon Icon Icon

  • [2025/04/30] android app support qwen3 and dark mode MNN Chat App.

Icon

  • [2025/02/18] iOS multimodal LLM App is released MNN LLM iOS.

Icon

Icon

  • [2025/01/23] We released our full multimodal LLM Android App:MNN-LLM-Android. including text-to-text, image-to-text, audio-to-text, and text-to-image generation.

Icon Icon Icon Icon

Intro

MNN is a highly efficient and lightweight deep learning framework. It supports inference and training of deep learning models and has industry-leading performance for inference and training on-device. At present, MNN has been integrated into more than 30 apps of Alibaba Inc, such as Taobao, Tmall, Youku, DingTalk, Xianyu, etc., covering more than 70 usage scenarios such as live broadcast, short video capture, search recommendation, product searching by image, interactive marketing, equity distribution, security risk control. In addition, MNN is also used on embedded devices, such as IoT.

MNN-LLM is a large language model runtime solution developed based on the MNN engine. The mission of this project is to deploy LLM models locally on everyone's platforms(Mobile Phone/PC/IOT). It supports popular large language models such as Qianwen, Baichuan, Zhipu, LLAMA, and others. MNN-LLM User guide

MNN-Diffusion is a stable diffusion model runtime solution developed based on the MNN engine. The mission of this project is to deploy stable diffusion models locally on everyone's platforms. MNN-Diffusion User guide

architecture

Inside Alibaba, MNN works as the basic module of the compute container in the Walle System, the first end-to-end, general-purpose, and large-scale production system for device-cloud collaborative machine learning, which has been published in the top system conference OSDI’22. The key design principles of MNN and the extensive benchmark testing results (vs. TensorFlow, TensorFlow Lite, PyTorch, PyTorch Mobile, TVM) can be found in the OSDI paper. The scripts and instructions for benchmark testing are put in the path “/benchmark”. If MNN or the design of Walle helps your research or production use, please cite our OSDI paper as follows:

@inproceedings {proc:osdi22:walle,
    author = {Chengfei Lv and Chaoyue Niu and Renjie Gu and Xiaotang Jiang and Zhaode Wang and Bin Liu and Ziqi Wu and Qiulin Yao and Congyu Huang and Panos Huang and Tao Huang and Hui Shu and Jinde Song and Bin Zou and Peng Lan and Guohuan Xu and Fei Wu and Shaojie Tang and Fan Wu and Guihai Chen},
    title = {Walle: An {End-to-End}, {General-Purpose}, and {Large-Scale} Production System for {Device-Cloud} Collaborative Machine Learning},
    booktitle = {16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22)},
    year = {2022},
    isbn = {978-1-939133-28-1},
    address = {Carlsbad, CA},
    pages = {249--265},
    url = {https://www.usenix.org/conference/osdi22/presentation/lv},
    publisher = {USENIX Association},
    month = jul,
}

Documentation and Workbench

MNN's docs are in place in Read the docs.

You can also read docs/README to build docs's html.

MNN Workbench could be downloaded from MNN's homepage, which provides pretrained models, visualized training tools, and one-click deployment of models to devices.

Key Features

Lightweight

Versatility

High performance

Ease of use

The Architecture / Precision MNN supported is shown below:

Architecture / Precision Normal FP16 BF16 Int8
CPU Native B C B B
x86/x64-SSE4.1 A C C A
x86/x64-AVX2 S C C A
x86/x64-AVX512 S C C S
ARMv7a S S (ARMv8.2) S S
ARMv8 S S (ARMv8.2) S(ARMv8.6) S
GPU OpenCL A S C S
Vulkan A A C A
Metal A S C S
CUDA A S C A
NPU CoreML A C C C
HIAI A C C C
NNAPI B B C B
QNN C B C C

Tools

Base on MNN (Tensor compute engine), we provided a series of tools for inference, train and general computation.

How to Discuss and Get Help From the MNN Community

The group discussions are predominantly Chinese. But we welcome and will help English speakers.

Dingtalk discussion groups:

Group #4 (Available): 160170007549

Group #3 (Full)

Group #2 (Full): 23350225

Group #1 (Full): 23329087

Historical Paper

The preliminary version of MNN, as mobile inference engine and with the focus on manual optimization, has also been published in MLSys 2020. Please cite the paper, if MNN previously helped your research:

@inproceedings{alibaba2020mnn,
  author = {Jiang, Xiaotang and Wang, Huan and Chen, Yiliu and Wu, Ziqi and Wang, Lichuan and Zou, Bin and Yang, Yafeng and Cui, Zongyang and Cai, Yu and Yu, Tianhang and Lv, Chengfei and Wu, Zhihua},
  title = {MNN: A Universal and Efficient Inference Engine},
  booktitle = {MLSys},
  year = {2020}
}

License

Apache 2.0

Acknowledgement

MNN participants: Taobao Technology Department, Search Engineering Team, DAMO Team, Youku and other Alibaba Group employees.

MNN refers to the following projects:

MNN (alibaba/MNN)

Searching Database…

16.2K ·GitHub
这是什么?MNN 是阿里巴巴开发的轻量、高性能深度学习推理(及训练)引擎,可在移动端、嵌入式和边缘设备上高效运行大语言模型、扩散模型和 CNN 等模型。
这是我可以用来开发应用的框架,还是仅仅是一种模型文件格式?它是一个完整的推理/训练框架和工具链,包括转换器、计算引擎本身、压缩工具,以及类似 OpenCV 的计算机视觉库,此外还提供大语言模型和扩散模型的现成运行时层。
我该如何让模型在 MNN 上运行?先使用 MNN-Converter 将现有模型(TensorFlow、Caffe、ONNX 或 TorchScript)转换为 MNN 格式,然后在目标设备上通过其 C++ 或 Python API 使用 MNN 引擎运行。
使用它需要 Python 或 GPU 工具包吗?不需要,MNN 设计为在设备端无需任何外部依赖即可运行;如果可用,它可选择使用 Metal、OpenCL、Vulkan 或 CUDA 进行 GPU 加速,并提供 Python API 以便更轻松地使用。
每个后端的效果都一样好吗?不一样,支持质量因后端和精度差异很大:一些组合(如 CPU Native FP16 或 NNAPI)被标记为有 bug 或未优化('B'),或完全不支持('C'),而 ARM/AVX512 等则已完全优化('S')。
谁已经在生产环境中使用 MNN?MNN 已集成到 30 多个阿里巴巴应用中(淘宝、天猫、优酷、钉钉、闲鱼),覆盖 70 多个场景,同时也用于物联网及其他嵌入式设备。
它支持哪些平台和设备?MNN 支持 iOS 8.0+、Android 4.3+ 以及其他具有 POSIX 接口的嵌入式设备,可在 CPU(x86/ARM)和 GPU 后端上运行。
README 中未说明采用 Apache 2.0 许可证,除标准宽松条款外没有其他限制。
什么是 MNN-LLM?它支持哪些模型?MNN-LLM 是基于 MNN 构建的运行时,用于在手机、电脑或物联网设备上本地部署大语言模型,支持通义千问(Qwen)、百川、智谱、LLaMA、DeepSeek-R1 和 Qwen3 等模型。
有现成的应用可以直接试用,而无需从源码构建吗?有的,MNN 已发布 Android 和 iOS 聊天应用(MNN-LLM-Android、MNN LLM iOS),支持文本、图像、语音转文字和文生图生成,还有 MNN TaoAvatar 应用,可进行离线 3D 虚拟形象对话。
与其他框架相比,MNN 有多小?它非常精简:iOS 静态库约 12MB,Android 核心共享库仅约 800KB,可选的最小化构建(MNNBUILDMINI)还能再减少约 25% 的安装包体积。
为什么要开发 MNN,而不直接使用 TensorFlow Lite 或 PyTorch Mobile?MNN 是为满足阿里巴巴自身的端云一体生产需求而开发的,并与 TensorFlow、TensorFlow Lite、PyTorch、PyTorch Mobile 和 TVM 进行了基准测试,声称端侧性能处于业界领先水平,相关结果记录于其 OSDI'22 论文中。
Creator
alibaba
Size
357.2 MB
Stars
16.2K
Age
7y
Commits · 90 Days