Evolvable programming language -- evo
Item | Type | Lang | Company | Platform | Targets | Main Func | Main Opt |
---|---|---|---|---|---|---|---|
TinyMaix | Infer | C | Sipeed | MCU | SSE NEON CSKYV2 RV32P | Inline Asm, | |
CMSIS-NN | |||||||
TinyEngine | Infer | C | MCU | ||||
ORT | Infer | C++ | Microsoft | PC, Server | SSE AVX NEON CUDA | Inline Asm, | |
microTVM | Infer | C++ | Apache | Paper | |||
TFLM | Infer | C++ | MCU Arm(Cortex-M), Hexagon, RISC-V, Xtensa | ??? | ??? | ??? | |
NCNN | Infer | C/C++ | Tencent | Phone | |||
CoreML | Train & Infer | Swift | Apple | IPhone Arm(Cortex-M) | Metal | ??? | ??? |
MNN | Train & Infer | C++ | Alibaba | Phone Arm(Cortex-M/A) | SSE AVX NEON Metal HIAI OpenCL Vulkan CUDA Metal | Convert, Compress, Express, Train, CV | Inline Asm, Winograd Conv, FP16 |
MindSpore | Train & Infer | C++/Python | HuaWei? | All? |
性能:
大模型全栈架构图:
推理引擎架构:
端侧部署:
AI部署平台细分:
PlatformLevel | AI-Box | AI-Camera | AIoT | TinyML |
---|---|---|---|---|
Storage Media | eMMC/SSD | eMMC/Nand/Nor | Nor/SIP Flash | Nor/SIP Flash |
Storage Size | >=8GB | 16MB~8GB | 1~16MB | 16KB~16MB |
Memory Media | DDR4 | mostly DDR3 | SRAM/PSRAM | SRAM/PSRAM |
Memory Size | >=2GB | 64MB~2GB | 0.5~64MB | 2KB~8MB |
CPU Freq | >=1.5G | 0.5~1.5G | 100~500M | 16~500M |
Computing Power | >=2TOPS | 0.2~1TOPS | 50~200GOPS | <1GOPS |
Deploy Language | python/c++ | python/c++ | mpy/C | mostly C |
Typical Device | JetsonNano | RV1109 IPC | BL808/K210 | ESP32/BL618 |
Typical Board Price | >$100 | $20~$100 | $5~$20 | <$5 |
Typical Chip Price | >$10 | $4~$10 | $2~$5 | $1~$3 |
兼容性与性能之间平衡:
.onnx
来提升框架兼容性,将读入后的模型压缩为自定义的运行时模型,降低运行时内存开销(使用flatbuffer
);TinyMaix
, TFLM
, ORT
, microTVM
)在边缘侧推理的指标.onnx
, .tflite
)、MLPerf测试Pynq-Z2 | PC | |
---|---|---|
CPU | ARM Cortex A9 |
TFLM(TensorFlow Lite for Microcontrollers)自称其运行时(runtime)在 Cortex M3 上仅需 16KB,可以直接在“裸机”上运行,不需要操作系统支持。
参考:
TFLM 使用 Bazel 构筑工具(Google的构筑工具,基于JRM的,较难用)
# 下载可执行文件
wget https://github.com/bazelbuild/bazel/releases/download/7.2.1/bazel-7.2.1-linux-x86_64
# 移动到/usr/local/bin
sudo cp ./bazel-7.2.1-linux-x86_64 /usr/local/bin/bazel
# 更新环境变量
source ~/.bashrc
# 检查版本
bazel --version
Bazel 中的配置文件:
WORKSPACE
:含有该文件的目录将会被视为根目录BUILD
:含有该构建规则文件的目录被视为项目的一个模块
git clone https://github.com/tensorflow/tflite-micro.git
cd tflite-micro
# 查看构建规则
cat BUILD
# 构筑 micro 工具链:无效
bazel build
# 这个管用
make -f tensorflow/lite/micro/tools/make/Makefile TARGET=linux TARGET_ARCH=x86_64 microlite
在qemu
进行模拟测试:
./tensorflow/lite/micro/tools/ci_build/test_cortex_m_qemu.sh
TinyEngine
git clone --recursive https://github.com/mit-han-lab/tinyengine.git
conda create -n tinyengine python=3.6 pip
conda activate tinyengine
cd tinyengine
pip install -r requirements.txt
git clone https://github.com/sipeed/TinyMaix.git
cd TinyMaix
mkdir build
cd build
cmake ..
make
cd examples/cifar10
mkdir build
cd build
cmake ..
make
./cifar10
model | cifar10 | total |
---|---|---|
Mem | ||
Time | ||
Deploy | easy |
参考: