Deep Tensor Convolution on Multicores

David M. Budden, Alexander Matveev, Shibani Santurkar, Shraman Ray Chaudhuri, Nir Shavit

This paper, presented at ICML 2017 by researchers from MIT, tackles a major bottleneck in modern computer vision: the "memory ceiling" of GPUs when dealing with high-dimensional data like video or volumetric medical scans.

The Challenge: 3D Data and Hardware Limits

While 2D Convolutional Neural Networks (ConvNets) have revolutionized image analysis, many real-world problems—like video classification, action recognition, and 3D medical imaging—require 3D kernels to capture spatiotemporal features.

The challenge is inherently hardware-centric. GPUs are the industry standard for deep learning, but they possess a strict "memory ceiling" (typically 12–16 GB at the time of this research). 3D convolutions require massive amounts of memory to store intermediate activations, forcing researchers to either down-sample their data or limit the depth of their networks. Conversely, CPUs have access to terabytes of RAM, but existing deep learning frameworks are notoriously slow on CPUs, often utilizing less than 5% of the hardware's theoretical peak performance.

Rethinking CPU Convolutions

The authors bridge this gap by presenting a highly optimized framework for running $N$-dimensional convolutions on multicore CPUs. By extending Winograd-style algorithms and tailoring them to CPU architectures, they make large-scale 3D deep learning practical on standard server hardware. Their approach relies on four key methodological shifts:

  1. $N$-Dimensional Winograd Extension: Winograd algorithms are "fast convolution" methods that reduce the number of required multiplications by transforming data into a different mathematical space. The authors generalized this from 1D/2D to $N$ dimensions using $n$-mode tensor products.
  2. Amortizing Transform Costs: Traditionally, Winograd algorithms are hand-crafted to be minimal. The authors realized that on CPUs, a perfectly minimal algorithm isn't strictly necessary. Instead, they exploit the CPU’s ability to handle sparse linear algebra and large memory to "amortize" the cost of these mathematical transforms across many kernels and channels.
  3. Architecture-Aware Synthesis: They developed a system to automatically generate transform matrices that are integer multiples of AVX vector widths (e.g., 256-bit or 512-bit). This ensures the CPU's SIMD (Single Instruction, Multiple Data) units are always fully occupied.
  4. Cache-Aware Tiling: To solve memory bandwidth bottlenecks, they restructured the Winograd element-wise product into a matrix-matrix multiplication (GEMM) format. This allows the CPU to keep data in high-speed L3 cache rather than constantly fetching from slow main RAM.

Key Insights: Software Over Hardware

A major takeaway from this research is that the often-cited 50x performance gap between CPUs and GPUs is largely due to poor software optimization rather than strict hardware limitations. By properly utilizing AVX and FMA instructions, the authors closed this gap significantly.

Furthermore, unlike GPUs—which struggle with sparse data structures without significant overhead—CPUs can leverage the sparse nature of Winograd transform matrices to skip unnecessary calculations. Their approach is also highly efficient even with a batch size of 1, making it ideal for real-time applications like robotics or medical imaging where waiting to "batch" multiple inputs is impractical.

Crucially, the algorithm demonstrates remarkable linear scalability. Using a work-stealing scheduler (Cilk Plus), the implementation scales almost perfectly with the number of CPU cores.

Linear scalability of the algorithm across multiple CPU cores

Performance and Results

The paper focuses heavily on performance benchmarking using synthetic ImageNet-style images, standard C3D video processing kernels, and arbitrary obscure kernel sizes to prove the flexibility of their automated synthesis.

The results are striking:

  • Massive Speedup: The implementation demonstrated a 5x to 25x improvement in throughput compared to standard libraries like TensorFlow (using Eigen) and Caffe (using Intel MKL).
  • High Utilization: Their algorithm reached ~70% of the theoretical peak performance of the Xeon E7-8890 CPU. For context, Intel’s own MKL library ran at 20%, and TensorFlow’s Eigen library ran at just 3.5%.
  • 3D Practicality: For a network with 100 kernels and 100 channels, they achieved over 6-fold acceleration compared to direct sliding-window convolution.
Speed-up relative to channels and kernel counts, showing significant acceleration for 100+ kernels

Limitations and Future Outlook

While highly effective, the algorithm is most beneficial for small kernels (e.g., 3x3 or 5x5). As kernel size increases, the transform matrices become denser, diminishing the computational savings of the Winograd approach. Additionally, if the input dimensions are not a clean multiple of the vector width, the system requires padding, which can introduce slight overhead in very small networks.

However, the authors note that their method is future-proofed for newer hardware. It will automatically benefit from newer instruction sets like AVX-512, which have the potential to double performance again without requiring any new algorithmic changes.

Summary updated

BibTeX
@inproceedings{budden2017deep,
  author = {David M. Budden and Alexander Matveev and Shibani Santurkar and Shraman Ray Chaudhuri and Nir Shavit},
  title = {{Deep Tensor Convolution on Multicores}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
  url = {https://openreview.net/forum?id=Skb3loZ_ZH},
}
Figure