Optimally Scheduling CNN Convolutions for Efficient Memory Access

Arthur Stoutchinin, Francesco Conti, Luca BeniniarXiv 2019

Introduction

In the rapidly evolving landscape of embedded AI, the "memory wall" remains a significant bottleneck. Deep learning models, particularly Convolutional Neural Networks (CNNs), require massive amounts of data—weights and feature maps—to perform even basic operations. While high-performance chips can afford large on-chip buffers, power-constrained embedded systems (like those in IoT devices or smartphones) cannot. To maximize energy efficiency, these systems often utilize application-managed buffers (scratchpads) instead of traditional hardware caches.

However, effectively scheduling data movement in scratchpads is notoriously difficult. Researchers have recently developed a new analytical model that moves away from pessimistic, cache-based assumptions to identify non-trivial dataflow schedules. This approach has demonstrated the potential to reduce off-chip memory traffic by up to 15% over previous state-of-the-art models and achieve a 14× bandwidth reduction compared to existing hardware implementations.

The Problem: Pessimistic Memory Models

Traditional mathematical models used to optimize memory schedules were originally designed for hardware caches. These models are often "pessimistic" because they assume all data within a computation "tile" must be stored in the buffer simultaneously. This leads to sub-optimal schedules that overestimate memory requirements and waste precious bandwidth.

Unlike a cache, which automatically manages data, a scratchpad requires the software or a hardware controller to explicitly schedule every move. The challenge lies in finding a schedule that minimizes off-chip traffic while staying within the strict capacity limits of embedded memory.

Methods: Independent Array Management

The authors propose a new analytical memory performance model that treats the Input (I), Weight (W), and Output (O) arrays independently. This is a departure from the standard "localized iteration space" paradigm where all data types are managed as a single block.

Architecture of the application-managed local reuse buffer, showing independent buffering for weights (W), inputs (I), and outputs (O).

Key Components of the Model:

  1. Footprint Calculation: The model defines a specific "footprint" for each array at every level of the 6-level CNN loop nest (Output Maps, Input Maps, X/Y dimensions, and Kernel X/Y).
  2. Independent Buffering Levels: Instead of a single buffering strategy, the model allows each array to have its own "buffering level." This means the hardware can reuse weights at one loop level while simultaneously reusing input pixels at a completely different one.
  3. Design Space Exploration (DSE): The researchers performed a two-step search, enumerating 180 possible loop permutations and searching for the optimal combination of tiling sizes and buffering levels for specific CNN layers.
Data dependency table showing which loop levels carry reuse for input, weight, and output arrays.

To validate the model, the team designed a Hardware Convolution Block (HWC). This SIMD-style engine is integrated into a shared-memory cluster and implements these non-trivial, optimized schedules with a maximum deviation of only 0.5% compared to actual hardware measurements.

Key Insights and Results

The model was evaluated using convolutional layers from five industry-standard CNN topologies: AlexNet, ZFNet, VGG16, Inception v3, and ResNet-20. These represent a wide variety of kernel sizes (from 1x1 to 11x11) and feature map dimensions.

  • Accumulation Costs: A critical insight is that partial sum accumulation (the 'O' array) is often the most expensive part of memory traffic because it requires both a read and a write at high precision. The most efficient schedules are those that keep the output accumulation local as long as possible.
  • Traffic Reduction: Compared to the previous state-of-the-art (the Peemen model), this new approach identifies schedules that require 5–15% less memory traffic.
  • Hardware Speedup: The HWC architecture achieved up to a 14× reduction in memory bandwidth compared to the HWCE accelerator, a previously published design with similar memory constraints.
  • Extreme Efficiency: The HWC can sustain a throughput of 16 Multiply-Accumulate (MAC) operations per cycle using only 1KB of internal storage.

Conclusion and Future Work

By allowing Input, Weight, and Output data to be managed independently across loop depths, this model finds efficient schedules that humans and traditional models typically miss. While highly accurate, the authors note that future work will focus on automating the generation of these schedules directly from high-level frameworks like TensorFlow or Caffe. Additionally, extending this fine-grained buffering logic to depthwise separable convolutions and fully connected layers remains an important next step for the field.

Summary updated

BibTeX
@misc{stoutchinin2019optimally,
  author = {Arthur Stoutchinin and Francesco Conti and Luca Benini},
  title = {{Optimally Scheduling CNN Convolutions for Efficient Memory Access}},
  year = {2019},
  eprint = {1902.01492},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1902.01492},
}
Figure