[Paper Review] Espresso: Efficient Forward Propagation for BCNNs
Espresso is a lightweight, dependency-free C/CUDA library that accelerates forward propagation in Binary Convolutional Neural Networks (BCNNs) using bit-packing and optimized CUDA kernels. It achieves up to 85× speedup over CPU and 16× over standard GPU implementations by enabling binary-optimized convolutional and dense layers, reducing memory usage by up to 31×, and supporting both CPU and GPU deployment with minimal overhead.
There are many applications scenarios for which the computational performance and memory footprint of the prediction phase of Deep Neural Networks (DNNs) needs to be optimized. Binary Neural Networks (BDNNs) have been shown to be an effective way of achieving this objective. In this paper, we show how Convolutional Neural Networks (CNNs) can be implemented using binary representations. Espresso is a compact, yet powerful library written in C/CUDA that features all the functionalities required for the forward propagation of CNNs, in a binary file less than 400KB, without any external dependencies. Although it is mainly designed to take advantage of massive GPU parallelism, Espresso also provides an equivalent CPU implementation for CNNs. Espresso provides special convolutional and dense layers for BCNNs, leveraging bit-packing and bit-wise computations for efficient execution. These techniques provide a speed-up of matrix-multiplication routines, and at the same time, reduce memory usage when storing parameters and activations. We experimentally show that Espresso is significantly faster than existing implementations of optimized binary neural networks ($\approx$ 2 orders of magnitude). Espresso is released under the Apache 2.0 license and is available at http://github.com/fpeder/espresso.
Motivation & Objective
- To address the high memory and computational cost of deploying DNNs on mobile and embedded devices.
- To enable efficient inference in Binary Convolutional Neural Networks (BCNNs) with minimal memory footprint and maximum speed.
- To provide a self-contained, dependency-free framework that supports both CPU and GPU deployment for BCNNs.
- To overcome limitations of prior BDNN frameworks that only optimized fully connected layers, not convolutional layers.
- To enable binary optimization of the first network layer by splitting inputs into bit-planes, improving overall inference performance.
Proposed method
- Designing specialized binary-optimized convolutional and dense layers that perform bit-packing once during network loading, reducing repeated computation.
- Implementing custom CUDA kernels for matrix multiplication using bit-wise operations and optimized memory access patterns to accelerate computation.
- Using bit-packing techniques to store binary weights and activations efficiently, reducing memory usage by up to 31×.
- Applying a novel first-layer optimization by splitting input features into 8-bit planes and recombining results via weighted sums to enable binary computation.
- Replacing standard matrix-vector multiplication with optimized matrix-matrix kernels (e.g., sgemv) when batch size is 1 to improve performance.
- Integrating memory-efficient memory allocation and coalesced global memory access to minimize GPU latency and maximize throughput.
Experimental results
Research questions
- RQ1Can a lightweight, dependency-free framework achieve state-of-the-art inference speed for BCNNs on CPU and GPU?
- RQ2How effective is bit-packing and bit-wise computation in reducing memory usage and accelerating matrix multiplication in BCNNs?
- RQ3Can binary optimization be effectively applied to the first layer of a CNN, which processes non-binary inputs?
- RQ4What performance gains are achievable by optimizing both convolutional and fully connected layers in BCNNs compared to prior implementations?
- RQ5How does the combination of optimized kernels, memory access, and bit-packing affect inference speed and memory footprint in BCNNs?
Key findings
- Espresso achieves a 1.0ms inference time on CIFAR-10 using the GPU-optimized implementation, representing an 85× speedup over CPU and 16× over standard GPU.
- The GPU-optimized implementation reduces memory usage from 53.54MB to 1.73MB in convolutional layers, achieving a 31× memory reduction.
- First-layer binary optimization provides a 3× performance boost by enabling binary computation on input bit-planes.
- The optimized CUDA kernels reduce bit-packing overhead by 5× compared to standard GPU implementations, with significant gains in memory coalescing.
- Espresso’s optimized matrix-multiplication kernels achieve up to 15% additional performance gain by switching to matrix-matrix operations when appropriate.
- The framework is self-contained, under 400KB in size, and released under the Apache 2.0 license, enabling easy deployment on embedded and mobile platforms.
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.