Home

Awesome

Introduction


License: MIT

Bolt is a light-weight library for deep learning. Bolt, as a universal deployment tool for all kinds of neural networks, aims to automate the deployment pipeline and achieve extreme acceleration. Bolt has been widely deployed and used in many departments of HUAWEI company, such as 2012 Laboratory, CBG and HUAWEI Product Lines. If you have questions or suggestions, you can submit issue. QQ群: 833345709

Why Bolt is what you need?


See more excellent features and details here

Building Status


There are some common used platform for inference. More targets can be seen from scripts/target.sh. Please make a suitable choice depending on your environment. If you want to build on-device training module, you can add --train option. If you want to use multi-threads parallel, you can add --openmp option. If you want to build for cortex-M or cortex-A7 with restricted ROM/RAM(Sensor, MCU), you can see docs/LITE.md.

Bolt defaultly link static library, This may cause some problem on some platforms. You can use --shared option to link shared library.

target platformprecisionbuild commandLinuxWindowsMacOS
Android(armv7)fp32,int8./install.sh --target=android-armv7Build StatusBuild StatusBuild Status
Android(armv8)fp32,int8./install.sh --target=android-aarch64 --fp16=offBuild StatusBuild StatusBuild Status
Android(armv8.2+)fp32,fp16,int8,bnn./install.sh --target=android-aarch64Build StatusBuild StatusBuild Status
Android(armv9)fp32,fp16,bf16,int8,bnn./install.sh --target=android-aarch64_v9Build StatusBuild StatusBuild Status
Android(gpu)fp16./install.sh --target=android-aarch64 --gpuBuild StatusBuild StatusBuild Status
Android(x86_64)fp32,int8./install.sh --target=android-x86_64Build StatusBuild StatusBuild Status
iOS(armv7)fp32,int8./install.sh --target=ios-armv7//Build Status
iOS(armv8)fp32,int8./install.sh --target=ios-aarch64 --fp16=off//Build Status
iOS(armv8.2+)fp32,fp16,int8,bnn./install.sh --target=ios-aarch64//Build Status
Linux(armv7)fp32,int8./install.sh --target=linux-armv7_blankBuild Status//
Linux(armv8)fp32,int8./install.sh --target=linux-aarch64_blank --fp16=offBuild Status//
Linux(armv8.2+)fp32,fp16,int8,bnn./install.sh --target=linux-aarch64_blankBuild Status//
Linux(x86_64)fp32,int8./install.sh --target=linux-x86_64Build Status//
Linux(x86_64_avx2)fp32./install.sh --target=linux-x86_64_avx2Build Status//
Linux(x86_64_avx512)fp32,int8./install.sh --target=linux-x86_64_avx512Build Status//
Windows(x86_64)fp32,int8./install.sh --target=windows-x86_64/Build Status/
Windows(x86_64_avx2)fp32./install.sh --target=windows-x86_64_avx2/Build Status/
Windows(gpu)fp16./install.sh --target=windows-x86_64_avx2 --gpu --fp16=on/Build Status/
Windows(x86_64_avx512)fp32,int8./install.sh --target=windows-x86_64_avx512/Build Status/
Windows(armv8.2+)fp32,fp16,int8,bnn./install.sh --target=windows-aarch64//Build Status
MacOS(x86_64)fp32,int8./install.sh --target=macos-x86_64//Build Status
MacOS(x86_64_avx2)fp32./install.sh --target=macos-x86_64_avx2//Build Status
MacOS(x86_64_avx512)fp32,int8./install.sh --target=macos-x86_64_avx512//Build Status
MacOS(armv8.2+)fp32,fp16,int8,bnn./install.sh --target=macos-aarch64//Build Status

Quick Start


<div align=center><img src="docs/images/QuickStart.jpg" width = 100% height = 100% style="border: 1px solid rgba(151,151,151,0.50)" /></div> Two steps to get started with bolt.
  1. Conversion: use X2bolt to convert your model from caffe, onnx, tflite or tensorflow to .bolt file;

  2. Inference: run benchmark with .bolt and data to get the inference result.

    For more details about the usage of X2bolt and benchmark tools, see docs/USER_HANDBOOK.md.

DL Applications in Bolt

Here we show some interesting and useful applications in bolt.

<center>Image Classification</br>android ios</center><center>Face Detection</br>ios exe</center><center>Pose Detection</br>android</center>
<img src="docs/images/ImageClassification.gif" width = 50% height = 20% /><img src="docs/images/FaceDetection.gif" width = 70% height = 30% /><img src="docs/images/PoseDetect.gif" width = 50% height = 22% />
<center>Semantics Analysis</br>android</center><center>Reading Comprehension</br>android</center><center>Chinese Speech Recognition</br>android ios</center>
<img src="docs/images/SemanticsAnalysis.gif" width = 45% height = 20% /><img src="docs/images/ReadingComprehension.gif" width = 45% height = 20% /><img src="docs/images/ChineseSpeechRecognition.gif" width = 50% height = 20% />

Verified Networks


Bolt has shown its high performance in the inference of common CV, NLP and Recommendation neural networks. Some of the representative networks that we have verified are listed below. You can find detailed benchmark information in docs/BENCHMARK.md.

<table border="1" bordercolor="#00CCCC" width="300"> <tr> <td> Application </td> <td> Models </td> </tr> <tr> <td> CV </td> <td> Resnet50, Shufflenet, Squeezenet, Densenet, Efficientnet, Mobilenet_v1, Mobilenet_v2, Mobilenet_v3, <a href="https://github.com/liuzechun/Bi-Real-net">BiRealNet</a>, <a href="https://github.com/liuzechun/ReActNet">ReActNet</a>, <a href="https://github.com/huawei-noah/ghostnet">Ghostnet</a>, <a href="https://github.com/milesial/Pytorch-UNet">unet</a>, LCNet, Pointnet, <a href="https://github.com/thangtran480/hair-segmentation">hair-segmentation</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/duc">duc</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/fcn">fcn</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/retinanet">retinanet</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/ssd">SSD</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/faster-rcnn">Faster-RCNN</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/faster-rcnn">Mask-RCNN</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/yolov2-coco">Yolov2</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/tiny-yolov3">Yolov3</a>, <a href="https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/yolov4">Yolov4</a>, <a href="https://github.com/ultralytics/yolov5">Yolov5</a>, ViT, TNT, RepVGG, VitAE, CMT, EfficientFormer ... </td> </tr> <tr> <td> NLP </td> <td> Bert, Albert, Tinybert, Neural Machine Translation, Text To Speech(Tactron,Tactron2,FastSpeech+hifigan,melgan), Automatic Speech Recognition, DFSMN, Conformer, <a href="docs/USER_HANDBOOK.md#voice-wake-up">Tdnn</a>, <a href="https://tfhub.dev/google/lite-model/nonsemantic-speech-benchmark/frill-nofrontend/1">FRILL</a>, <a href="https://github.com/onnx/models/tree/master/text/machine_comprehension/t5">T5</a>, <a href="https://github.com/onnx/models/tree/master/text/machine_comprehension/gpt-2">GPT-2</a>, <a href="https://github.com/onnx/models/tree/master/text/machine_comprehension/roberta">Roberta</a>, Wenet ... </td> </tr> <tr> <td> Recommendation </td> <td> NFM, AFM, ONN, wide&deep, DeepFM, MMOE </td> </tr> <tr> <td> More DL Tasks </td> <td> ... </td> </tr> </table>

More models than these mentioned above are supported, users are encouraged to further explore.

On-Device Training


On-Device Training has come, it's a beta vesion which supports Lenet, Mobilenet_v1 and Resnet18 for training on the embedded devices and servers. Want more details of on-device training in bolt? Get with the official training tutorial.

Documentations


Everything you want to know about bolt is recorded in the detailed documentations stored in docs.

Articles


教程


Acknowledgement


Bolt refers to the following projects: caffe, onnx, tensorflow, ncnn, mnn, dabnn.

License


The MIT License(MIT)