NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Accelerating Deep Learning Inference with Cross-Layer Data Reuse on GPUs

Xueying Wang, Guangli Li, Xiao Dong, Jiansong Li, Lei Liu, Xiaobing FengarXiv 2020

TL;DR

This paper introduces a novel layer-fusion method for accelerating CNN inference on GPUs by maximizing cross-layer data reuse within fast on-chip memory. By formalizing three fusion modes—Straight, Split, and Merge—and optimizing memory access patterns, the authors achieve an average speedup of 2.02× on representative CNN structures and 1.57× for end-to-end SqueezeNet inference compared to NVIDIA’s cuDNN library.

What Problem Does This Paper Address?

Deep learning inference is increasingly hitting the "memory wall." While modern GPUs have massive computational throughput, the speed of moving data between the GPU's slow off-chip global memory and its fast on-chip registers or shared memory is a major bottleneck.

Standard deep learning libraries typically execute one neural network layer at a time. Each "kernel" (a small program running on the GPU) must load input data from global memory and write its results back to global memory. For many operations—like pooling, activation functions, or convolutions with small filters—the time spent moving data far outweighs the time spent on actual math. The authors aim to eliminate these redundant data transfers by "fusing" multiple layers into a single kernel, keeping intermediate results on-chip.

Fig. 2. GPU Memory Hierarchy

Methods

The authors propose a systematic workflow for cross-layer data reuse:

  1. Fusion Analysis: They categorize CNN layer connections into three formal modes:
  2. Straight: A simple sequence (Layer 1 → Layer 2).
  3. Split: One layer feeds into multiple subsequent layers.
  4. Merge: Multiple layers feed into one (e.g., an "Add" or "Concat" operation). The three fundamental fusion modes used to describe CNN architectures.

  5. Tiling & Parallelism: To handle the spatial dependencies of convolutions (where one output pixel depends on a neighborhood of input pixels), they use hierarchy overlapped tiling. This involves dividing the image into tiles and including a "halo" of redundant data at the borders to ensure each parallel block has everything it needs to compute the next layer without reaching back to global memory.

  6. Memory Optimization: They implement specific GPU-level optimizations, such as:
  7. Memory Padding: Adding extra columns/rows in shared memory to prevent "bank conflicts," which happen when multiple threads try to access the same memory bank simultaneously.
  8. Read-only Data Optimization: Using constant memory and read-only caches for weights and biases to speed up access.
  9. Source Code Generation: A tool automatically generates high-performance CUDA code based on the selected fusion mode and optimized tiling parameters.
Fig. 4. Different Fusion Mode
Fig. 1. Workflow of Our Cross-layer Data Reuse Method

Datasets (Benchmarks)

The method was evaluated using architectural structures extracted from four state-of-the-art CNNs:

  • GoogleNet: Known for its complex Inception modules.
  • MobileNet: Utilizes depth-wise separable convolutions.
  • SqueezeNet: A light-weight architecture designed for efficiency.
  • ResNet: Features residual (skip) connections.

Performance was measured on two different GPU platforms: the NVIDIA TITAN Xp (Pascal architecture) and the NVIDIA Tesla P4.

Key Insights and Ideas

  • The Latency Gap: Global memory latency is roughly 7000× higher than register latency and 5× higher than shared memory latency. This makes on-chip data reuse the single most effective way to bypass memory bottlenecks.
  • Trading Math for Bandwidth: The "overlapped tiling" strategy actually introduces redundant computation at the edges of tiles. However, because the GPU is so fast at math but so slow at memory access, doing extra work is often faster than waiting for a data transfer.
  • Fusion Complexity: While simple layers are easy to fuse, the authors show that complex structures like Inception (Split/Merge) and Residual blocks can be decomposed into their three basic fusion modes for systematic optimization.
Fig. 3. CNN Motivating Example

Key Results

  • Structural Speedup: On representative CNN sub-structures, the method achieved an average speedup of 2.02×.
  • MobileNet Breakthrough: The most dramatic improvement was a 10.33× speedup on a depth-wise convolution case from MobileNet on the Tesla P4. This is because depth-wise convolutions are extremely memory-bound, making them ideal candidates for fusion.
  • End-to-End Performance: For the full SqueezeNet model, the method achieved a 1.57× speedup on the TITAN Xp.
  • Memory Efficiency: Profiling showed that the fused kernels reduced global memory store transactions by a ratio of roughly 1:3 compared to cuDNN, confirming that data was successfully kept on-chip.

Limitations and Future Work

  • Shared Memory Capacity: The primary constraint is the physical size of the GPU's shared memory. Fusing more than two or three complex layers often exceeds this capacity, leading to performance degradation or kernel failure.
  • Filter Size Sensitivity: As convolution filter sizes increase, the amount of redundant "halo" data required for tiling grows, which can eventually diminish the gains from data reuse.
  • Future Directions: The authors suggest further research into automated tools that can decide exactly which layers in a massive DAG (Directed Acyclic Graph) are the most profitable to fuse.

Summary updated

BibTeX
@misc{wang2020accelerating,
  author = {Xueying Wang and Guangli Li and Xiao Dong and Jiansong Li and Lei Liu and Xiaobing Feng},
  title = {{Accelerating Deep Learning Inference with Cross-Layer Data Reuse on GPUs}},
  year = {2020},
  eprint = {2007.06000},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.06000},
}
Figure