Skip to content
/ MegCC Public
forked from MegEngine/MegCC

MegCC是一个运行时超轻量,高效,移植简单的深度学习模型编译器

License

Notifications You must be signed in to change notification settings

kqyhappy/MegCC

 
 

Repository files navigation

logo

Chinese README

What is MegCC

MegCC is a deep-learning model compiler with the following features:

  • Extremely Lightweight Runtime: Only keep the required computation kernel in your binary. e.g., 81KB runtime for MobileNet v1
  • High Performance: Every operation is carefully optimized by experts
  • Portable: generate nothing but computation code, easy to compile and use on Linux, Android, TEE, BareMetal
  • Low Memory Usage while Boot Instantly: Model optimization and memory planning are generated at compile time. Get State-of-the-art level memory usage and spend no extra CPU during inference

MegCC Structure

megcc_struct

MegCC compiler is developed based on MLIR infrastructure. Most of the code generated by the compiler is optimized by hand. MegCC supports neural networks that contain tensors in static shape or dynamic shape. To help achieve the minimum binary size, it also supports generating the necessary CV operators so that you don't need to link another giant CV lib.

When compiling a model:

  • MegCC generates both the kernels used by the model and user-required CV kernels
  • MegCC does several optimizations, such as static memory planning and model optimization
  • MegCC dumps the data above into the final model

MegCC runtime loads the model and uses the generated kernels to finish the model inference. Only 81KB binary size is required to inference MobileNetV1 (in fp32).

MegCC supports Arm64/ArmV7/X86/BareMatal backend. You may want to check supported operator lists.

Documentation

Get MegCC

How to use MegCC

  • Read how-to-use to see how to compile your models and deploy them,also there is a Chinese doc 如何使用.
  • MegCC runtime is easy to run in standard OS, even no OS(example).

License

MegCC is licensed under the Apache License, Version 2.0

Thanks a lot, please enjoy it

About

MegCC是一个运行时超轻量,高效,移植简单的深度学习模型编译器

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 76.8%
  • C 18.5%
  • Python 1.9%
  • CMake 1.5%
  • Shell 0.6%
  • MLIR 0.6%
  • Other 0.1%