r/RedditEng • u/s9g12 • 1d ago
Building Reddit's Inference Platform for AI at Scale
Cedric Blondeau, Principal Machine Learning Engineer
TL;DR
Gazette is Reddit’s ML Platform. It serves more than 4 trillion predictions a day and powers AI experiences across Feed, Notifications, Search, and Ads. As prediction volume quadrupled and models grew larger, our inference stack struggled to keep pace: service overhead held back GPU efficiency, costs grew faster than traffic, and the train-to-serve process was error-prone, with deployments taking hours.
In less than two years, we rebuilt the platform to support newer model architectures, including LLMs, and richer feature inputs. We 100×’d per-GPU throughput for some models and cut deployment times from hours to minutes. A new control plane and UI streamline the train-to-serve process, while AI-assisted benchmarking and profiling help surface bottlenecks and opportunities. Here’s how we did it.
Scaling For Unprecedented Growth
Supporting AI/ML growth for one of the most visited websites in the world isn’t an easy task. In the last two years alone, platform users and models have multiplied. Prediction volume grew 4×, model parameter counts grew 4×, and models processed up to 5× more input data. Some also began using sequence features and larger embeddings, making their inputs more demanding to prepare and transfer.
Today, Gazette Inference - Gazette’s inference stack - serves more than 4 trillion predictions a day.

Our previous inference stack was built for a different era: CPU serving, where each ranking request was split into many tiny requests and fanned out across a fleet of machines. As features and models grew, the service wasn’t scaling and costs were growing faster than traffic with many bottlenecks blocking efficient GPU serving adoption.
It was also built around a single stateful service with few abstractions. As we grew, shipping a new model meant redeploying thousands of Kubernetes pods. Engineers had to queue and wait hours for their turn. Model configs listed every feature by hand, thousands of lines at a time, and landing a single change could take a full day.
It wasn't sustainable. So we rebuilt it, from the ground up. In less than two years, Gazette Inference went from a system straining at its limits to a redesigned platform running at a scale we wouldn't have believed back then: efficient GPU serving across many models, self-hosted LLMs, deploys in minutes, a UI for every step of a model's life, and AI agents in the loop. Here's how we did it.
GPU Serving At Scale: One Bottleneck After Another
Last year, we wrote about moving our flagship model, the Home Feed ranker, from CPU to GPU. It cut the Home Feed's serving costs by 10×, and it taught us the rule of the game for GPU serving: cut as much data transfer and processing work as possible around the model, have the GPUs spend their time running large optimized kernels and we get the most out of our sacred GPU resources.
Every model that followed onto GPUs taught us the same lesson. Each time we removed one bottleneck, the next one showed up, and each one we removed brought massive gains.
1️⃣ Step 1: Rewriting the Inference Service, all of it. Gazette Inference Service (GIS) is our inference engine: for every request, it fetches features, transforms them, and batches and routes inference requests to the right model servers. It was built for a CPU world of many tiny requests and very few features. Its own overhead dominated: even with small batches, latency ran over our SLOs. That created a chicken-and-egg problem. To stay within SLOs, clients had to send small batches, which left the GPU little time for dynamic batching or model exec. That simply didn't scale.
So we rewrote it from scratch, optimizing every processing path and cutting unnecessary protobuf conversions and serialization round trips.

The new service processes 500-row requests 11.5× faster with 44× fewer memory allocations, and the gap grows with batch size. Not only is it much cheaper and faster, it also directly leads to higher GPU efficiency: when large requests are cheap for the service, and clients can send bigger batches, we multiply the returns of dynamic batching and GPU runs bigger executions.
2️⃣ Step 2: Input packing (aka Sixpacks). With service preprocessing out of the way, the bottleneck moved to preparing tensors for the GPU. Some of our models (e.g. Ad heavy rankers) take more than 600 features, each defined as its own input in Triton Inference Server. Profiling showed the server spending a lot of time gathering each input and copying it from host to device, one by one.

A solution emerged: packing inputs together into a few contiguous buffers. It cut processing time and took our GPU utilization to another level. For our Ad heavy rankers, throughput per GPU grew 7×, p99 latency fell by more than half, and GPU utilization went close to 100%. We called it Sixpacks: it packs 600+ inputs into a few input packs, so it's a six-pack. Get it? 😅

3️⃣ Step 3: Making every kernel count. With the GPU finally fed, model execution becomes the next big opportunity. High GPU utilization may suggest little is left, but this metric only counts the time some kernel is running, not how much of the chip it uses, and that gap is where the next gains came from.
Exporting models with AOTInductor (AOTI) instead of TorchScript helped us produce more optimized graphs. Rewriting model graphs so layers could be fused cut the number of kernels per execution, reducing launch overhead and memory traffic. TF32/BF16 put the GPU's Tensor Cores to work on matrix multiplications. And with inference service in front, bigger batches meant bigger executions and multiplied returns from dynamic batching.

Each step multiplied the last: for one of our heaviest ranking models with 600+ features, throughput per GPU grew more than 100× from where we started, with SM activity and occupancy finally nearing capacity.
4️⃣ Step 4: From heroic one-off investigations to continuous, automated agentic profiling. Each of these wins took weeks of work, one model at a time, while the number of models on GPUs grew significantly over the last few months. We needed to democratize efficient GPU serving in order to scale.
So we built Gazette Benchmarks. Engineers and AI agents can benchmark any model on prod-like hardware, find its best configuration within a latency budget. Behind the scenes we run load tests, generate GPU profiles and map CUDA kernels to operations in the model code. An AI summary then points to bottlenecks, parameters to test, or model code to change. Very quickly, the system pointed out opportunities, some leading to significant performance improvements. What used to take us weeks of profiling is now an automated analysis and tuning loop.


From Hours To Minutes, From Manual To Automated
Efficient GPU serving at scale made SOTA modeling accessible without breaking the bank. Our other key objective was to shorten the train-to-serve loop, so ML engineers could ship models to production and experiment quickly, simply, and with as few manual steps as possible.
The old platform couldn't get us there. Shipping a model meant redeploying the inference service itself, through a single queue shared by every team, and configs listed every feature by hand. It was error-prone and ended up taking hours at scale.

We redesigned the platform end to end, around three principles:
1. Decouple ML from Infra concerns. ML engineers own models. The platform owns how they run: serving, routing, scaling, and releases. With infra out of the way, shipping a model becomes a routine, safe, automated task, and it never waits on a platform release: the inference service discovers model servers at runtime, so adding a model never redeploys it.
2. Automate correctness and deployments. A control plane turns what's in the registry into running model servers. Instead of relying on humans to catch issues, the platform checks correctness at every step in the train-to-serve flow. AI agents take on the simple workflows around it, taking repetitive work off engineers' plates and shortening feedback loops.
3. Gazette UI and the Gazette CLI as the platform entry points. For everything, from tracking and debugging a model to deploying it to production.

The gains have been substantial:
- Faster deploys. Deployment times went from multiple hours or the full day to a few minutes.
- Higher productivity. Daily model serving deployments more than doubled in just a few months, in large part because shipping got so much easier.Simpler. Deploying or retiring a model used to be a string of manual steps, with humans and Jira tickets in the loop. Now it's a click in the UI, automation takes care of the rest. Configs went from thousands of lines to just a few.
- Safer. A model's inputs come from its contract in the registry, with types and shapes derived from the feature store's metadata and the exported model. Mismatched inputs, once a source of incidents, are now impossible by design.
- Cheaper. Automated decommissioning and scaling to and from zero saves significant resources.

Bringing LLMs In-House
Last but not least, the same platform now serves our own LLMs supporting Reddit’s AI experiences such as AI Search. Self-hosting gives us a reliable and cost-efficient alternative to third-party APIs, and resilience against changing models, pricing, and SLOs.
A GenAI app is rarely a single LLM call, so we also built scatter-gather services that fan a request out to many models, ours and third-party, and combine the results into one response. They power experiences like AI Search and contribution tools, and let teams build new GenAI features by wiring models together instead of rebuilding the plumbing.
Then, we made open-weight models as easy to try as commercial ones. Evaluating one used to take a day or two of setup before the first prompt: provisioning GPUs, standing up model servers, and wiring up clients. Now open-weight models are available through a unified LLM platform. Teams opt in and get access in minutes. They can then compare open-weight and commercial models side by side.

Closing Thoughts
In under two years, Gazette Inference went from a system straining at its limits to a platform built for what comes next. Some models now cost an order of magnitude less to serve, and costs grew far slower than predictions and model complexity, making room for ML to grow. Deploys went from hours to minutes, the platform got simpler, and productivity is increasing.
But we're never done. Every bottleneck we remove reveals the next one, and the bar keeps moving. Millions of parameters used to be the standard; next come billions, then trillions. Every efficiency gain flattens the cost curve and makes room for bigger, better models. GPUs and their capabilities keep changing, and inventory and capacity are still a major challenge, so the platform has to get the most out of whatever we have.
If pushing these limits to make Reddit better sounds like fun to you, we’re hiring.





















































































