Skip to main content

A neural network compiler for AI accelerators

Project description

nncase

GitHub repository Gitee repository GitHub release

切换中文

nncase is a neural network compiler for AI accelerators.

Telegram: nncase community Technical Discussion QQ Group: 790699378 . Answer: 人工智能

[TOC]


K230

Install

  • Linux:

    pip install nncase nncase-kpu
    
  • Windows:

    1. pip install nncase
    2. Download `nncase_kpu-2.x.x-py2.py3-none-win_amd64.whl` in below link.
    3. pip install nncase_kpu-2.x.x-py2.py3-none-win_amd64.whl
    

All version of nncase and nncase-kpu in Release.

Supported operators

benchmark test

kind model shape quant_type(If/W) nncase_fps tflite_onnx_result accuracy info
Image Classification mobilenetv2 [1,224,224,3] u8/u8 600.24 top-1 = 71.3%
top-5 = 90.1%
top-1 = 71.1%
top-5 = 90.0%
dataset(ImageNet 2012, 50000 images)
tflite
resnet50V2 [1,3,224,224] u8/u8 86.17 top-1 = 75.44%
top-5 = 92.56%
top-1 = 75.11%
top-5 = 92.36%
dataset(ImageNet 2012, 50000 images)
onnx
yolov8s_cls [1,3,224,224] u8/u8 130.497 top-1 = 72.2%
top-5 = 90.9%
top-1 = 72.2%
top-5 = 90.8%
dataset(ImageNet 2012, 50000 images)
yolov8s_cls(v8.0.207)
Object Detection yolov5s_det [1,3,640,640] u8/u8 23.645 bbox
mAP50-90 = 0.374
mAP50 = 0.567
bbox
mAP50-90 = 0.369
mAP50 = 0.566
dataset(coco val2017, 5000 images)
yolov5s_det(v7.0 tag, rect=False, conf=0.001, iou=0.65)
yolov8s_det [1,3,640,640] u8/u8 9.373 bbox
mAP50-90 = 0.446
mAP50 = 0.612
mAP75 = 0.484
bbox
mAP50-90 = 0.404
mAP50 = 0.593
mAP75 = 0.45
dataset(coco val2017, 5000 images)
yolov8s_det(v8.0.207, rect = False)
Image Segmentation yolov8s_seg [1,3,640,640] u8/u8 7.845 bbox
mAP50-90 = 0.444
mAP50 = 0.606
mAP75 = 0.484
segm
mAP50-90 = 0.371
mAP50 = 0.578
mAP75 = 0.396
bbox
mAP50-90 = 0.444
mAP50 = 0.606
mAP75 = 0.484
segm
mAP50-90 = 0.371
mAP50 = 0.579
mAP75 = 0.397
dataset(coco val2017, 5000 images)
yolov8s_seg(v8.0.207, rect = False, conf_thres = 0.0008)
Pose Estimation yolov8n_pose_320 [1,3,320,320] u8/u8 36.066 bbox
mAP50-90 = 0.6
mAP50 = 0.843
mAP75 = 0.654
keypoints
mAP50-90 = 0.358
mAP50 = 0.646
mAP75 = 0.353
bbox
mAP50-90 = 0.6
mAP50 = 0.841
mAP75 = 0.656
keypoints
mAP50-90 = 0.359
mAP50 = 0.648
mAP75 = 0.357
dataset(coco val2017, 2346 images)
yolov8n_pose(v8.0.207, rect = False)
yolov8n_pose_640 [1,3,640,640] u8/u8 10.88 bbox
mAP50-90 = 0.694
mAP50 = 0.909
mAP75 = 0.776
keypoints
mAP50-90 = 0.509
mAP50 = 0.798
mAP75 = 0.544
bbox
mAP50-90 = 0.694
mAP50 = 0.909
mAP75 = 0.777
keypoints
mAP50-90 = 0.508
mAP50 = 0.798
mAP75 = 0.54
dataset(coco val2017, 2346 images)
yolov8n_pose(v8.0.207, rect = False)
yolov8s_pose [1,3,640,640] u8/u8 5.568 bbox
mAP50-90 = 0.733
mAP50 = 0.925
mAP75 = 0.818
keypoints
mAP50-90 = 0.605
mAP50 = 0.857
mAP75 = 0.666
bbox
mAP50-90 = 0.734
mAP50 = 0.925
mAP75 = 0.819
keypoints
mAP50-90 = 0.604
mAP50 = 0.859
mAP75 = 0.669
dataset(coco val2017, 2346 images)
yolov8s_pose(v8.0.207, rect = False)

Demo

eye gaze space_resize face pose
gif gif

K210/K510

Supported operators


Features

  • Supports multiple inputs and outputs and multi-branch structure
  • Static memory allocation, no heap memory acquired
  • Operators fusion and optimizations
  • Support float and quantized uint8 inference
  • Support post quantization from float model with calibration dataset
  • Flat model with zero copy loading

Architecture

nncase arch

Build from source

It is recommended to install nncase directly through pip. At present, the source code related to k510 and K230 chips is not open source, so it is not possible to use nncase-K510 and nncase-kpu (K230) directly by compiling source code.

If there are operators in your model that nncase does not yet support, you can request them in the issue or implement them yourself and submit the PR. Later versions will be integrated, or contact us to provide a temporary version. Here are the steps to compile nncase.

git clone https://github.com/kendryte/nncase.git
cd nncase
mkdir build && cd build

# Use Ninja
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
ninja && ninja install

# Use make
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
make && make install

Resources

Canaan developer community

Canaan developer community contains all resources related to K210, K510, and K230.

  • 资料下载 --> Pre-compiled images available for the development boards corresponding to the three chips.
  • 文档 --> Documents corresponding to the three chips.
  • 模型库 --> Examples and code for industrial, security, educational and other scenarios that can be run on the K210 and K230.
  • 模型训练 --> The model training platform for K210 and K230 supports the training of various scenarios.

Bilibili

K210 related repo

K230 related repo


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

nncase-2.8.3-cp310-cp310-win_amd64.whl (19.8 MB view details)

Uploaded CPython 3.10 Windows x86-64

nncase-2.8.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

nncase-2.8.3-cp310-cp310-macosx_10_15_x86_64.whl (25.5 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

nncase-2.8.3-cp39-cp39-win_amd64.whl (19.8 MB view details)

Uploaded CPython 3.9 Windows x86-64

nncase-2.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

nncase-2.8.3-cp39-cp39-macosx_10_15_x86_64.whl (25.5 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

nncase-2.8.3-cp38-cp38-win_amd64.whl (19.8 MB view details)

Uploaded CPython 3.8 Windows x86-64

nncase-2.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

nncase-2.8.3-cp38-cp38-macosx_10_15_x86_64.whl (25.5 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

nncase-2.8.3-cp37-cp37m-win_amd64.whl (19.8 MB view details)

Uploaded CPython 3.7m Windows x86-64

nncase-2.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.6 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

nncase-2.8.3-cp37-cp37m-macosx_10_15_x86_64.whl (25.5 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

Details for the file nncase-2.8.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: nncase-2.8.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 19.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for nncase-2.8.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5301b02f6c4ec8cc18c04a3b0cf10ac1665a4d56981b3fb1010775944241b132
MD5 0111a2c00ac781d9410b853e46d8f84b
BLAKE2b-256 e040da3ae9e8f0a9ec5fa8a4925ac8cab35684ae8243f7847392a87903e66be2

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c437e80ea50c0edf368f2225567b4b6a15c64d9e97d7cb2e79ceb9b84da2358
MD5 920ca6e7a916e9014d7f1da1338bf904
BLAKE2b-256 d4dff5411e397b05240c3525ae83118571d8e95da8c0e4ca19479b669a7f96fc

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b4cb8a8dc70c252b8df395165b2b7d843cb13c33ef59d4fbb0ca868029ca8443
MD5 3c4a32c14c448e6fafb134287b6b0aa8
BLAKE2b-256 2d1174c9f78b7bf364ca28cc267a2798e473dabd25f760330af36f32e800ae0a

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: nncase-2.8.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 19.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for nncase-2.8.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ac8a75c5b818a2f22d066a0867439788c60f7a240f4df79db537712e89741766
MD5 6ae2a8e0e480a28b6bb1b7fced2af943
BLAKE2b-256 23c22749f6bfc670a389be3181de067b1304dfb621336527fcdfb9666742d850

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c985092dd0913f24841592a6a0d16bb9bcb9742af2ff7acff9aeff35e1da5606
MD5 0cb675765d09072ce45e270456a42a73
BLAKE2b-256 6963917ecd998c31ebed96ac50c03f34d53d5b799ea8dc673a1acfa7ae9504be

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 643c5966e1dd75c6063fdac6f9be0279a0ef7cf89cb72dd36b447b63c4aa7f95
MD5 f8e3c34c9e7de0035a42d27377498594
BLAKE2b-256 e2fcc63b776a49856193f2a31275771b9b0feaf279d85f76c67fdfc33c8616f9

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: nncase-2.8.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 19.8 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for nncase-2.8.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 dd7b3bf43a5f2c91e5677b3a7634360c7985cea21e1673fcf2101250f1803c35
MD5 cedd60524ec7f91a5252b160707139a7
BLAKE2b-256 059f185a20b68f4e70f495715a43ca438d3c3376f1583c622a54fd78caffbb73

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f8b73dc3a8758e1f38abee25ffed79f4ce5e23bdf7df3a9f8455ca781df6580
MD5 aa2b873ce7ae98464344d6f81d21af71
BLAKE2b-256 2f8b9f669a2a10f19f0f9729a6aad18cfa0c2ebe727134268eb706e59e6bde23

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 90025ee866e9e17d6ed6f333089a72a5a51857c814db8d90c5a0a15b0d2aaa71
MD5 d50c9e19b0eb284ad2b1b47bdd6bcfbd
BLAKE2b-256 2e5badd8d31ec98b57906108a4dc93ef392fb1fe4ff884a3d4462743df1ac51e

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: nncase-2.8.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 19.8 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.5

File hashes

Hashes for nncase-2.8.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4470093b5c9a56258129410681653a49ca07ba88ab84150981634a090ebb3e8a
MD5 cee3fad81a5bde3dd5df2565b38c2cce
BLAKE2b-256 6fa72300ae7f39ca36daf41e35f1cb3fcb8440f7e777e4f02f1fe278a83831bb

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 902e14f2b7bbee823232393162180726baa85156ce211a233f7c58cfba926f7f
MD5 bb6aef5e8ae3c6ba7558d87b1ade566a
BLAKE2b-256 a978ed56386e42d25797abcf66512ef4c03f2c43f52e1ce2f727327493fff148

See more details on using hashes here.

Provenance

File details

Details for the file nncase-2.8.3-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for nncase-2.8.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 52bb207ae55de7a711583c932598c4e28a770fca4b365a8f997e410246c3a4ca
MD5 ae4b4f2aba667e308ffcb272f61be58d
BLAKE2b-256 37708261279fa990e5a1894e03adca9ab0581456ad09486229117f16ac212b26

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page