Cross-Stack Workload Characterization of Deep Recommendation Systems

Samuel Hsia, Udit Gupta, Mark Wilkening, Carole-Jean Wu, Gu-Yeon Wei, David BrooksIISWC 2020

Abstract

Deep learning based recommendation systems form the backbone of most personalized cloud services. Though the computer architecture community has recently started to take notice of deep recommendation inference, the resulting solutions have taken wildly different approaches—ranging from near memory processing to at-scale optimizations. To better design future hardware systems for deep recommendation inference, we must first systematically examine and characterize the underlying systems-level impact of design decisions across the different levels of the execution stack. In this paper, we characterize eight industry-representative deep recommendation models at three different levels of the execution stack: algorithms and software, systems platforms, and hardware microarchitectures. Through this cross-stack characterization, we first show that system deployment choices (i.e., CPUs or GPUs, batch size granularity) can give us up to 15x speedup. To better understand the bottlenecks for further optimization, we look at both software operator usage breakdown and CPU frontend and backend microarchitectural inefficiencies. Finally, we model the correlation between key algorithmic model architecture features and hardware bottlenecks, revealing the absence of a single dominant algorithmic component behind each hardware bottleneck.

TL;DR

Deep recommendation systems consume the vast majority of AI cycles in modern datacenters, yet their performance bottlenecks remain a moving target. This research provides a comprehensive "cross-stack" analysis of eight industry-representative models, revealing that the optimal hardware choice (CPU vs. GPU) depends entirely on batch size and model architecture, while microarchitectural bottlenecks shift from frontend decoders to backend memory systems across different CPU generations.

Problem Statement

While the research community has spent years optimizing Computer Vision (CNNs) and Natural Language Processing (RNNs/Transformers), recommendation systems (RecSys) are the actual workhorses of the industry. At Facebook, for instance, over 80% of AI inference cycles are dedicated to recommendation. RecSys are unique because they combine dense mathematical operations (like matrix multiplications) with sparse, irregular memory accesses (looking up "embeddings" in massive tables). Because of this hybrid nature, standard AI accelerators do not always provide the expected gains. This paper addresses the lack of a holistic understanding of how these models behave across the entire computing stack.

Methodology

The researchers characterized eight different recommendation models across three levels of the execution stack using the DeepRecSys benchmark suite. This suite includes industry-representative models such as NCF, DLRM variants (RM1-3), Wide and Deep (WnD), and attention-based models like DIN and DIEN.

The cross-stack characterization framework spanning algorithms, system platforms, and hardware microarchitectures.
  1. Algorithms & Software: Analysis of operator breakdowns (e.g., Fully-Connected layers vs. Sparse Embedding lookups) in Caffe2 and TensorFlow.
  2. Systems Platforms: Performance comparison across server-class CPUs (Intel Broadwell, Cascade Lake) and GPUs (NVIDIA 1080 Ti, T4).
  3. Microarchitecture: Utilization of the TopDown analysis method to break down CPU cycles into Frontend Bound, Back-end Bound, Bad Speculation, and Retiring categories.

Key Insights and Results

The Batch Size "Tipping Point"

Conventional wisdom suggests GPUs are always faster for AI. However, for RecSys at small batch sizes—common in latency-sensitive real-time applications—CPUs (specifically newer Cascade Lake models) often outperform GPUs. This is largely due to the high overhead of moving data between the CPU and GPU over PCIe. As batch sizes increase, the compute density of the models allows GPUs to overcome this overhead, leading to significant speedups.

Heatmap of speedups across batch sizes and hardware platforms, illustrating the performance tipping point between CPUs and GPUs.

Shifting Microarchitectural Bottlenecks

  • Attention Mechanisms: Models like DIN, which use complex attention mechanisms, suffer from high Instruction Cache (L1-i) miss rates. The variety of small, unique operations causes the CPU to spend significant time fetching instructions.
  • Hardware Evolution: On older Broadwell CPUs, dense models were "core-bound." On newer Cascade Lake CPUs with wider SIMD (AVX-512) units, these same models become "memory-bound" because the compute is now fast enough to saturate the memory subsystem.
  • Frontend vs. Backend: Models with massive embedding tables (like RM1 and RM2) bottleneck the CPU's frontend decoders. Irregular memory access patterns lead to bad branch speculation, wasting pipeline slots.

Conclusion

Choosing the right hardware and batch size configuration can lead to up to a 15x speedup in inference performance. The study suggests that because bottlenecks shift based on model architecture and hardware generation, future hardware should be specialized for specific types of recommendation tasks, such as lookup-optimized versus compute-optimized designs.

Summary updated

BibTeX
@inproceedings{hsia2020cross,
  author = {Samuel Hsia and Udit Gupta and Mark Wilkening and Carole-Jean Wu and Gu-Yeon Wei and David Brooks},
  title = {{Cross-Stack Workload Characterization of Deep Recommendation Systems}},
  booktitle = {IISWC},
  year = {2020},
  url = {https://openreview.net/forum?id=h69CNVaVV0},
}
Figure