arXiv:2609.17391cs.AISep 2026

Manuscript Offprint

arXiv:2609.17391

FlashVector: Agent for Hierarchical Model Serving Stack Optimization

Qi Wu, Lohan Lemire, Kai Meng, Zhongmou Cai, Raphael Bargues, Petr Zhitnikov, Zeyuan Cao, Yao Wang, Shujun Bian, Wei Chen, Sean Sheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Model serving is one of the largest cost drivers in production recommender systems. Maximizing its throughput requires navigating a deeply layered hierarchy: GPU kernels, the ML-framework computation graph, the model server, and on-demand feature processing—each demanding specialized domain expertise. Such cross-layer expertise is inherently difficult to acquire, and does not scale with a workload that continuously grows and evolves, leaving significant cost efficiency gains unrealized. While recent AI agents have demonstrated human expert level efficiency in standalone GPU kernel optimization, automated tuning and optimization for the rest of the serving stack remain largely unexplored. We present FlashVector, an agentic system that optimizes performance across all layers of the model serving stack. The key contribution is an extensible framework to generalize the single kernel optimization agent paradigm to heterogeneous technical stacks, and to deliver performance improvements holistically. After deployment in Unity’s Vector advertising platform, FlashVector achieved up to 2× throughput increase and up to 1.98× latency speedup on model server, and up to 1.6× throughput increase on feature store. These optimizations were discovered not only at the GPU kernel and computation graph levels, but also across the other components of the model serving stack, such as the model server (NVIDIA Triton’s C++ codebase) and the on-demand feature transformation service (Python codebase), demonstrating the extensibility of the framework to more complex system architectures.

1 Introduction

Deep learning models are an essential component of modern recommender systems [11][11] [19][19]. At Unity’s Vector advertising platform, DNN models are used throughout the funnel to retrieve candidates, estimate probability of conversion, and predict the long term monetization value. As one of the leading mobile game advertising solutions, Vector operates at scale. It manages hundreds of DNN models, and serves hundreds of thousands of inference requests per second in production.

Serving models at this scale (tens of thousands of GPU and CPU nodes) requires a complex distributed infrastructure, with data crossing multiple network hops, nodes, and devices. In a typical model serving architecture (e.g., Figure 1), clients split incoming requests into parallel calls to feature stores and model servers. Upon receiving feature-enriched requests, the model server employs dynamic batching strategies and parallel inference to maximize throughput. Once a batched request is generated, it is passed to an ML framework runtime (e.g., PyTorch), which traverses the execution graph and launches many GPU kernels that perform the mathematical operations. Multiple programming languages are typically involved—Golang, C++, Python, and CUDA, among others.

Figure

Figure 1: A typical model serving stack.

Optimizing this hierarchical serving stack has historically been challenging, as each layer demands distinct domain expertise. Client-side optimizations focus on request fan-out and parallelism. Within the model server, performance hinges on managing throughput-latency trade-offs through techniques such as dynamic batching and multi-process parallel inference, which interact directly with the ML framework runtime. Within the ML framework runtime, performance depends on proper computation graph configurations (e.g., PyTorch module structure, tensor layouts, operator selection, and minimizing host-device synchronization). Finally, low-level efficiency requires custom GPU kernel optimizations, such as kernel fusion, memory bandwidth tuning, and Tensor Core utilization. Without deep domain expertise across every layer, substantial cost efficiency gains often go unrealized.

Recent progress offers a partial answer to this gap. The emergence of kernel design agents [23] has significantly improved auto-generated GPU kernel efficiency, enabling teams without deep kernel expertise to deploy custom CUDA code. This motivates a broader question: Can we extend LLM-driven optimization from standalone GPU kernels to the entire model serving stack? In our experience, non-kernel layers contain just as many—if not more—optimization opportunities. A more efficient implementation within the model server or a better tuned runtime parameter can tremendously increase serving throughput. However, holistic stack optimization introduces new engineering challenges: discovering efficient code implementations, tuning the runtime parameter spaces, and finding optimal co-designs across both code and parameters.

In this paper, we present FlashVector, an agentic system that holistically optimizes the hierarchical model serving stack. This paper makes three contributions:

• A layer agent abstraction. Each serving layer plugs into the same optimization loop by conforming to a standard optimizing-agent interface: Profile (domain-specific tooling – Nsight for GPU kernels, eBPF for the model server), Diagnose (bottlenecks against a layer-specific knowledge base), Optimize (generate and apply the corresponding code or configuration change), and Verify (check the result against production evidence), plus a post-run Refine stage that writes findings back to the knowledge base.

• Optimize locally, verify globally. FlashVector proposes optimizations independently within each layer of the stack – GPU kernels, the computation graph, the model server, feature processing – so a bottleneck in any one of them can be found and fixed on its own. But a candidate is accepted only when it is shown to improve the system as a whole: every change is measured against replayed production traffic and load held at the production latency SLO, and kept only if the end-to-end gain exceeds the measurement noise.

• An always-on optimization loop. Serving optimizations decay with every retrain, traffic shift, and hardware refresh. Each run starts from the model’s recorded history of accepted and rejected changes and writes its own outcome back, and the loop re-triggers itself automatically rather than waiting to be invoked.

The remainder of this paper is organized as follows. Section 2 discusses related work. Section 3 outlines the key challenges in extending kernel optimization agents to full serving stacks. Section 4 details our system design and solution. Section 5 highlights several optimizations realized using FlashVector. Finally, Section 6 discusses broader implications and concludes.

References (26)