FLYING SERVING: On-the-Fly Parallelism Switching for Large Language Model Serving

Shouwei Gao, Junqi Yin, Feiyi Wang, Wenqian Dong

TL;DR

Flying Serving is an innovative, vLLM-based distributed inference system that enables large language models (LLMs) to dynamically switch between Data Parallelism (DP) and Tensor Parallelism (TP) on the fly. By virtualizing model weights and KV caches, it eliminates the need to restart workers or move data, allowing serving stacks to instantly adapt to traffic bursts, mixed request priorities, and long-context demands. This flexibility yields up to a 4.79× speedup under high load and a 3.47× speedup under low load compared to static configurations.

What Problem Does This Paper Address?

In production LLM serving, workloads are notoriously unpredictable. Systems face sudden traffic spikes, requests of wildly varying lengths, and mixed priority tiers. To handle this, operators typically choose between two primary distributed execution strategies:

  • Data Parallelism (DP): Replicates the model across multiple GPUs to process independent requests concurrently, maximizing overall throughput.
  • Tensor Parallelism (TP): Shards individual model layers across GPUs to collaborate on a single request, minimizing per-token latency and pooling memory for long-context sequences.

The fundamental problem is rigidity. Existing serving frameworks force engineers to commit to a static DP/TP configuration at deployment time. If a system configured for TP experiences a massive burst of short requests, it suffers from severe queue buildup. Conversely, a system configured for DP will choke on ultra-long context requests due to out-of-memory (OOM) errors. Overcoming this requires a system that can reconfigure its parallelism dynamically without the prohibitive overhead of restarting engines, reloading weights, or wiping out the KV cache.

Methods

Flying Serving introduces a middleware layer that virtualizes the engine state, turning mode switching into a lightweight, metadata-only operation that completes in just 15 milliseconds.

Figure 3: Overview of the Flying Serving architecture. The system functions as a middleware layer that orchestrates multiple engine workers, enabling dynamic transitions between DP and TP. The timeline on the right illustrates how the system adapts to different request types, such as high-priority, long-context, and latency-strict tasks, by reconfiguring workers from independent DP instances into cooperative TP groups on the fly.

The system achieves this through four core components:

  1. Zero-Copy Model Weights Manager: Instead of physically moving or reloading tensors during a mode switch, weights are loaded exactly once per engine. The manager creates logical, rank-aware virtual memory views over the full matrices (Megatron-LM style column/row parallel layers), instantly activating or deactivating specific slices on demand.
  2. KV Cache Adaptor: Changing the TP degree alters the per-device shape of the KV cache. To avoid expensive memory reallocation, Flying Serving uses Adaptive Block Sizing. It keeps the physical block size constant by scaling the number of tokens per block inversely against the TP degree, allowing seamless remapping in constant time.
  3. Eagerly Initialized Communicator Pool: Creating GPU communication groups (NCCL) at runtime can take seconds. Flying Serving pre-allocates and caches topology-aware, physically contiguous communication groups at startup, removing this bottleneck from the critical path.
  4. Dynamic Scheduler: Coordinates execution across engines using two adaptive switching strategies to handle execution skew:
  5. Soft Preempt: Speculatively runs pending TP requests in DP mode on available engines while waiting for straggling DP engines to finish, maximizing throughput.
  6. Hard Preempt: Instantly interrupts active DP execution to service high-priority TP requests. Crucially, the interrupted DP tasks retain their valid KV states within the unified memory pool and resume seamlessly afterward.
Figure 4: Model Weights Manager architecture for zero-copy DP/TP switching.

Datasets

The authors evaluated Flying Serving using three popular open-source datasets representing distinct production use cases:

  • ShareGPT: Conversational chat-based assistance.
  • CodeActInstruct: Code-centric instruction following.
  • HumanEval: Program synthesis.

To stress-test the system's dynamic adaptability, they synthesized a production-like workload trace. Request lengths spanned [128, 4000] input tokens and [64, 512] output tokens, with traffic fluctuating between low-load periods (2–5 req/s) and high-load bursts (10–30 req/s).

Key Insights and Ideas

  • Virtualization Over Migration: The major "aha!" moment is that physical data movement is entirely unnecessary for parallelism switching. By decoupling the logical execution view from the physical memory layout, both weights and KV caches can remain static while the system changes how it indexes them.
  • Constant-Size Memory Blocks: Leveraging the mathematical inverse relationship between local hidden dimensions and token capacity allows PagedAttention blocks to remain perfectly aligned across modes, bypassing the need to rebuild memory pools.
  • Coexistence of Layouts: Because different logical KV layouts can safely coexist in the same physical memory pool, advanced scheduling primitives like distributed hard preemption become possible without incurring recomputation penalties.

Key Results

The system was evaluated on an 8× NVIDIA H200 GPU node across three models: Llama-3 (70B), GPT-OSS (120B MoE), and Nemotron (8B, 4M long-context).

  • Latency Reduction: During high-load bursts, Flying Serving dynamically switches to DP to drain queues, reducing P90 Time-to-First-Token (TTFT) by up to 4.79× compared to static TP.
  • Throughput Preservation: It retains 95–96% of the peak throughput of a pure static DP configuration while delivering near-TP per-token decoding latencies.
  • Massive Speedup in Reconfiguration: Traditional static re-sharding requires a cold restart taking 146 to 292 seconds. Flying Serving executes live switches in 15 ms—a ~10,000× speedup.
  • Context Scaling: By dynamically pooling GPU memory, it scales context capacity up to 1.9M tokens, a 7.2× increase over a static 4DP×2TP baseline.

Limitations and Future Work

The primary limitation acknowledged by the authors is that Flying Serving is currently optimized for intra-node parallelism (e.g., within a single multi-GPU server like an 8× H200 node). It assumes that the model weights and the necessary KV cache can be managed within a single node's memory hierarchy.

Extremely large models that require multi-node tensor or pipeline parallelism are currently out of scope. The authors note that extending their dynamic reconfiguration protocol to handle inter-node communication topologies is a promising direction for future research.

Summary updated

BibTeX
@inproceedings{gao2026flying,
  author = {Shouwei Gao and Junqi Yin and Feiyi Wang and Wenqian Dong},
  title = {{FLYING SERVING: On-the-Fly Parallelism Switching for Large Language Model Serving}},
  booktitle = {ICS},
  year = {2026},
  doi = {10.1145/3797905.3800525},
}
Figure