[Paper Review] Larq Compute Engine: Design, Benchmark, and Deploy State-of-the-Art Binarized Neural Networks
Larq Compute Engine (LCE) is a highly optimized inference engine for Binarized Neural Networks (BNNs), enabling state-of-the-art performance on mobile devices. By integrating with TensorFlow and TensorFlow Lite, LCE accelerates binary convolutions by 8.5–18.5× on Pixel 1 phones and enables end-to-end training-to-deployment pipelines, leading to the development of QuickNet—a simple, highly accurate BNN that outperforms existing models in latency and accuracy on ImageNet.
We introduce Larq Compute Engine, the world's fastest Binarized Neural Network (BNN) inference engine, and use this framework to investigate several important questions about the efficiency of BNNs and to design a new state-of-the-art BNN architecture. LCE provides highly optimized implementations of binary operations and accelerates binary convolutions by 8.5 - 18.5x compared to their full-precision counterparts on Pixel 1 phones. LCE's integration with Larq and a sophisticated MLIR-based converter allow users to move smoothly from training to deployment. By extending TensorFlow and TensorFlow Lite, LCE supports models which combine binary and full-precision layers, and can be easily integrated into existing applications. Using LCE, we analyze the performance of existing BNN computer vision architectures and develop QuickNet, a simple, easy-to-reproduce BNN that outperforms existing binary networks in terms of latency and accuracy on ImageNet. Furthermore, we investigate the impact of full-precision shortcuts and the relationship between number of MACs and model latency. We are convinced that empirical performance should drive BNN architecture design and hope this work will facilitate others to design, benchmark and deploy binary models.
Motivation & Objective
- Address the lack of integrated, high-performance software tooling for training, benchmarking, and deploying Binarized Neural Networks (BNNs) on edge devices.
- Overcome the practical barrier of slow inference in existing BNN frameworks by providing highly optimized, hand-tuned binary operations for mobile inference.
- Enable researchers and developers to design, train, and deploy BNNs seamlessly using familiar TensorFlow and TensorFlow Lite ecosystems.
- Investigate empirical performance bottlenecks in BNN architectures and evaluate the real-world impact of architectural choices such as full-precision shortcuts and MAC count correlation with latency.
- Develop a new, simple, and reproducible BNN architecture—QuickNet—that achieves state-of-the-art accuracy and latency on ImageNet using a single-stage training process.
Proposed method
- Leverages TensorFlow and TensorFlow Lite to build a full-stack inference pipeline for BNNs, including a MLIR-based graph converter that maps trained models to optimized inference graphs.
- Introduces highly optimized, hand-tuned BGEMM (Binary GEMM) kernels that accelerate binary convolutions using XOR and POPCOUNT operations, achieving 8.5–18.5× speedup on Pixel 1 phones.
- Supports mixed-precision models by enabling coexistence of binary and full-precision layers within a single model, with automatic bitpacking and precision management.
- Uses a sophisticated converter to transform emulated binary operations used during training into true binary operations at inference time, ensuring fidelity and performance.
- Employs a hardware-aware design approach targeting 64-bit ARM devices, including Pixel 1 phones and Raspberry Pi 4, to ensure real-world performance relevance.
- Applies empirical benchmarking on real devices to evaluate latency, accuracy, and MAC efficiency across diverse BNN architectures and design choices.
Experimental results
Research questions
- RQ1What are the major latency bottlenecks in existing BNN architectures, particularly in relation to full-precision components?
- RQ2How do different types of shortcut connections (e.g., full-precision vs. binary) affect inference latency and accuracy in BNNs?
- RQ3To what extent does the number of multiply-accumulate operations (MACs) correlate with real-world inference latency across diverse BNN architectures?
- RQ4Can a simple, single-stage training method produce a BNN architecture that outperforms complex, multi-stage approaches in both accuracy and latency?
- RQ5How can software tooling be designed to close the gap between full-precision and binarized model deployment in terms of usability and performance?
Key findings
- Larq Compute Engine accelerates binary convolutions by 8.5× to 18.5× compared to full-precision counterparts on Pixel 1 phones, demonstrating significant performance gains through optimized BGEMM kernels.
- QuickNet, a simple BNN with a single-stage training process, achieves state-of-the-art accuracy and latency on ImageNet, outperforming existing binary networks despite its simplicity.
- Full-precision shortcut connections, while adding marginal latency overhead, provide substantial accuracy gains and are therefore well-justified in BNN design.
- The number of MACs is a poor predictor of real-world latency when comparing fundamentally different BNN architectures, as shown by BinaryAlexNet being nearly 2× slower than models with similar MAC counts.
- Empirical benchmarking on real devices reveals that architectural choices such as layer precision and operation layout significantly impact latency, underscoring the need for hardware-aware design over theoretical metrics.
- The integration of LCE with Larq and TensorFlow Lite enables a seamless, end-to-end pipeline for BNN development, significantly lowering the barrier to entry for researchers and practitioners.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.