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.
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.
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