Skip to main content
QUICK REVIEW

[Paper Review] BrainSlug: Transparent Acceleration of Deep Learning Through Depth-First Parallelism

Nicolas Weber, Florian Schmidt|arXiv (Cornell University)|Apr 23, 2018
Advanced Neural Network ApplicationsComputer Science17 references7 citations
TL;DR

BrainSlug accelerates deep learning inference and training by reordering neural network computation from breadth-first to depth-first processing, improving data locality and reducing cache misses. It achieves up to 41.1% speedup on CPUs and 35.7% on GPUs with zero changes to model architecture and minimal code modifications, enabling transparent performance gains on standard hardware.

ABSTRACT

Neural network frameworks such as PyTorch and TensorFlow are the workhorses of numerous machine learning applications ranging from object recognition to machine translation. While these frameworks are versatile and straightforward to use, the training of and inference in deep neural networks is resource (energy, compute, and memory) intensive. In contrast to recent works focusing on algorithmic enhancements, we introduce BrainSlug, a framework that transparently accelerates neural network workloads by changing the default layer-by-layer processing to a depth-first approach, reducing the amount of data required by the computations and thus improving the performance of the available hardware caches. BrainSlug achieves performance improvements of up to 41.1% on CPUs and 35.7% on GPUs. These optimizations come at zero cost to the user as they do not require hardware changes and only need tiny adjustments to the software.

Motivation & Objective

  • To address the performance bottleneck in deep neural network inference and training caused by poor data locality and cache thrashing in traditional breadth-first processing.
  • To enable transparent acceleration of deep learning workloads on standard CPUs and GPUs without requiring hardware modifications or changes to model architecture.
  • To develop a modular framework that supports multiple deep learning frameworks (e.g., PyTorch, TensorFlow) and hardware back-ends (CPUs, GPUs, FPGAs) through extensible APIs.
  • To optimize computation by processing subsets of input data in depth-first order, improving cache utilization and reducing redundant memory accesses.
  • To evaluate the framework across diverse network architectures and batch sizes, focusing on real-world performance gains in practical deployment scenarios.

Proposed method

  • Replaces standard breadth-first layer-by-layer processing with a depth-first traversal that processes all layers on a small, cache-friendly subset of input data before moving to the next subset.
  • Identifies and groups optimizable layers—particularly element-wise and pooling layers—that can be computed on partial input tensors without altering the final output.
  • Uses a modular runtime system with pluggable front-ends for deep learning frameworks and back-ends for hardware targets, enabling transparent integration.
  • Applies a stacking technique to process consecutive non-convolutional layers on small data chunks, minimizing memory bandwidth pressure and improving cache reuse.
  • Employs lightweight code transformations and kernel fusion strategies to maintain high performance while preserving numerical correctness.
  • Supports both inference and future training acceleration by extending the same depth-first execution model to backpropagation workflows.

Experimental results

Research questions

  • RQ1Can a depth-first computation strategy significantly improve data locality and reduce cache misses in deep neural network inference?
  • RQ2To what extent can transparent, non-invasive optimizations based on data partitioning improve performance on standard CPUs and GPUs?
  • RQ3Which layer types are amenable to depth-first processing, and which are inherently incompatible due to data dependencies or computational patterns?
  • RQ4How does the performance gain of BrainSlug vary across different batch sizes, network architectures, and hardware platforms?
  • RQ5Can the framework be extended to support training workloads with similar performance improvements?

Key findings

  • BrainSlug achieves up to 41.1% speedup on CPU hardware and 35.7% on GPU hardware across a range of deep neural network models.
  • The performance gains are most significant for batch sizes of 8 and above, which are common in practice, such as the standard 32-batch size used in DenseNet training.
  • The method is transparent to users, requiring only minimal code changes—270 lines of Python and 438 lines of C++ for a PyTorch front-end—without altering model behavior or architecture.
  • Convolutional and linear layers do not benefit from the depth-first approach due to inherent data overlap and poor reuse in vectorized operations, respectively.
  • The framework is extensible, with a clean API design allowing for easy integration of new front-ends (e.g., for TensorFlow) and back-ends (e.g., FPGAs, vector processors).
  • Future work indicates potential for similar speedups in training workloads, with ongoing efforts to extend the framework to support backpropagation and additional hardware targets.

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.