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.2-cp310-cp310-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.10 Windows x86-64

nncase-2.8.2-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.2-cp310-cp310-macosx_10_15_x86_64.whl (25.4 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

nncase-2.8.2-cp39-cp39-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

nncase-2.8.2-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.2-cp39-cp39-macosx_10_15_x86_64.whl (25.4 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

nncase-2.8.2-cp38-cp38-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

nncase-2.8.2-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.2-cp38-cp38-macosx_10_15_x86_64.whl (25.4 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

nncase-2.8.2-cp37-cp37m-win_amd64.whl (19.7 MB view details)

Uploaded CPython 3.7m Windows x86-64

nncase-2.8.2-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.2-cp37-cp37m-macosx_10_15_x86_64.whl (25.4 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: nncase-2.8.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 19.7 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 47053a1ee050d83ec88159e0a4ab8883b9fcdaad67c20c875a8acb688e2203d1
MD5 d4d7ebb9435a665a77f5e2801b274e59
BLAKE2b-256 bcb25befbcb9eaa1d1aace53fafd9173825201502a6cb2b215d3f656702ef271

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a3887dc993fe4f53ef6e30e8f211f0dcc7175fe410312fc672c5b171110783eb
MD5 469696012b2e2a2ff89b1fc454402ffb
BLAKE2b-256 7c4bc5add1f24f40f533b6f5066726432dd2e866bf7082130935537cd0a07e85

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0e54a8347bbc4b44d0789b936046fc06851dd182225f863110db0f33387d369b
MD5 95af30e4587fb4f95c4f9d644ea5cff5
BLAKE2b-256 6a4ac691f0ef5c8387050a2b3dfadd777d2b478d9f8b92630b0ccbe2b9784fdf

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: nncase-2.8.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 19.7 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.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 36bcae63c476a96732cb006c3cfe043dca8aece651004a3299367ec3620caab5
MD5 e9b16c649bd39d5f468a5e805c800471
BLAKE2b-256 0fc65621c9c6af6c46193bc7a469c7213eb87866f013cdb6175defd15361d310

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c31dd645ee8f290145bcad679bbc31d8b40ae3f445d8e150e1ae08e0ae9bfae7
MD5 97b513027b6098f966f18aa518a7af99
BLAKE2b-256 6021b0258e397b06063309c559a62c4b66b685f0b287f992b905ab7e2838ce25

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6826d3b6de3e7393193844924f81c905025e37b46b1647bd3e55b91da4ffe4dc
MD5 4e8e561b71139d3eb908170ed68914da
BLAKE2b-256 265f58d960f44acf75423812422fcc9624e1382f0b97106f56d61d71bc4e718f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: nncase-2.8.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 19.7 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.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c6de19ba197128e98e6c153aacfd2e96a082a87fc17712a0b05869459be92ee0
MD5 998d87d58a7f92f741ae335ba01902d2
BLAKE2b-256 ae141d62ec0df8b54e79ddf3f4d6f5e33013bb78dda045d04676a2bf07f3632a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38b26a473d2a9e7ba84e75ed49e7d8a4272c21011675157f14ca6b4a91612d28
MD5 63445b2af41be3c3395f412ef100ce60
BLAKE2b-256 de9732b57cbf753b4a4b2316d91442cec986d12a54e9ae0c25ccc302df054861

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fc2c52af37f641ea1594fd1447baca6fec2e82d4b8a268c75f5f874880b22dac
MD5 72380a2bcf82bd94b0b6d5c183de89bc
BLAKE2b-256 31b2df76cb45c8915a215c8cfc4d1546cee61ca4047d030e139824c85e0b449d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: nncase-2.8.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 19.7 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.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1815eb4820ded103995003de433f480c3e0d19adf433c4a9552b30200d1c6924
MD5 3160371197bdc7121f73b9681b673c2c
BLAKE2b-256 a794569cd0559086035d3cf538281c5b5e602822f5b733f25ab95db781fddf6c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 436e6688f87cd94a5575b33273fb95bec09839cbb96ca10479bf3df2fb0b17f3
MD5 77e1586d708eae734d4c40226079479e
BLAKE2b-256 2d40a8fc5f7088dd151becfea845c4c70a37712aaf9d4c2aa311ab9e021a18ad

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for nncase-2.8.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 45325285288bf023e13679fe7fb076495115ee2500f918575be982df0ac51d48
MD5 ef323254a3acc2ded8426671efb92ca1
BLAKE2b-256 1524a54782906105d11887f04014a99d8e1a811ba8ce7290605dd8c4c0b4ff44

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