Restructuring Batch Normalization to Accelerate CNN Training

Wonkyung Jung, Daejin Jung, Byeongho Kim, Sunjung Lee, Wonjong Rhee, Jung Ho Ahn

Introduction: The Shifting Bottleneck in Deep Learning

Historically, the performance of Convolutional Neural Networks (CNNs) was synonymous with the efficiency of their Convolutional (CONV) and Fully-Connected (FC) layers. Early architectures like AlexNet and VGG were dominated by these compute-intensive operations. However, as network architectures evolved toward deeper, more complex structures like ResNet and DenseNet, the landscape of execution time has shifted dramatically.

Modern CNNs utilize smaller filters and interleave hundreds of layers with Batch Normalization (BN) and ReLU activations. While CONV layers have become highly optimized and compute-efficient, non-convolutional layers have emerged as a significant performance bottleneck. In DenseNet-121, for instance, non-CONV layers account for over 58% of the total execution time. Unlike CONV layers, which are typically compute-bound, these auxiliary layers are severely limited by main-memory bandwidth.

Figure 1: Execution time breakdown showing the increasing dominance of non-CONV layers in modern architectures.

The Memory Wall in Training

The primary challenge in optimizing these layers during training is the "memory wall." While layer fusion is a standard optimization for inference—where data can be kept on-chip between operations—it is significantly more complex during training. Batch Normalization requires calculating the mean and variance across an entire mini-batch before normalization can occur. This creates a strict data dependency: the hardware must write intermediate results back to main memory, preventing the cross-layer data reuse necessary for effective fusion.

Proposed Solution: BN Fission-n-Fusion (BNFF)

To address this bottleneck, this paper proposes BN Fission-n-Fusion (BNFF), a technique designed to hide the memory latency of BN layers within the compute cycles of adjacent CONV layers. The approach relies on three strategic steps:

  1. Fission: The standard BN layer is mathematically decomposed into two sub-layers. sub-BN1 handles the calculation of mini-batch statistics (mean and variance), while sub-BN2 performs the actual normalization and scaling.
  2. Mean/Variance Fusion (MVF): To avoid multiple passes over the data, the authors leverage the identity $V(X) = E(X^2) - E(X)^2$. This allows the hardware to compute both the sum of elements and the sum of squares in a single memory sweep, significantly reducing bandwidth requirements.
  3. Fusion: With the BN layer split, it becomes possible to fuse sub-BN1 with the preceding CONV layer and sub-BN2 with the subsequent ReLU and CONV layers.
Figure 6: Overview of the BN Fission-n-Fusion technique for both forward and backward passes.

By restructuring the operations this way, the massive feature maps of the mini-batch do not need to be written to and read from off-chip memory between the CONV and BN stages. Instead, the memory accesses required for BN are "hidden" behind the computation of the CONV layers.

Performance Evaluation and Results

The BNFF technique was evaluated on both CPU (Intel Xeon) and GPU (NVIDIA Titan X) platforms using DenseNet-121 and ResNet-50 architectures.

  • DenseNet-121: The implementation achieved a 25.7% overall training speedup on the CPU. This was driven by a 47.9% improvement in the forward pass and a 15.4% improvement in the backward pass. Total memory accesses were reduced by 19.1%.
  • ResNet-50: Showed a 16.1% overall speedup on the CPU and a 7.8% speedup on the GPU.
  • Bandwidth Sensitivity: To test the "memory wall" hypothesis, the authors artificially restricted the system's memory bandwidth. Under these conditions, the performance gain of BNFF increased to 30.1%, suggesting that the technique will become increasingly vital as the gap between compute power (FLOPS) and memory bandwidth (GB/s) continues to widen.

Conclusion and Future Directions

The BNFF approach demonstrates that significant performance gains in modern deep learning can be achieved by looking beyond the convolution operation. By addressing the memory-bound nature of Batch Normalization through algorithmic restructuring and hardware-aware fusion, training times can be reduced substantially without altering model architecture.

While the current work focuses on BN and ReLU, future research could extend these fusion techniques to other memory-intensive operations, such as the concatenation and split layers prevalent in DenseNet. As hardware continues to scale compute faster than memory, such "Fission-n-Fusion" strategies will be essential for maintaining training efficiency.

Summary updated

BibTeX
@misc{jung2018restructuring,
  author = {Wonkyung Jung and Daejin Jung and Byeongho Kim and Sunjung Lee and Wonjong Rhee and Jung Ho Ahn},
  title = {{Restructuring Batch Normalization to Accelerate CNN Training}},
  year = {2018},
  eprint = {1807.01702},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.01702},
}
Figure