Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 6 min read Case study easyNovice

Capacity Efficiency at Meta: How Unified AI Agents Optimize Performance at Hyperscale

Meta's Capacity Efficiency Program uses one AI agent platform for two jobs: finding performance optimizations (offense) and fixing production regressions (defense). The platform has two layers. MCP tools are single-purpose interfaces for querying profiling data, config history, code and docs, and skills encode senior engineers' reasoning about which tools to use and how to read the results. FBDetect catches regressions as small as 0.005%, and its AI Regression Solver turns root-caused regressions into fix-forward pull requests sent to the original author. On offense, agents turn efficiency opportunities into ready-to-review code. Meta reports that automated diagnosis cuts about 10 hours of investigation to about 30 minutes, and the program has recovered hundreds of megawatts of power.

Assumes: performance profilingLLM agentsModel Context Protocol

Related posts

  • How OpenAI’s Performance Factory keeps ChatGPT fast

    OpenAI mediumAdept

    OpenAI's Performance Factory is a cloud-based system of Codex agents that automates performance regression handling end to end, from alert to root cause, proposed fix, and verified recovery. It is built from four parts: a task service with Markdown/TOML-defined workflow states, a dispatch loop that assigns ready tasks to agents, an API running Codex turns inside the internal network under a service identity, and event subscriptions that wake tasks on PR comments or deployments. A separate adversarial-review agent tries to disprove each diagnosis and each proposed fix, and a shared `perf-forensics` skill encodes the team's investigation playbook. In about three months the workflow ran over 1,700 investigations and root-caused more than 600, and 70% of 100 sampled diagnoses were graded accurate. Fixes proved harder than diagnosis and still go through engineer review.

  • DrP: Meta’s Root Cause Analysis Platform at Scale

    Meta Engineering easyNovice

    DrP is Meta's root cause analysis platform that lets engineers codify incident investigation playbooks as "analyzers" using an SDK with helpers for anomaly detection, event isolation, time series correlation and dimension analysis. Analyzers are backtested in code review, chained across dependent services, auto-triggered by alerts, and run on a multi-tenant backend with a request queue and worker pool. A post-processing system annotates alerts and can open tasks or pull requests for mitigation. Used by 300+ teams with 2,000 analyzers running 50,000 analyses daily, DrP has cut MTTR by 20-80%.

  • Ranking Engineer Agent (REA): The Autonomous AI Agent Accelerating Meta’s Ads Ranking Innovation

    Meta Engineering easyNovice

    Meta's Ranking Engineer Agent (REA) runs ads ranking ML experiments end to end with little human involvement. It generates hypotheses, launches training jobs, debugs failures and iterates. A hibernate-and-wake mechanism lets it persist across multi-week training runs, and it draws hypotheses from a historical experiment insights database and a deep ML research agent. Engineers approve a GPU budget up front for a three-phase plan (validation, combination, exploitation), and a runbook of common failure patterns lets REA handle out-of-memory errors, loss explosions and infrastructure errors without escalating them. In its first rollout REA doubled average model accuracy over baseline across six models, and three engineers delivered launch proposals for eight models, work that previously took two engineers per model.

  • Leveraging AI for efficient incident response

    Meta Engineering mediumAdept

    Meta's AI-assisted root cause analysis system narrows suspect code changes in its web monorepo by combining a heuristic retriever with a fine-tuned Llama 2 (7B) ranker. The retriever uses signals such as code and directory ownership and the runtime code graph to cut thousands of changes down to a few hundred. The ranker then runs an 'election': each prompt holds up to 20 changes and picks the top five, and results are aggregated and repeated until five candidates remain. Backtesting shows the root cause lands in the top five for 42% of investigations at creation time. The biggest gain came from continued pre-training on internal artifacts plus supervised fine-tuning on about 5,000 historical RCA examples, including logprob-ranked list outputs, while confidence thresholds suppress low-confidence suggestions in favor of precision.

  • How Meta Uses AI Agents to Scale ML Innovations Across Ads Ranking Models

    Meta Engineering easyNovice

    Meta uses AI agents to propagate proven ranking-model techniques (e.g. Wukong layers, Interformer, training optimizations) across a large, heterogeneous fleet of ads ranking models, where a technique rarely transfers without adaptation. Agents handle discovery (ranking technique-model candidates by expected transferability), generalization (template-level and bespoke per-model adaptation learned from engineers), and adoption (launching multi-day training runs, narrowing hyperparameter searches, diagnosing failures, reallocating GPU capacity). Each stage is evaluated separately: precision/recall for discovery, scaled-down screening then NE and guardrails for generalization, and human-intervention counts for adoption. Agents now drive over 60% of propagation, with reported 3x engineer productivity, a median 4x training-compute reduction on select combinations, and an estimated $45M+ in compute savings.

The quest for software engineering knowledge.

Look:
Layout: