deepC

ai-techsystemsApache-2.0长期未更新

面向单片机和微型计算机的轻量级深度学习库与推理框架,自带编译器,不绑定芯片厂商,可在 ESP32、Arduino 等边缘设备上跑模型。

vendor independent TinyML deep learning library, compiler and inference framework microcomputers and micro-controllers

v0.12发布于 2019-11-19 05:29 UTC605star93fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
pip install deepC
硬件要求按 README 说明

README 未给出显存或具体芯片型号要求,仅说明面向微控制器、eFPGA、CPU、树莓派、Arduino、RISC-V 等小尺寸设备,并列出支持的 CPU 架构与操作系统。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

面向微控制器与边缘设备的厂商无关 TinyML 深度学习库、编译器与推理框架

面向单片机和微型计算机的轻量级深度学习库与推理框架,自带编译器,不绑定芯片厂商,可在 ESP32、Arduino 等边缘设备上跑模型。

核心能力

  • 以 ONNX 为前端接入模型
  • 基于 LLVM 工具链做提前编译生成优化可执行文件
  • 用高层图 IR 表示并优化网络、融合算子
  • 支持 Arm、Armv7、Arm64、AMD64、ppc64le 架构
  • 覆盖 Ubuntu、CentOS、Arch、Windows、macOS 等系统

容易踩的坑

源码构建依赖 ONNX 1.5、LLVM 8.0、Python 3.6、SWIG 3.0 等指定版本,版本不符容易失败;macOS 与 Windows 需先装 Docker 并在容器内构建;模型需先转为 ONNX 格式才能编译。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

1 个版本v0.12
  1. v0.122019.12最新正式版2019-11-19 · 2019-11-19 05:29 UTC

    deepC 0.12 is now available!

    We would like to thank everybody who has contributed to this release. You may learn more about the project, who is involved and what tools are available at the bit.ly/dnnCompiler

    Features

    Python 3.5+

    deepC is available as python extension in python 3.5, 3.7, 3.7 and 3.8. with exhaustive support for all Python operators. deepC extension works behind the scenes to understand user intent with implicit conversion engine and broadcasting mechanism to carry out pythonic operations.

    Compiler

    Compiler is available on x86, x86_64 and arm platform.

    C++ 17

    Available C++ operators are compatible with C++ 2017 standard.

    onnx 1.5.0

    onnx parser supports onnx IR4 and onnx IR5.

    Operators List

    1. Abs
    2. Acos
    3. Acosh
    4. Add
    5. And
    6. ArgMax
    7. ArgMin
    8. Asin
    9. Asinh
    10. Atan
    11. Atanh
    12. baseOperator
    13. BitShift
    14. BitwiseAnd
    15. BitwiseOr
    16. BitwiseXor
    17. Ceil
    18. Clip
    19. Constant
    20. Conv
    21. Cos
    22. Cosh
    23. DequantizeLinear
    24. Div
    25. Dropout
    26. Elu
    27. Equal
    28. Erf
    29. Expand
    30. Exp
    31. EyeLike
    32. Flatten
    33. FloorDiv
    34. Floor
    35. Gather
    36. Gemm
    37. GlobalAveragePool
    38. GlobalLpPool
    39. GlobalMaxPool
    40. GreaterEqual
    41. Greater
    42. Hardmax
    43. HardSigmoid
    44. Identity
    45. InstanceNormalization
    46. IsInf
    47. IsNaN
    48. LeakyRelu
    49. LessEqual
    50. Less
    51. Log
    52. LogSoftmax
    53. LpNormalization
    54. LRN
    55. LSTM
    56. MatMul
    57. MatMulInteger
    58. Max
    59. Mean
    60. Min
    61. Mod
    62. Mul
    63. Neg
    64. NotEqual
    65. Not
    66. OneHot
    67. Or
    68. Pad
    69. Pow
    70. PRelu
    71. Reciprocal
    72. Relu
    73. Remainder
    74. Reshape
    75. SetSlice
    76. Sigmoid
    77. Sign
    78. Sin
    79. Sinh
    80. Slice
    81. Softmax
    82. Softplus
    83. Softsign
    84. Sqrt
    85. Sub
    86. Tan
    87. Tanh
    88. ThresholdedRelu
    89. Transpose
    90. TrueDiv
    91. Where
    92. Xor

    Platforms

    This is first release tested on most linux platforms including raspberry-pi, android and others. It is tested on 4 different platforms and architectures.

    1. os: linux
      1. dist: bionic
      2. arch: amd64
    2. os: linux
      1. dist: bionic
      2. arch: ppc64le
    3. os: linux
      1. dist: bionic
      2. arch: armv7
    4. os: linux
      1. dist: bionic
      2. arch: arm

    Change Log

    BUG Fixes

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    deepC

    PyPI version Downloads Apache2.0 License Contributors Chat

    The deepC is a vendor independent deep learning library, compiler and inference framework designed for small form-factor devices including μControllers, IoT and Edge devices

    🏃‍♂️ Using deepC

    Here are few of many ways.

    1. Try deepC with Colab Noteboook
    2. Install it on Ubuntu, raspbian (or any other debian derivatives) using pip install deepC
    3. Compile onnx model- read this article or watch this video
    4. Use deepC with a Docker File

    See more examples in tutorial dir.

    📛 what is deepC?

    deepC library, compiler and inference framework is designed to enable and perform deep learning neural networks by focussing on features of small form-factor devices like micro-controllers, eFPGAs, cpus and other embedded devices like raspberry-pi, odroid, arduino, SparkFun Edge, risc-V, mobile phones, x86 and arm laptops among others.

    edge Devices

    deepC also offers ahead of time compiler producing optimized executable based on LLVM compiler tool chain specialized for deep neural networks with ONNX as front end.

    📝 Design

    Main components of deepC have been designed to represent and optimize the common deep learning networks in high level graph IR and to transform the computation graph to minimize memory utilization, optimize data layout and fuse computation patterns for different hardware backends.

    Read more at high level design document

    💧 PreRequisites

    💻 Development

    Build and start modifying deepC locally from source code with following steps

    ⭕ Ubuntu 18.04

    Follow the steps to install pre-requisites

    sudo apt-get update
    sudo apt-get install build-essential python3.6-dev python3-pip swig doxygen clang-format clang clang-8 llvm-8 llvm-8-dev protobuf-compiler libprotoc-dev
    sudo pip3 install numpy==1.15.0 onnx==1.5.0
    

    Once you are done, build deepC

    git clone https://github.com/ai-techsystems/deepC.git
    cd deepC
    make
    

    ⭕ Mac OS / Windows 10

    Make sure you have the below pre-requisites

    Mac OS:
    Windows 10:

    Once you are done, build deepC inside docker container

    git clone https://github.com/ai-techsystems/deepC.git
    cd deepC
    python buildDocker.py
    
    📜 Output
    find include src swig -name \*.h -print0 -o -name \*.cpp -print0 | xargs -0 -P8 -n1 clang-format -i
    make -C src
    make[1]: Entering directory 'deepC/src'
    make -C core
    make[2]: Entering directory 'deepC/src/core'
    compiling broadcast.cpp
    /usr/bin/g++ -O3 -Wall -std=c++14 -fPIC -march=native -msse2 \
        -isystem ./packages/eigen-eigen-323c052e1731 -I./include \
        -c broadcast.cpp -o obj/broadcast.o
    compiling tensor.cpp
    ...
    ...
    /usr/bin/g++ -shared  ./obj/dnnc_swig.o ./obj/dnnc_pyutils.o ./obj/dnnc_api.o -o lib/libdnnc.so
    ln -s -f lib/libdnnc.so _dnnc.so
    /usr/bin/python3 ../test/swig/basic.py
    

    Current Support

    Supported ArchitecturesStatus
    Arm✔️
    Armv7✔️
    Arm64✔️
    AMD64✔️
    ppc64le✔️
    Supported OSDistributionsStatus
    LinuxUbuntu 18.04✔️
    LinuxCentOS 6✔️
    LinuxArch Linux✔️
    LinuxManjaro✔️
    Windows1803 and above✔️
    Mac OSSierra and above✔️

    ➕ Contribute

    dnn Compiler adopts apache committer model, we aim to create an open source project that is maintained and owned by the community. Checkout the Contributor Guide.

    🙏 Acknowledgement

    We acknowledge the efforts predecessor projects like LLVM, ONNX etc. to make this project a reality.


    🕵️‍♂️ Why compiler❔

    deepC is targeted towards devices with small formfactor like microcontrollers, which are part of all sorts of household devices: think appliances, cars, and toys. In fact, there are around 30 billion microcontroller-powered devices produced each year. They're cheap, require very little energy, and are very reliable.

    By bringing deep learning models to tiny microcontrollers, we can boost the intelligence of billions of devices that we use in our lives, without relying on expensive hardware or reliable internet connections. Imagine smart appliances that can adapt to your daily routine, intelligent industrial sensors that understand the difference between problems and normal operation, and magical toys that can help kids learn in fun and delightful ways.

    Organizations

    Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]


    Built on/with deepC

    Products

    1. No code TinyML platform, built with deepC technology.
    2. No code TinyML Book, with a chapter on deepC.

    Papers

    Paper Citations

    Book Chapter

    1. deepC Chapter in book Introduction to TinyML, available on Amazon and other retailers