Tencent/ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform

What it solves

ncnn provides a high-performance framework for running (inferencing) deep learning models on resource-constrained environments. It enables developers to take models trained in frameworks like PyTorch and deploy them efficiently on mobile phones, embedded systems, desktop computers, and web browsers without requiring heavy third-party runtime dependencies.

How it works

The framework uses a two-part approach: a conversion tool (pnnx) and a lightweight inference engine. Developers first convert their PyTorch or ONNX models into the ncnn format using pnnx. Once converted, the ncnn engine—which supports both CPU and Vulkan GPU acceleration—loads these models to perform inference. It is designed to be self-contained, meaning it does not rely on external runtime libraries, making it highly portable across various hardware architectures.

Who it’s for

This project is for software engineers and machine learning practitioners who need to deploy AI models on edge devices, mobile apps, or desktop applications where performance and minimal dependencies are critical. It is widely used in production environments, including major applications like WeChat and QQ.

Highlights

  • High-performance inference optimized for mobile, embedded, and desktop platforms.
  • Zero third-party runtime dependencies for easier integration.
  • Dual-backend support utilizing both CPU and Vulkan GPU acceleration.
  • Includes pnnx for seamless conversion from PyTorch and ONNX models.
  • Broad hardware support, including Android, iOS, Windows, Linux, macOS, WebAssembly, and various edge computing platforms.

Related

  • Project
  • Project
  • Project
  • Project
  • Project