GithubHelp home page GithubHelp logo

raymondzhouyang / mnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alibaba/mnn

0.0 0.0 0.0 36.12 MB

MNN is a lightweight deep neural network inference engine.

CMake 0.90% Ruby 0.03% Shell 0.28% C++ 77.47% C 7.27% Python 3.93% Objective-C 0.07% Objective-C++ 3.08% Assembly 3.81% Metal 2.67% GLSL 0.46% PowerShell 0.01% Batchfile 0.01%

mnn's Introduction

MNN

中文版本

Build Status

Intro

MNN is a lightweight deep neural network inference engine. It loads models and do inference on devices. At present, MNN has been integrated in more than 20 apps of Alibaba-inc, such as Taobao, Tmall, Youku and etc., covering live broadcast, short video capture, search recommendation, product searching by image, interactive marketing, equity distribution, security risk control and other scenarios. In addition, MNN is also used on embedded devices, such as IoT.

Features

Lightweight

  • Optimized for devices, no dependencies, can be easily deployed to mobile devices and a variety of embedded devices.
  • iOS platform: static library size for armv7+arm64 platforms is about 5MB, size increase of linked executables is about 620KB, and metallib file is about 600KB.
  • Android platform: core so size is about 400KB, OpenCL so is about 400KB, Vulkan so is about 400KB.

Versatility

  • Supports Tensorflow, Caffe, ONNX, and supports common neural networks such as CNN, RNN, GAN.
  • Supports 86 Tensorflow ops, 34 Caffe ops; MNN ops: 71 for CPU, 55 for Metal, 29 for OpenCL, and 31 for Vulkan.
  • Supports iOS 8.0+, Android 4.3+ and embedded devices with POSIX interface.
  • Supports hybrid computing on multiple devices. Currently supports CPU and GPU. GPU op plugin can be loaded dynamically to replace default (CPU) op implementation.

High performance

  • Implements core computing with lots of optimized assembly code to make full use of the ARM CPU.
  • For iOS, GPU acceleration (Metal) can be turned on, which is faster than Apple's native CoreML.
  • For Android, OpenCL, Vulkan, and OpenGL are available and deep tuned for mainstream GPUs (Adreno and Mali).
  • Convolution and transposition convolution algorithms are efficient and stable. The Winograd convolution algorithm is widely used to better symmetric convolutions such as 3x3 -> 7x7.
  • Additional optimizations for the new architecture ARM v8.2 with half-precision calculation support.

Easy to use

  • Efficient image processing module, speeding up affine transform and color space transform without libyuv or opencv.
  • Provides callbacks throughout the workflow to extract data or control the execution precisely.
  • Provides options for selecting inference branch and paralleling branches on CPU and GPU.

Architecture

architecture

MNN can be divided into two parts: Converter and Interpreter.

Converter consists of Frontends and Graph Optimize. The former is responsible for supporting different training frameworks. MNN currently supports Tensorflow, Tensorflow Lite, Caffe and ONNX (PyTorch/MXNet); the latter optimizes graphs by operator fusion, operator substitution, and layout adjustment.

Interpreter consists of Engine and Backends. The former is responsible for the loading of the model and the scheduling of the calculation graph; the latter includes the memory allocation and the Op implementation under each computing device. In Engine and Backends, MNN applies a variety of optimization schemes, including applying Winograd algorithm in convolution and deconvolution, applying Strassen algorithm in matrix multiplication, low-precision calculation, Neon optimization, hand-written assembly, multi-thread optimization, memory reuse, heterogeneous computing, etc.

Quick start

Tools

Customizing

How to use python interface

Feedbacks

Scan QR code to join DingDing discussion group.

License

Apache 2.0

Acknowledgement

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

MNN refers to the following projects:

mnn's People

Contributors

li-qing avatar naville avatar jxt1234 avatar daquexian avatar howave avatar chrisyooh avatar stanleywang8888 avatar nihui avatar codingboo avatar chosungmann avatar sugaryou avatar czy2014hust avatar sunbohong avatar zzz197 avatar zjd1988 avatar zhijl avatar yisongsong avatar yyfcc17 avatar twmht avatar smallt-tao avatar maybeshewill-cv avatar vsooda avatar lifengcai avatar hiigao avatar code-crusher avatar tinyredleaf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.