Inefficient Layouts: Cache Miss Hotspots

Suboptimal tensor memory layouts, like NCHW (channel-first) on hardware optimized for NHWC (channel-last) or fragmented intermediate tensors, result in non-contiguous memory access patterns, leading to increased cache misses and reduced performance for deep learning operations.

The top 3

  1. NCHW vs. NHWC: Cache Misses in Deep Learning: The NCHW (Channels First) tensor layout often causes more cache misses on GPUs, especially for convolution operations, compared to NHWC (Channels Last), which offers better memory coalescing and cache utilization, achieving up to a 22% performance increase on NVIDIA GPUs with AMP.
  2. Strided Access: A Key Cache Miss Culprit: Strided memory access patterns, where data elements accessed in sequence are not physically contiguous in memory, are a primary cause of cache misses and performance bottlenecks in deep learning workloads due to poor spatial locality.
  3. Convolutional Layers: Deep Learning's Cache Hotspot: Convolutional layers are frequently identified as major cache miss hotspots in deep learning, particularly when data layouts like NCHW lead to inefficient memory access patterns during filter sliding operations.

Sources

Open the full topic