AI Lab: The secrets to keeping machine learning engineers moving fast
Meta's AI Lab is a pre-production framework that continuously runs shrunk, often CPU-only versions of common ML training workflows as A/B tests to measure time to first batch (TTFB), the delay from job submission to the first training batch. It catches regressions before release and lets infra owners validate improvements in under an hour. During the Cinder Python runtime rollout, it helped engineers double their TTFB gains, reaching up to 40%, for example by fixing memoization that triggered expensive repr() calls. It also caught an unrelated blocking-logging regression and attributed it to the specific change. To scale, it runs cheap tests on code changes and broader tests with bisect-style attribution on releases, flagging changes via t-tests, confirmation runs and ROC-tuned thresholds that cap false positives.
Related posts
- Ranking Engineer Agent (REA): The Autonomous AI Agent Accelerating Meta’s Ads Ranking Innovation
Meta Engineering easyNoviceMeta'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 mediumAdeptMeta'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.
- Capacity Efficiency at Meta: How Unified AI Agents Optimize Performance at Hyperscale
Meta Engineering easyNoviceMeta'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.
- DrP: Meta’s Root Cause Analysis Platform at Scale
Meta Engineering easyNoviceDrP 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%.
- 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.