Top 3 DL Ops Most Affected by Layout Cache Misses

Convolutional layers, pooling layers, and batch normalization layers are highly sensitive to NCHW/NHWC tensor layout choices, as suboptimal layouts lead to increased cache misses and reduced performance due to inefficient memory access patterns.

The top 3

  1. Convolutional Layers: Layout's Top Cache Bottleneck: Convolutional layers are most affected by NCHW/NHWC layouts, as NHWC (channels-last) significantly boosts cache utilization and memory coalescing on GPUs, especially for Tensor Cores, by storing per-pixel channel data contiguously.
  2. Pooling Operations: Spatial Access Sensitivity: Pooling operations, which reduce spatial dimensions by aggregating pixel values, are highly sensitive to data layout. Inefficient layouts can cause cache thrashing by forcing non-contiguous memory access when iterating across channels for a given spatial location.
  3. Batch Normalization: Layout's Performance Flip: Batch Normalization's performance is highly layout-dependent, often favoring NCHW (channels-first) in some frameworks and hardware for its efficiency in reducing over height and width dimensions, contrasting with convolutions' typical preference for NHWC.

Sources

Open the full topic