TL;DR
Foundry tackles the massive cold-start latency in Large Language Model (LLM) serving caused by CUDA graph capture, which frequently takes minutes for large models. By materializing both the graph topology and its execution context offline, Foundry reconstructs executable graphs online in seconds. It slashes initialization time for a 235B parameter Mixture-of-Experts (MoE) model from 10 minutes to just 3.9 seconds without sacrificing serving throughput.
What Problem Does This Paper Address?
To handle highly unpredictable traffic spikes, modern LLM serving frameworks rely on autoscaling and dynamic parallelism reconfiguration. While recent optimizations have reduced model weight loading times to just a couple of seconds, a new bottleneck has emerged: CUDA graph capture.
CUDA graphs are essential for high-performance LLM decoding because they group independent GPU kernel launches into a single unit, eliminating CPU-side launch overhead. However, capturing these graphs requires a time-consuming "warmup" forward pass. For large models, this capture phase can take tens of seconds to several minutes, severely hindering elasticity.
Naively saving (serializing) these graphs to disk to reload them later doesn't work. A CUDA graph is tightly coupled to its specific execution context—it embeds hardcoded device memory addresses and references kernel functions that are lazily loaded into memory. Existing workarounds either rely on brittle, hand-crafted patching rules that break when libraries update, or heavyweight process-level checkpointing that produces massive file sizes and fails during dynamic parallelism switching.
Methods
Foundry introduces a template-based CUDA graph context materialization system divided into an offline SAVE phase and an online LOAD phase.
- Deterministic Memory Layout: Foundry intercepts CUDA memory allocation requests using Virtual Memory Management (VMM) APIs. It places allocations contiguously from a fixed base address, ensuring that the memory layout is identical across different runs. This eliminates the need to patch embedded pointers.
- Binary Extraction and Reload: During the offline phase, Foundry automatically extracts the compiled kernel binaries (
cubin) from shared libraries. Online, it preloads these binaries, bypassing lazy loading and JIT compilation overhead entirely. - Topology-Based Templating: Instead of reconstructing hundreds of graphs for different batch sizes, Foundry groups graphs that share the same structural topology. It instantiates a single template graph and uses fast, in-place driver updates (
cuGraphExecUpdate) to modify per-node parameters on demand. - Inter-Rank Graph Sharing: For distributed serving (SPMD-style parallelism), Foundry uses a stub layer to emulate communication on a single GPU during offline capture. Online, it patches rank-dependent communication handles, allowing a single-GPU offline run to serve an entire multi-GPU cluster.
Datasets
The authors integrated Foundry into the popular vLLM inference engine and evaluated it across several production-grade open-source model families:
- Dense Models: Qwen3-14B, Qwen3-32B, Llama3-8B, and Gemma3-12B.
- Mixture-of-Experts (MoE) Models: Qwen3-30B-A3B and Qwen3-235B-A22B.
Evaluations were performed on state-of-the-art hardware setups including NVIDIA H200 (Hopper) and B200 (Blackwell) GPU nodes, utilizing Data Parallelism (DP) and Expert Parallelism (EP) across both BF16 and FP8 precisions.
Key Insights and Ideas
- Exploiting Memory Monotonicity: LLM serving engines allocate large, long-lived objects (like weights and KV caches) once at startup. Because this sequence is highly predictable, simple pointer-bumping via VMM APIs guarantees a deterministic layout, making the solution entirely library-agnostic.
- Topological Regularity: Even though an inference engine might capture hundreds of graphs to support different batch sizes, they collapse into a tiny number of unique topologies (e.g., only 12 templates for a 235B MoE model). Updating an existing template in-place is up to 20× faster than building a new graph from scratch.
- Decoupling Multi-GPU Capture: Because distributed ranks follow identical computation flows, multi-GPU setups don't need multi-GPU offline profiling. Dummy communication stubs allow a single GPU to generate portable templates for the whole cluster, drastically lowering offline preprocessing costs.
Key Results
- Up to 99% Cold-Start Reduction: For the massive Qwen3-235B-A22B model on an 8×H200 setup, initialization time dropped from 10 minutes (650s) to just 3.9 seconds.
- Throughput Preservation: Reconstructed graphs achieved identical Time Per Output Token (TPOT) performance compared to native, freshly captured CUDA graphs, ensuring zero performance degradation.
- Storage Efficiency: Foundry's portable archives are 4–5× smaller than process-level checkpoints (e.g., 1.1 GB vs 3.7 GB for Qwen3-14B) because they only store essential metadata and binaries.
- Baseline Comparison: Foundry consistently outperformed NVIDIA's
cuda-checkpointutility by 2.6–4.4× in restoration speed.
Limitations and Future Work
- Pipeline Parallelism (PP): Foundry currently does not support Pipeline Parallelism. In PP, different ranks execute entirely different stages of the model, meaning they do not share a common graph topology across ranks.
- Future Directions: The authors note that extending the framework to handle hybrid parallelism strategies that include PP, or adapting to highly dynamic execution flows that alter graph topologies, represent promising future engineering directions.
Summary updated