DeepRecSys: A System for Optimizing End-To-End At-Scale Neural Recommendation Inference

Udit Gupta, Samuel Hsia, Vikram Saraph, Xiaodong Wang, Brandon Reagen, Gu-Yeon Wei, Hsien-Hsin S. Lee, David Brooks, Carole-Jean Wu

Introduction

While computer vision and natural language processing often dominate AI research headlines, recommendation systems (RecSys) are the primary workhorses of modern datacenters. At companies like Facebook, over 70% of machine learning inference cycles are dedicated to recommendation and ranking. Despite this massive footprint, these systems face unique architectural challenges that standard deep learning optimizations often overlook.

The Unique Challenges of RecSys

Unlike compute-intensive models like CNNs, recommendation models are fundamentally memory-intensive. They process a combination of "dense" features (continuous values) and "sparse" features (categorical data like user IDs). This architecture leads to irregular memory accesses and massive storage requirements for embedding tables, often reaching several gigabytes.

Roofline analysis and memory read breakdown across various recommendation models showing their memory-bound nature.

As shown in the roofline analysis, most industry-standard recommendation models operate far below peak hardware performance, bottlenecked by the time required to look up embedding tables in DRAM rather than raw FLOPs. Furthermore, real-world query patterns in production environments exhibit a "heavy-tail" distribution that standard log-normal models fail to capture, leading to significant hardware underutilization.

DeepRecSys: Infrastructure and Scheduling

To address these inefficiencies, the authors developed DeepRecSys, an end-to-end infrastructure composed of two primary elements:

  1. DeepRecInfra: An extensible modeling framework incorporating eight industry-representative models from Facebook, Google, and Alibaba. It allows for the simulation of realistic datacenter conditions, including actual Poisson arrival rates and working set size distributions.
  2. DeepRecSched: A dynamic, hill-climbing-based scheduler. It balances the trade-off between request-level parallelism (distributing queries across cores) and batch-level parallelism (splitting a single large query across multiple cores).

Key Insights and Ideas

One of the most critical findings is that GPUs are not a universal solution for RecSys inference. Due to the high overhead of moving data from CPU memory to GPU memory, GPUs only become efficient for very large batch sizes. DeepRecSched dynamically identifies the "inflection point" for each model to decide when a query is large enough to justify offloading to a GPU.

GPU speedup relative to CPU across different batch sizes and execution time breakdown.

As illustrated in the performance breakdown, models like DIN and DIEN require batch sizes of 500 to 1000 before GPUs begin to outperform CPUs. For the smaller queries that constitute the bulk of production traffic, CPUs remain more efficient and often more power-effective.

Performance and Impact

DeepRecSys demonstrates significant improvements over traditional static scheduling approaches:

  • Throughput: The system doubled (2x) throughput across eight industry models while maintaining strict latency targets.
  • Production Latency: In a live production environment spanning hundreds of machines, the system achieved a 30% reduction in latency.
  • Hardware Efficiency: By intelligently navigating the CPU/GPU trade-off and accounting for model heterogeneity, the system ensures that hardware resources are utilized where they are most effective.

Conclusion

DeepRecSys highlights the necessity of co-designing hardware scheduling with the specific memory-intensive characteristics of recommendation models. While GPUs offer substantial speedups for large-scale queries, the diversity of RecSys models—ranging from embedding-dominated to MLP-dominated—requires a dynamic approach to scheduling. The authors have open-sourced the DeepRecInfra infrastructure to facilitate further research into specialized AI hardware and training-phase optimizations.

Summary updated

BibTeX
@inproceedings{gupta2020deeprecsys,
  author = {Udit Gupta and Samuel Hsia and Vikram Saraph and Xiaodong Wang and Brandon Reagen and Gu-Yeon Wei and Hsien-Hsin S. Lee and David Brooks and Carole-Jean Wu},
  title = {{DeepRecSys: A System for Optimizing End-To-End At-Scale Neural Recommendation Inference}},
  booktitle = {ISCA},
  year = {2020},
  url = {https://openreview.net/forum?id=AvzYSdGOV5r},
}
Figure