Skip to content

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

Meta Engineering 5 min read Case study mediumAdept

Modernizing the Meta Ads Service With an Open-Source Kernel Scheduler

Meta replaced the default Linux CFS/EEVDF scheduler on its ads serving fleet with a custom sched_ext BPF scheduling policy after EEVDF in kernel 6.6+ caused a latency regression that kept some hosts stuck on kernel 6.4. The policy soft-partitions CPUs into dynamically sized pools for latency-critical request threads and background work, improving L3 cache locality, and ships as a user-space loader so policy changes deploy by restarting a process rather than rebuilding the kernel. The initial launch cut ads retrieval p99 latency by 28%, saved 3.28 MW of power and raised ads ranked by 1.1%. Follow-on user-space policy updates delivered a further 60% p99 reduction and 18% fewer timeouts.

Related posts

  • Taming the tail utilization of ads inference at Meta scale

    Meta Engineering hardMaster

    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.

  • Kubernetes v1.37: DRA Updates

    Kubernetes Blog hardMaster

    Kubernetes 1.37 graduates DRA Extended Resource support to GA, letting DRA drivers satisfy classic extended-resource requests like `example.com/gpu` through a DeviceClass so existing workloads migrate without changes. Device taints and tolerations, per-device ResourceClaim status (including network interface IPs and MACs), and a standard `resource.kubernetes.io/numaNode` attribute are also stable. Workload-level ResourceClaims (removing the 256-Pod reservation cap) and a device-attributes Downward API move to Beta. New alpha features include CEL-derived attributes for pairing devices across vendors, device compatibility groups for MIG/vGPU partitions, optional node prepare calls, and a PreQueueingHint scheduler extension that cuts claim-event requeueing from O(N²) to O(1) and roughly doubles scheduling throughput in early benchmarks.

  • F3 Lightning: How Meta Accelerates Ads ML Features to Production at Scale

    Meta Engineering mediumAdept

    F3 Lightning decouples feature releases from shared execution in Meta's ads ML feature framework, so each of 20,000+ features is compiled, validated, deployed and rolled back independently instead of shipping as one all-or-nothing merged DAG. To recover the CPU efficiency lost when features stopped sharing computation, it uses content-derived stable node identifiers, a single startup-built execution plan flattened into an ordered list, one shared per-request memory buffer with a separate readiness vector, and dense integer slot indexing in place of hash lookups. Features reach production about 3.6x faster with no added compute cost. The broader lessons are to separate release boundaries from execution boundaries, to move request-invariant work to startup, and to treat memory layout and duplicate copies as costing as much CPU as redundant computation.

  • KernelEvolve: How Meta’s Ranking Engineer Agent Optimizes AI Infrastructure

    Meta Engineering hardMaster

    KernelEvolve is Meta's agentic kernel-authoring system that treats kernel optimization as a search problem instead of one-shot LLM code generation. Monte Carlo tree search and evolutionary strategies explore hundreds of candidate kernels across Triton, CuTe DSL, FlyDSL, CUDA, HIP and MTIA C++. Nodes use configurable memory operators that draw on parent, sibling or no history. A retrieval-augmented, self-updating knowledge base supplies hardware documentation and distilled optimization skills, and an evaluation harness (TritonBench, PyTorch Profiler, NCU, Proton, MTIA Insight) feeds diagnoses of memory-bound, compute-bound or occupancy limits back to the LLM. Results include over 60% inference throughput gain for the Andromeda ads model on NVIDIA GPUs and over 25% training throughput gain on MTIA, achieved in hours rather than weeks of expert tuning.

  • Kubernetes v1.36: More Drivers, New Features, and the Next Era of DRA

    Kubernetes Blog hardMaster

    Kubernetes v1.36 graduates several Dynamic Resource Allocation features: prioritized device lists go stable, and extended resource support, partitionable devices, device taints, binding conditions and resource health status reach beta. New alpha features include ResourceClaims for PodGroups, DRA-managed CPU and memory with NUMA awareness, a ResourcePoolStatusRequest for capacity snapshots, and list-typed attributes with intersection semantics and a CEL includes() function. Other alpha additions are deterministic lexicographic device selection and a standard protocol for exposing device metadata to containers as versioned JSON files via CDI bind-mounts. The project's stated goal is to migrate users from Device Plugins to DRA.

The quest for software engineering knowledge.

Look:
Layout: