Top 3 Hardware Favoring NCHW/NHWC for Cache

NVIDIA GPUs, especially those with Tensor Cores, generally prefer NHWC for optimal memory coalescing and vectorized operations, while older GPUs or certain cuDNN operations might favor NCHW. Intel CPUs with SIMD extensions (like AVX/AVX512) can also benefit from NHWC for better spatial locality in some convolution patterns.

The top 3

  1. NVIDIA GPUs: NCHW Dominance for Performance: NVIDIA GPUs, especially with CUDA and cuDNN libraries, are heavily optimized for the NCHW (channels-first) data layout, which often leads to better memory coalescing and cache utilization, significantly boosting deep learning model performance.
  2. CPUs: NHWC Often Preferred for Locality: Modern CPUs, particularly those with AVX-512 extensions, often show better cache performance with the NHWC (channels-last) layout due to its contiguous storage of pixel data for a single location, which aligns well with typical CPU memory access patterns and vectorization.
  3. Google TPUs: Designed for NHWC Efficiency: Google's Tensor Processing Units (TPUs) are specifically architected to favor the NHWC (channels-last) data layout, as it simplifies hardware design for efficient matrix multiplication and memory access patterns, contributing to their high performance in deep learning workloads.

Sources

Open the full topic