Cloud & infrastructure

Pipeline parallelism outperforms tensor parallelism for agentic LLM prefill

New benchmarks show pipeline parallelism sustains higher request rates than tensor or data-expert parallelism for agentic workloads with long contexts and relaxed latency targets.

Illustration of GPU chips with pipeline parallelism data flow
Illustration generated for this article

Researchers have identified that pipeline parallelism (PP) is more efficient than tensor parallelism (TP) or data-expert parallelism (DEP) for serving agentic large language model prefills. In tests running MiniMax-M3.1-Flash on two NVIDIA B300 GPUs, PP sustained significantly higher request rates under time-to-first-token targets of a few seconds.

What happened

The study reevaluates the role of pipeline parallelism in modern LLM serving architectures. Traditionally, engineers avoid PP for single-node deployments because it introduces pipeline bubbles, periods where GPUs sit idle waiting for data from previous stages. Tensor parallelism and data-expert parallelism are preferred because they keep all GPUs busy on every token, minimizing latency for individual requests. However, this conventional wisdom assumes that low latency is the primary constraint.

The authors argue that agentic workflows change this equation. In these scenarios, an agent processes a long, mostly cached context, adds a few thousand new tokens, and then spends seconds decoding or calling external tools. Consequently, a time-to-first-token (TTFT) target of a few seconds is acceptable. Under these relaxed latency constraints, throughput becomes the critical metric. The researchers found that by using asynchronous scheduling and a copy-engine stage hand-off to shrink pipeline bubbles, PP can outperform other methods in terms of sustained requests per GPU.

The experiments used vLLM to serve the MiniMax-M3.1-Flash model. The setup involved two NVIDIA B300 GPUs, the smallest configuration capable of holding the model's 250 GB checkpoint. The workload simulated agentic behavior: each request included a 100,000-token cached prefix and added between 7,500 and 12,500 new tokens. Requests arrived following a Poisson process to mimic real-world traffic patterns.

How it works

The performance difference stems from how each parallelism strategy handles synchronization. Tensor parallelism splits weight matrices across GPUs, requiring an all-reduce operation after every layer to combine partial results. This creates a fixed communication cost on the critical path for every layer, regardless of load. Data-expert parallelism, designed for mixture-of-experts models, assigns different experts to different GPUs. It requires token exchange between ranks in every MoE layer, causing delays when one rank has more work than the other.

Pipeline parallelism takes a different approach by splitting the model layers across GPUs. Hidden states move from one stage to the next only once per batch. While this introduces latency due to bubbles, the synchronization cost is incurred only at stage boundaries, not in every layer. With asynchronous scheduling, multiple batches can be in flight simultaneously, keeping all GPUs busy. As load increases, the relative impact of the initial bubble shrinks, allowing PP to utilize hardware more efficiently for bulk prefill operations.

The researchers implemented specific optimizations to make PP viable. They used a copy-engine stage hand-off to overlap data transfer with computation and employed a single scheduler for both stages to manage up to three batches in flight. These techniques reduced the idle time traditionally associated with pipeline parallelism, allowing it to compete with and eventually surpass TP and DEP in throughput-heavy scenarios.

Key details

  • PP2 sustained 23% more requests per GPU than DEP2 and 17% more than TP2 under a 2-second p50 TTFT target.
  • TP2 only led in performance under tight latency regimes, specifically at a 1-second p50 TTFT target.
  • At saturation, PP2 and DEP2 performed similarly, handling approximately 3.6 requests per second per GPU.
  • TP2 incurred a fixed communication cost of 6.3 microseconds per token, accounting for 18% of its total GPU time.
  • DEP2 performance suffered from rank imbalance, where one GPU waited for the other to finish processing unevenly distributed tokens.
  • The PP2 configuration used a layer split of 30 layers per stage and relied on FlashInfer TRTLLM-Gen kernels.

Why it matters

For engineers building agentic systems, this finding challenges the default assumption that tensor parallelism is always the best choice for prefill. If your application involves long contexts and can tolerate a TTFT of one to three seconds, switching to pipeline parallelism can significantly increase throughput without adding hardware. This is particularly relevant for cost-sensitive deployments where maximizing the utility of existing GPUs is a priority.

The results also highlight the importance of matching parallelism strategies to specific workload characteristics. Agentic workflows are distinct from chat interfaces because they involve heavy context reuse and delayed decoding. Optimizing for the wrong metric, such as minimal latency instead of sustained throughput, can lead to underutilized resources. Understanding these trade-offs allows infrastructure teams to tune their serving stacks more effectively.

Furthermore, the study demonstrates that software optimizations can overcome inherent architectural limitations. By addressing pipeline bubbles through asynchronous scheduling and efficient data hand-offs, developers can unlock performance gains from parallelism strategies previously deemed inefficient. This suggests that future serving frameworks may benefit from dynamic parallelism selection based on real-time workload demands.

What you can do

  • Evaluate your current TTFT requirements to determine if a target of a few seconds is acceptable for your agentic workflows.
  • Benchmark pipeline parallelism against tensor parallelism for your specific model and hardware setup using tools like vLLM.
  • Implement asynchronous scheduling and copy-engine hand-offs if you choose to use pipeline parallelism to minimize bubble impact.
  • Monitor rank imbalance in data-expert parallelism setups, especially if your request sizes vary significantly.
  • Consider using pipeline parallelism for prefill stages while potentially using other methods for decoding, if your framework supports hybrid approaches.
  • Test with realistic workloads that include long cached prefixes to accurately reflect agentic usage patterns.
  • #llm serving
  • #pipeline parallelism
  • #agentic ai
  • #vllm
  • #performance optimization

Tools from the Bytechap store

Keep reading

All stories