First-Generation Inference Accelerator Deployment at Facebook

Michael J. Anderson, Benny Chen, Stephen Chen, Summer Deng, Jordan Fix, Michael Gschwind, Aravind Kalaiah, Changkyu Kim, Jaewon Lee, Jason Liang, Haixin Liu, Yinghai Lu, Jack Montgomery, Arun Moorthy, Nadathur Satish, Sam Naghshineh, Avinash Nayak, Jongsoo Park, Chris Petersen, Martin Schatz, Narayanan Sundaram, Bangsheng Tang, Peter Tang, Amy Yang, Jiecao Yu, Hector Yuen, Ying Zhang, Aravind Anbudurai, Vandana Balan, Harsha Bojja, Joe Boyd, Matthew Breitbach, Claudio Caldato, Anna Calvo, Garret Catron, Sneh Chandwani, Panos Christeas, Brad Cottel, Brian Coutinho, Arun Dalli, Abhishek Dhanotia, Oniel Duncan, Roman Dzhabarov, Simon Elmir, Chunli Fu, Wenyin Fu, Michael Fulthorp, Adi Gangidi, Nick Gibson, Sean Gordon, Beatriz Padilla Hernandez, Daniel Ho, Yu-Cheng Huang, Olof Johansson, Shishir Juluri, et al.arXiv 2021

Introduction

As machine learning models become central to the user experience at scale, the underlying infrastructure must evolve to meet unprecedented computational demands. This paper details the co-design and deployment of Facebook’s (now Meta) first-generation custom inference accelerator platform. The transition represents a shift from general-purpose CPU-based inference to a specialized, multi-accelerator architecture integrated with an open-source software stack.

The Challenge: Scaling Inference

Between 2018 and 2020, the infrastructure requirements for machine learning at Facebook grew exponentially. The number of servers dedicated to inference increased by 5–7×, driven by two primary factors: escalating model complexity and the unique requirements of recommendation systems.

Figure 1: Growth in server capacity for recommendation systems and other ML models over three years.

Natural Language Processing (NLP) models, for instance, saw a 300× increase in parameter counts. Simultaneously, recommendation systems like the Deep Learning Recommendation Model (DLRM) introduced massive "embedding tables." These tables require high memory capacity and bandwidth but involve sparse memory accesses that are notoriously inefficient on standard CPU hardware.

System Design and Implementation

To address these challenges, Facebook adopted a full-stack co-design approach encompassing hardware, compilers, and model partitioning.

Hardware Architecture

The fundamental building block is a low-power M.2 accelerator card with a 13W power envelope. To support large-scale models, six of these cards are connected via a PCIe switch to a single host CPU, forming a unified "node." This configuration provides a combined 180–270 TOPS (int8) and 96GB of LPDDR memory per node.

Figure 6: Hardware architecture of the inference node, showing the connection between the CPU, PCIe switch, and multiple accelerators.

Software Stack and the Glow Compiler

A critical component of the system is the Glow compiler, an open-source tool that ensures vendor-agnostic flexibility. Glow ingests models from frameworks like PyTorch and Caffe2, performing graph-level optimizations such as operator fusion and quantization before generating hardware-specific code. This approach prevents vendor lock-in and allows for rapid iteration across different hardware backends.

Model Partitioning: The "Net Split"

The system utilizes a "Net Split" technique to optimize execution. Small, latency-sensitive operations remain on the host CPU, while compute-intensive matrix multiplications and sparse embedding lookups are offloaded to the accelerators. This partitioning ensures that each component of the hardware is utilized for its strengths.

Workloads and Evaluation

The platform was evaluated using production-scale workloads:

  • Recommendation: DLRM with over 100 billion parameters.
  • Computer Vision: Complex models like ResNeXt101 and RegNetY.
  • NLP: Massive Transformer-based models such as XLM-R.
  • Video: ResNeXt3D-based models for content understanding.

Key Insights

  • Memory as the Primary Bottleneck: For recommendation models, compute power (TOPS) is often secondary to memory bandwidth. Success depends on effectively partitioning massive embedding tables across multiple accelerator cards.
  • Pipelined Execution: The system achieves high throughput by pipelining requests, allowing one card to perform sparse lookups while another handles dense compute for different requests.
  • Quantization Sensitivity: Recommendation models are highly sensitive to precision loss. The system uses aggressive int8 and int4 quantization, with fp16 as a fallback to maintain accuracy within strict "Normalized Entropy" limits.

Results

The first-generation deployment achieved a peak efficiency of 2.0–3.0 TOPS/W. The 6-card node delivers up to 270 TOPS (int8) at a total power envelope of approximately 91W. For NLP tasks, heuristic parallelization across accelerator cores resulted in a 2.6× speedup. Overall, the system successfully serves models that are 5× more compute-intensive than the CPU-only systems they replaced.

Future Directions

Despite these gains, the "memory wall" remains a challenge as models continue to grow. Future designs may explore hierarchical storage using Non-Volatile Memory (NVM) and specialized hardware support for sparse matrix multiplication. Additionally, integrating video transcoder ASICs directly onto inference cards could alleviate current CPU bottlenecks in video processing.

Summary updated

BibTeX
@misc{anderson2021first,
  author = {Michael J. Anderson and Benny Chen and Stephen Chen and Summer Deng and Jordan Fix and Michael Gschwind and Aravind Kalaiah and Changkyu Kim and Jaewon Lee and Jason Liang and Haixin Liu and Yinghai Lu and Jack Montgomery and Arun Moorthy and Nadathur Satish and Sam Naghshineh and Avinash Nayak and Jongsoo Park and Chris Petersen and Martin Schatz and Narayanan Sundaram and Bangsheng Tang and Peter Tang and Amy Yang and Jiecao Yu and Hector Yuen and Ying Zhang and Aravind Anbudurai and Vandana Balan and Harsha Bojja and Joe Boyd and Matthew Breitbach and Claudio Caldato and Anna Calvo and Garret Catron and Sneh Chandwani and Panos Christeas and Brad Cottel and Brian Coutinho and Arun Dalli and Abhishek Dhanotia and Oniel Duncan and Roman Dzhabarov and Simon Elmir and Chunli Fu and Wenyin Fu and Michael Fulthorp and Adi Gangidi and Nick Gibson and Sean Gordon and Beatriz Padilla Hernandez and Daniel Ho and Yu-Cheng Huang and Olof Johansson and Shishir Juluri and et al.},
  title = {{First-Generation Inference Accelerator Deployment at Facebook}},
  year = {2021},
  eprint = {2107.04140},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.04140},
}
Figure