Skip to main content
QUICK REVIEW

[Paper Review] daBNN: A Super Fast Inference Framework for Binary Neural Networks on ARM devices

Jianhao Zhang, Yingwei Pan|arXiv (Cornell University)|Aug 16, 2019
Advanced Neural Network ApplicationsComputer Science10 citations
TL;DR

daBNN is a highly optimized, open-source inference framework for Binary Neural Networks (BNNs) on ARM devices, leveraging custom bit-packing, binary direct convolution, and memory layout optimizations in C++ and ARM assembly. It achieves 7×–23× faster inference than BMXNet and 8×–10× faster than TensorFlow Lite on single binary convolutions, with a 30% speedup on Bi-Real Net 18 via architectural improvements made possible by its high efficiency.

ABSTRACT

It is always well believed that Binary Neural Networks (BNNs) could drastically accelerate the inference efficiency by replacing the arithmetic operations in float-valued Deep Neural Networks (DNNs) with bit-wise operations. Nevertheless, there has not been open-source implementation in support of this idea on low-end ARM devices (e.g., mobile phones and embedded devices). In this work, we propose daBNN --- a super fast inference framework that implements BNNs on ARM devices. Several speed-up and memory refinement strategies for bit-packing, binarized convolution, and memory layout are uniquely devised to enhance inference efficiency. Compared to the recent open-source BNN inference framework, BMXNet, our daBNN is $7\ imes$$\\sim$$23\ imes$ faster on a single binary convolution, and about $6\ imes$ faster on Bi-Real Net 18 (a BNN variant of ResNet-18). The daBNN is a BSD-licensed inference framework, and its source code, sample projects and pre-trained models are available on-line: https://github.com/JDAI-CV/dabnn.

Motivation & Objective

  • To address the lack of a fast, open-source BNN inference framework for low-end ARM devices such as mobile phones and embedded systems.
  • To overcome the performance bottleneck of existing BNN frameworks like BMXNet, which are slower than full-precision inference on ARM.
  • To enable efficient deployment and architectural exploration of BNNs by providing a high-speed, open-source inference backend.
  • To optimize bit-packing, binary convolution, and memory access patterns specifically for ARM CPUs using hand-tuned assembly and SIMD instructions.
  • To support model conversion from ONNX to daBNN format, enabling cross-framework deployment of BNNs without custom operators.

Proposed method

  • Proposes an upgraded bit-packing scheme that uses the sign bit of 32-bit integers and SIMD right-shift-and-overwrite instructions to pack multiple 1-bit elements simultaneously, reducing latency by ~4× compared to naive methods.
  • Introduces 'binary direct convolution' to eliminate redundant 'addv' instructions in BGEMM, directly computing binary dot products via XNOR and popcount operations.
  • Employs a novel memory layout that reduces memory access overhead by improving data locality and alignment for binary tensors.
  • Implements core operators in C++ and hand-optimized ARM assembly, with Java bindings and Android packaging for mobile deployment.
  • Develops onnx2bnn, a model conversion tool that detects binary tensors via Sign operators and converts ONNX models to daBNN-compatible format with packed weights.
  • Supports fused-BN-binarization layers and ensures interoperability by relying only on standard ONNX operators, avoiding framework-specific custom layers.

Experimental results

Research questions

  • RQ1Can a highly optimized, open-source BNN inference framework achieve super-fast inference on low-end ARM devices?
  • RQ2How does optimized bit-packing using sign bits and SIMD instructions improve BNN inference speed compared to naive sequential packing?
  • RQ3Can binary direct convolution outperform traditional BGEMM implementations with 'addv' instructions in BNNs?
  • RQ4To what extent can architectural modifications (e.g., replacing 7×7 convolutions) improve BNN inference speed when using a high-performance backend?
  • RQ5Can a fast inference framework enable new, efficient BNN designs that are otherwise impractical with slower backends?

Key findings

  • daBNN achieves 7×–23× faster inference than BMXNet on single binary convolutions, despite BMXNet being the only open-source BNN framework.
  • daBNN is 8×–10× faster than full-precision TensorFlow Lite on single binary convolutions, demonstrating that BNNs can outperform full-precision models in speed on ARM.
  • On Bi-Real Net 18, daBNN is approximately 6× faster than BMXNet and 3× faster than TensorFlow Lite, confirming its superiority in real-world BNNs.
  • Replacing the first 7×7 convolution in Bi-Real Net 18 with a STEM module yields a 30% speedup on Google Pixel 1 with no accuracy drop, made feasible only by daBNN’s high efficiency.
  • The onnx2bnn conversion tool enables seamless deployment of BNNs trained in TensorFlow and PyTorch to daBNN, avoiding dependency on custom operators like those in BMXNet.
  • daBNN’s open-source BSD license, pre-built binaries, and Android sample project lower the barrier for industrial deployment and academic research.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.