This article discusses F3 Lightning, an infrastructure layer built on Meta's Facebook Feature Framework (F3) to improve the release process of machine learning features for ads ranking models. F3 Lightning decouples feature releases from shared execution, allowing independent deployment while preserving F3's efficiency gains by optimizing computation sharing at runtime through stable identifiers, a single execution plan, shared memory, and dense index mapping.
Read original on Meta EngineeringMeta's F3 (Facebook Feature Framework) handles over 20,000 features for ads ranking models, compiling them into a single merged Directed Acyclic Graph (DAG) to optimize computation by sharing common operations. While this approach was highly efficient, it created a significant bottleneck: the merged graph was also the release unit. A single error in any feature definition could block the entire release pipeline, leading to frequent failures and slow deployments as the number of features grew.
F3 represents feature extraction as a DAG where nodes perform work (e.g., reading input, filtering, aggregation) and edges define dependencies. Engineers author features independently, and the F3 compiler merges these into one graph, collapsing duplicate operations. This ensures shared work runs only once per request, saving significant CPU. However, this monolithic release unit meant all features shipped together or not at all.
Core Problem & Solution
Problem: Monolithic release of ML features due to shared execution graph led to frequent blockages. Solution: F3 Lightning separates release granularity (per feature) from execution efficiency (shared runtime).
F3 Lightning was designed to allow each feature to be independently compiled, validated, deployed, and rolled back. The main challenge was to achieve this without sacrificing the computational efficiency gained by F3's shared execution. This was addressed through a series of key optimizations:
These optimizations allow F3 Lightning to deploy ML features 3.6x faster than traditional F3, with no increase in infrastructure compute cost, significantly improving iteration speed for model development.