Taming the tail utilization of ads inference at Meta scale
Meta tightened the server utilization distribution of its ads inference fleet, letting it absorb 35% more load with no added capacity, cut timeout errors by two-thirds and halve p99 latency. Routing-side fixes used power-of-two-choices with polled rather than piggybacked load to avoid staleness, and tuned Shard Manager placement bands and thresholds. Deeper system changes treated memory bandwidth as a placement resource, since memory latency climbs sharply above roughly 65-70% utilization. Other changes included a per-model 'outstanding examples CPU' load counter to fix multi-tenant imbalance, budgets that gate snapshot transitions on utilization, a feedback controller balancing traffic across hardware tiers, and predictive replica scaling up to two hours ahead. CPU utilization proved a poor load signal because it is time-aggregated and misses I/O-bound work.
Related posts
- Turning Opportunistic AI Inference Capacity Into Better Ads Recommendations
Meta Engineering mediumAdeptMeta aggregates locally idle inference capacity, stranded by peak provisioning, delivery timing, resource-ratio and accelerator-type mismatches, into a preemptible opportunistic pool used to improve ads recommendations. Two elasticity levers consume it: Rank More Ads (RMA) raises the number of candidates through the ranking stages and needs both CPU and accelerator surplus, while Serve Better Models (SBM) routes a larger share of requests to a more powerful model and needs only accelerator surplus. Baseline serving is protected by physical isolation for SBM and a logical global budget for RMA. A PID controller driven by tail latency sets RMA candidate volume, and an explore/exploit router picks SBM requests by request value. Because the central loops act on the order of minutes, millisecond-level value-aware load shedding on both servers and clients removes low-value optional work when capacity is suddenly reclaimed.
- Intelligent Delivery: Making Every Unit of Compute Serve Better Ads
Meta Engineering mediumAdeptMeta's Intelligent Delivery is an ML-driven layer that allocates serving compute across requests, models, hardware fleets and ranking stages by predicting the marginal utility of each unit of compute, adding about 10% ads ranking performance since 2017. A shared Resource Core Model (6B sparse, 20M dense parameters) runs before retrieval and is fine-tuned into predictors of outcome, compute cost and latency, improving identification of high-impact requests by about 20% offline. A hierarchy of decision engines then routes traffic between regions, matches workloads to CPU/GPU/MTIA SKUs, and solves per-host constrained optimization under tail-latency SLOs. AI agents now propose and run about 20% of optimizations, cutting tuning cycles from months to weeks, with engineers approving every change.
- Meta Adaptive Ranking Model: Bending the Inference Scaling Curve to Serve LLM-Scale Models for Ads
Meta Engineering hardMasterMeta Adaptive Ranking Model serves LLM-scale ads ranking models (O(10 GFLOPs) per token, O(1T) parameters) at O(100 ms) latency by routing each request to an appropriately complex model and computing user signals once per request instead of once per ad candidate. Key techniques include in-kernel broadcast of request-level embeddings, the Wukong Turbo architecture refinements, GPU-offloaded feature preprocessing, selective FP8 post-training quantization, operator fusion with grouped GEMM, and multi-GPU embedding sharding, reaching 35% MFU across heterogeneous hardware. Launched on Instagram in Q4 2025, it delivered +3% ad conversions and +5% CTR for targeted users.
- Maintaining large-scale AI capacity at Meta
Meta Engineering easyNoviceMeta keeps its GPU training fleet, planned to reach 600,000 GPUs, current by rolling firmware, driver and network upgrades through "maintenance trains". These take one small maintenance domain offline at a time, so all capacity except that domain stays available. Lower-level components are upgraded gradually across hosts, while the job container, including CUDA, stays consistent for each job. Domain size is chosen by trading interruption cost against buffer capacity. The OpsPlanner orchestrator serializes overlapping operations, about a million per day, and enforces that hosts are upgraded before returning to production, with autostop and automatic offboarding as safeguards.
- Meta’s Infrastructure Evolution and the Advent of AI
Meta Engineering easyNoviceMeta's infrastructure grew from a LAMP stack with per-university databases to a global fleet of millions of machines. Along the way it added Memcache and TAO, edge POPs, a backbone network, cache-invalidation systems for cross-region consistency, and fleet systems such as Twine, Tectonic, ZippyDB, Shard Manager, Kraken, Taiji and Maelstrom. AI workloads changed those assumptions. Recommendation models brought GPUs into the fleet, and LLM training pushed synchronous jobs from 128 to thousands of GPUs, where one failure halts the whole job; Meta reports cutting the interruption rate by about 50x. It went on to build two 24k H100 clusters (InfiniBand and RoCE), a 129k-H100 cluster made by emptying five data centers, air-assisted liquid-cooled GB200 racks, AMD MI300 deployments, and its own MTIA silicon for ranking and ads inference.