Manuscript Offprint
arXiv:2610.21815Exact Makespan Bounds and the GPipe Homogeneity Bias for Heterogeneous LLM Inference Pipelines
Abstract
We give an exact, critical-path-based characterization of the makespan of micro-batch pipelines that serve large language models (LLMs) on heterogeneous GPU clusters, and use it to quantify exactly how the classic homogeneous GPipe formula errs. In the pure-forward, communication-free, infinite-buffer setting, the makespan is exactly , where is the per-micro-batch service time of pipeline stage , its maximum, and the number of micro-batches (Theorem 1). Under asynchronous communication — the regime of modern NCCL-based serving systems — the expression extends to , where enters purely as an additive constant (Theorem 2); under blocking communication, with , so communication enters the steady-state slope iff some (Theorem 3). These results (i) quantify exactly how the classic GPipe homogeneous formula overestimates makespan, (ii) decompose that bias into a homogeneity-overestimate term and a communication-ignoring underestimate term , and (iii) sandwich any partially-overlapped real system between the two extremes, yielding a computable ceiling on the throughput gain from communication-compute overlap. Every formula is validated point-wise against the exact dynamic-programming recurrences (maximum relative error across randomized and hand-crafted configurations, zero counterexamples), and the bias decomposition and sandwich are additionally checked against 8,571 measured requests from a live, three-generation heterogeneous GPU cluster.
1 Introduction
Pipeline parallelism (PP) is the standard mechanism for serving and training large language models whose parameters exceed the memory of a single accelerator. The foundational GPipe analysis [1] assumes homogeneous stages — every stage processes a micro-batch in the same unit time — yielding the well-known makespan (in units of per-stage time) and bubble ratio for S stages and M micro-batches. This formula, and its variants, remain the default mental model in much of the systems literature for reasoning about pipeline efficiency.
Real inference deployments violate the homogeneity assumption in two distinct ways, both of which matter in practice.
Heterogeneous accelerators. A single cluster frequently mixes GPUs of different generations. The motivating deployment behind this work spans an RTX 5090 Laptop (24 GB GDDR7, Blackwell), dual RTX 3090 (24 GB GDDR6X, Ampere), and a GTX 1070 (8 GB GDDR5, Pascal) within one cluster — three generations, with the GTX 1070 lacking tensor cores entirely. The resulting per-stage time ratio depends on which resource binds: for memory-bound decode it is the bandwidth ratio (896 / 936 / 256 GB/s, roughly 3.5×), while for compute-bound prefill the tensor-core-less GTX 1070 is up to three orders of magnitude slower (FP16 ≈ 0.1 TFLOPS vs ≈ 142 TFLOPS on the RTX 3090). Assigning each pipeline stage its own device therefore yields per-stage times that differ by an order of magnitude or more, not by one. Under such ratios the homogeneous formula is not merely an approximation — it is systematically wrong.
Non-zero communication latency. Stages exchange activations and KV cache over PCIe, NVLink, or Ethernet with non-zero per-transfer latency . Depending on the runtime, this transfer either overlaps with computation (asynchronous, the NCCL/CUDA-stream regime) or blocks the stage (synchronous). The two regimes produce qualitatively different makespan behavior, as we show.
The correct makespan of such a pipeline is the critical-path length of the resulting schedule — a quantity that is classical in flow-shop scheduling [2, 3]. Its exact value, however, and in particular its consequences for heterogeneous LLM inference, have to our knowledge not been stated explicitly in the serving-systems literature, which largely works with asymptotic or heuristic treatments. This paper makes three things explicit and rigorously verified:
-
The exact bias of the classic homogeneous GPipe formula, decomposed into a homogeneity-overestimate term and a communication-ignoring underestimate term , together with a phase transition condition under which communication flips from an additive constant into a throughput bottleneck (Corollaries 1–4).
-
An exact, critical-path-based characterization of the makespan under three communication regimes — communication-free (Theorem 1), asynchronous (Theorem 2), and blocking (Theorem 3) — each proved by a sandwich argument. These formulas are the classical flow-shop critical-path length instantiated for heterogeneous LLM inference; the novelty is the instantiation and its consequences, not a new lower-bound technique.
-
A computable sandwich on the makespan of any real, partially-overlapped system, which yields a closed-form upper bound on the throughput gain achievable by communication-compute overlap — turning the informal “overlap helps” into a quantifiable ceiling.
The setting is deliberately restricted to the pure-forward, infinite-buffer, micro-batch fill-drain pipeline: stages process micro-batches in a fixed linear order, with no backward dependencies (unlike training) and no buffer limits. This is the structure of pipeline-parallel (PP) inference, where a forward-only stream of micro-batches — requests, prefill chunks, or the per-step tokens of a decode batch — flows through the stages. The per-micro-batch time is therefore a service time, memory-bound in decode and compute-bound in prefill, not a raw FLOP count. Extensions — bandwidth-limited communication, bounded buffers, and prefill-decode interleaving — are discussed in §10 and remain open.
The rest of the paper is organized as follows. §2 defines the system model and notation. §3–§5 state and prove the three theorems and their corollaries. §6 draws out the optimization implications. §7 reports numerical validation. §8 positions the work against flow-shop scheduling and LLM systems. §9 discusses the sandwich bound in the context of real deployments. §10 states limitations honestly. §11 concludes. Appendices collect proof details, the full validation configuration table, and reproducibility instructions.
Communication. After stage finishes a micro-batch, the result is sent to stage with latency (). The last stage sends nothing. We distinguish three regimes, which will each be analyzed separately:
-
Communication-free (): transfers are instantaneous (e.g., stages co-located in shared memory with zero-copy).
-
Asynchronous: the send does not block the stage from serving the next micro-batch; the transfer proceeds in the background on a separate CUDA stream (the cudaMemcpyAsync / NCCL point-to-point regime). This is the default in modern serving runtimes.
-
Blocking: the send occupies the stage and cannot overlap with serving (a synchronous cudaMemcpy, or a single stream with no overlap). Stage 's total per-micro-batch service time is then .
Recursion. Let be the completion time of micro-batch at stage . For the asynchronous regime the recursion is
with boundary . The makespan is . We write and let be a bottleneck stage (ties broken arbitrarily). For the blocking regime the recursion collapses to
where for and ; this is exactly Eq. (1) with and replaced by .
Notation summary.
| Symbol | Meaning |
|---|---|
| number of pipeline stages | |
| number of micro-batches | |
| service time of stage for one micro-batch | |
| communication latency from stage to | |
| bottleneck stage time and its index | |
| effective service time under blocking communication | |
| makespan (completion of the last micro-batch at the last stage) |
Assumptions. The analysis holds under five conditions, each made explicit so that violations map cleanly onto the open extensions of §10: (A1) pure-forward (no backward dependency); (A2) infinite buffers; (A3) in-order fill–drain; (A4) constant per-stage times independent of ; (A5) point-to-point communication between adjacent stages only.
3 Theorem 1 — Communication-Free Closed Form
Theorem 1. In the communication-free setting , for all ,
Proof. (critical-path sandwich) We prove a matching lower and upper bound.
Lower bound. Consider any valid schedule. Stage must process all micro-batches serially, consuming of processor time on ; these operations cannot overlap in time. Before the first micro-batch can be processed at , it must traverse stages , costing at least . After the last micro-batch is processed at , it must traverse stages , costing at least . These three time spans are pairwise disjoint on the timeline (a single micro-batch experiences them sequentially, and the bottleneck's operations bracket the traversal of all others). Hence
Upper bound (attainability). We prove the upper bound by strong induction on the number of stages . Base case (): there is no communication and . Inductive step (). Let and run the greedy ASAP schedule (every stage starts a micro-batch the moment it is idle and the micro-batch has completed the previous stage). If , the source stage works continuously for and the last micro-batch drains in , attaining the bound. If , the upstream sub-line has stages, so by the induction hypothesis it delivers micro-batch to by time with ; since spends exactly per micro-batch, the arrival rate is never below its service rate, so never idles after the first micro-batch arrives. Symmetrically, the downstream sub-line (empty if ) drains the last micro-batch in . The schedule is feasible and achieves
Lower and upper bounds coincide.
A complete, alternative derivation via direct solution of the recurrence (1) with is given in Appendix A.1; it confirms the same value without the ASAP-schedule argument.
Corollary 1. (bias of the classic formula) Interpreting the classic GPipe formula as the homogeneous value obtained by assigning every stage the bottleneck time ( ), it gives , and
i.e., the classic formula systematically overestimates makespan (equivalently, underestimates throughput), with the gap equal to the total shortfall of each stage relative to the bottleneck. The gap grows monotonically with heterogeneity, is zero iff all stages are perfectly balanced, and — critically — is independent of M: it is a one-time fill cost, not a throughput penalty.
3.1 Illustrative example
To make the formula concrete, walk through the illustrative 4-stage partition 5090/3090/3090/1070 with ( , bottleneck at the tail, ). For a single micro-batch ( ) the makespan is simply the sum of stage times:
The classic formula instead predicts , overestimating by . At the closed form gives against , a 29.4% overestimate. The absolute gap is constant , so its relative impact shrinks as grows — the classic formula’s error is purely a fill-time artifact, exactly as Corollary 1 states. This one number — 166.7% at — is the headline empirical motivation: a partitioner trusting the homogeneous formula at low micro-batch counts over-provisions capacity by more than a factor of two.
4 Theorem 2 — Asynchronous Communication Extension
Theorem 2. Under asynchronous communication, for all ,
Proof. (critical-path sandwich)
Lower bound. Consider the critical path through the bottleneck stage . Stage must process all micro-batches serially, consuming . The first micro-batch traverses stages before reaching , paying : on the first micro-batch's path, its own computation and its transfers are serialized (a transfer of micro-batch 0 from stage to cannot begin until stage has computed it, and stage cannot compute it until the transfer ends). After the last micro-batch leaves , it traverses stages , paying . These three phases are pairwise disjoint on the timeline, and every valid schedule must contain them on some critical path; hence
Upper bound (attainability). We prove the upper bound by strong induction on the number of stages . Base case (): there is no communication and . Inductive step (). Let and run the fill-drain schedule (micro-batches released in order , every stage ASAP). If , the source stage works continuously for and the last micro-batch drains through stages in , attaining the bound. If , the upstream sub-line has stages, so by the induction hypothesis (Theorem 2 for stages) it delivers micro-batch to — that is, completes stage and its send — by time with . Because sends are asynchronous, an upstream stage's service period is exactly (transfers run in the background on a separate stream, consuming memory bandwidth but not SM compute), so this arrival bound carries no slowdown from the sub-line's own transfers beyond the additive already accounted for. We then prove by induction on that : the base case
holds, and for the arrival time is at most — the moment becomes free — so never idles and the claim follows. Symmetrically, the downstream sub-line (empty if ) drains the last micro-batch in exactly . The makespan is therefore
Lower and upper bounds coincide.
Corollary 2. (communication is additive) The total communication latency enters only as an additive constant and does not change the steady-state slope . Consequently, reducing communication lowers only the one-time fill cost, while the throughput ceiling ( ) is governed by compute balance alone.
Corollary 3. (full bias decomposition) Combining Theorem 2 with the classic formula:
When , the classic formula underestimates makespan — a sign reversal absent from the communication-free case. This quantifies precisely when the homogeneous formula’s optimism about communication outweighs its pessimism about heterogeneity.
5 Theorem 3 — Blocking Communication Extension
Theorem 3. Under blocking communication — where sending a micro-batch occupies the stage and cannot overlap computation — define the effective service time for and (the last stage sends nothing), with . Then for all ,
Proof. Under blocking communication the send and the compute occupy the same stage serially, so stage 's total service time for a single micro-batch is exactly . Substituting into the recurrence (1), the blocking regime becomes recurrence (2), which is identical in form to the communication-free recurrence (Theorem 1) with replaced by . The reduction is therefore exact: the blocking pipeline is a communication-free pipeline whose stage times are . Theorem 1 applies verbatim, yielding
The equality with follows because .
Corollary 4. (communication enters the steady state — a phase transition) Since , communication affects the steady-state slope iff , i.e., iff some . Contrast Theorem 2, where the slope is always regardless of : blocking communication turns a cost that is a pure additive constant (async) into a throughput bottleneck once it exceeds the compute slack . The slack is smallest for the stage just below the bottleneck, so a slow link out of that stage is the first to degrade throughput.
Corollary 5. (async-blocking sandwich bounds the overlap gain) Because and , we have , hence
A real serving system with partial overlap (NCCL async with non-zero synchronization points) has makespan , so the gap is exactly the upper bound on the throughput gain available from communication-compute overlap. With an overlap ratio (the fraction of transfer time that overlaps compute; is the fully-async ideal), the effective steady-state slope is , interpolating linearly between the two extremes: recovers the async slope , the blocking slope .
6 Optimization Implications
Theorems 2–3 yield an actionable priority ordering for heterogeneous inference pipelines. We state the ordering informally, then formalize the central claim as Proposition 1.
-
Balance compute first. The steady-state throughput is ; minimizing (via automatic layer-to-GPU partitioning) is the primary lever. This formalizes why “compute-as-one-network” utilization gains must come from partition balance rather than link tuning.
-
Communication is a fill-time cost. Optimizations such as shared-memory zero-copy or binary KV encoding reduce , which improves latency for small M but has diminishing return on steady-state throughput as M grows.
-
Heterogeneity-aware scheduling. With per-stage known, the bias quantifies how far a given partition is from homogeneous — a concrete, differentiable-in-spirit objective for the partitioner.
-
Overlap is a bounded lever. Theorem 3 bounds the total gain from communication-compute overlap (CUDA streams / NCCL async) at ; once holds everywhere, link optimizations cannot beat balancing compute.
Proposition 1. (throughput is compute-balanced regardless of link budget) In the asynchronous regime, for any fixed partition, the asymptotic throughput as depends only on the bottleneck stage time and not on any . In the blocking regime the asymptotic throughput is , and the two coincide iff for all .
Proof. Immediate from Theorems 2 and 3 by dividing by M and taking the limit.
Proposition 2. (bottleneck position is irrelevant to makespan) In the communication-free and asynchronous regimes, the makespan depends on the bottleneck only through , not on its position . Reordering stages so as to move the bottleneck therefore does not change (hence not the steady-state throughput); it changes only the first-micro-batch latency.
Proof. The closed forms of Theorems 1 and 2 contain only via , and and are invariant under stage reordering.
This is a subtle but consequential point: under infinite buffers, the order of a heterogeneous chain is immaterial to total makespan. The optimization effort should therefore target itself — splitting the layers assigned to the slowest device and redistributing them to faster devices — rather than repositioning the bottleneck within the chain. (The statement does not extend to the blocking regime: there, depends on which stage carries which link, so position matters once communication exceeds slack.) Together with Proposition 1, this gives a clean two-phase optimization rule: (i) first reduce by rebalancing the partition (the dominant term in the slope); (ii) only then, if the remaining compute slack is smaller than the link latency on some stage, invest in overlap or link bandwidth for that stage — and only for that stage.
Crossover from fill- to steady-state dominance. The makespan decomposes into a fill cost and a steady-state term . The two balance at the crossover micro-batch count
below which the fill cost dominates the total and above which the steady-state throughput is approached. This is a smooth crossover, not a phase transition — unlike the communication phase transition of Corollary 4, which is discontinuous in slope. It nonetheless carries practical force: a serving batch should be sized at or above for the asymptotic throughput to be a good model. For the illustrative partition , , so even a handful of micro-batches suffices.
7 Numerical Validation
7.1 Validation against exact recurrences
We validate Theorems 1–3 against the exact dynamic-programming recurrences (1) and (2), which are evaluated directly (no closed form assumed). For each configuration we compute for and compare against the closed forms; the maximum relative error across all configurations is , and in fact the ratio agrees with 1 to all printed digits (1.0000) at every point.
Hand-crafted configurations. Table 2 (Appendix B) lists eleven configurations designed to stress the theorems: homogeneous and heterogeneous ; uniform and non-uniform ; communication far below, near, and far above the compute slack; bottleneck at head, middle, and tail; twin (tied) bottlenecks; and a near-bottleneck stage adjacent to a slow link (the configuration most likely to reveal a phase-transition error in Theorem 3). Every configuration is validated in both the asynchronous and blocking regimes.
Randomized fuzz. Beyond the hand-crafted set, we ran a randomized search for counterexamples: random configurations, each with stages, drawn from a log-uniform distribution over two decades (to capture order-of-magnitude heterogeneity), and drawn to range from to the compute, evaluated at 8 values of points in total. We found zero violations of Theorems 2–3 and zero violations of the sandwich . The fuzz evaluates the recurrence deterministically at every sampled point — comparing the double-precision recurrence against the closed form — rather than Monte-Carlo sampling of a stochastic scheduler.
Illustrative heterogeneous partition. As a concrete illustration we take the four-stage partition 5090/3090/3090/1070 with normalized per-stage times (a ratio, ). This is a normalized illustration, not a measurement: the true per-stage time ratio of a mixed-generation cluster depends on the binding resource ( ) — roughly if memory-bound, up to if tensor-core-bound — and the closed forms of Theorems 1–3 hold for every . Figure 1 contrasts the closed form with the classic formula; at the overestimation reaches 166.7%, and it decays as grows (the gap is a constant fill cost divided by a growing total). Figure 2 shows the parallel-line structure of Theorem 2 for three communication levels. Figure 3 shows the blocking-regime phase transition of Corollary 4. Figure 4 shows the async-blocking sandwich of Corollary 5.
Thm 1: heterogeneous makespan vs classic GPipe (5090/3090/3090/1070)

Figure 1: Theorem 1: heterogeneous makespan (blue) vs classic GPipe formula (red); the green curve shows the overestimation percentage, which starts at 166.7% and decays as M grows.
Comparison against the classical bound. As a sanity check we also compared against Graham’s list-scheduling bound [2]; the closed form always lies strictly inside the Graham interval and equals its lower endpoint when the partition is balanced, consistent with the sandwich argument.
Ablation: overestimation vs. heterogeneity. To isolate the effect of heterogeneity alone (Corollary 1), Table 1 sweeps five 4-stage partitions of increasing imbalance, holding M at two values and recording the classic formula's overestimation . Two patterns emerge. First, the overestimation is monotone in heterogeneity at every M: a partitioner's error is directly proportional to the total shortfall . Second, for a fixed partition the overestimation decays in M — but slowly, because the gap is a constant numerator divided by a total that grows only as . At a imbalance (the illustrative partition), the homogeneous formula still overstates makespan by 29.4% at M = 8, which translates directly into wasted provisioned capacity.
7.2 Validation against the production scheduler
Theorems 1–3 and their corollaries are validated above by exact dynamic-programming recurrences ( ). We now check the corollaries — the homogeneity bias (Corollary 1) and the async-blocking sandwich (Corollary 5) — against measurements taken from a live, heterogeneous inference cluster, to confirm that the closed forms describe a real scheduler rather than only a synthetic one.
Data source. We mined the audit logs of our production LLM-inference gateway (UIG), which dispatches requests to heterogeneous GPU hosts (RTX 5090 Laptop, dual RTX 3090, RTX 3080,
Thm 2: communication is an additive constant (parallel lines)

Figure 2: Theorem 2: under asynchronous communication, makespan lines for different communication levels are parallel (common slope ), confirming that is an additive constant.
Thm 3: blocking communication (slope transitions , phase change)

Figure 3: Theorem 3: under blocking communication, the steady-state slope transitions from to once exceeds the compute slack (the phase change of Corollary 4).
Corollary 5: async-blocking sandwich bounds the overlap gain

Figure 4: Corollary 5: the async-blocking sandwich; the shaded band is the overlap gain, bounded by .
Table 1: Overestimation of the classic formula vs. stage heterogeneity ().
| Heterogeneity () | () | overest. | overest. | |
|---|---|---|---|---|
| [1, 1, 1, 1] | 0.0 | 0.0% | 0.0% | |
| [0.8, 1, 1, 1.2] | 0.8 | 20.0% | 6.5% | |
| [0.5, 1, 1, 2] | 3.5 | 77.8% | 18.9% | |
| [0.5, 1, 1, 5] | 12.5 | 166.7% | 29.4% | |
| [0.1, 0.2, 0.3, 5] | 14.4 | 257.1% | 35.5% |
Tesla P40, plus cloud endpoints) running legalone (1.7B/4B/8B) and a range of embedding/LLM models. The logs record, per completed request, the serving host, the model, the host compute time duration_s, and the end-to-end time total_s = duration_s + queue_wait_s. Across 2026-09-03 – 2026-10-04 the logs contain 8,571 completed requests; we take the empirical minimum duration_s per (model, host) as a lower-bound estimate of the per-micro-batch service time (the shortest observed request on an otherwise idle GPU).
Corollary 1 — the GPipe homogeneity bias is a real, constant overhead. We assemble the three GPU generations actually used for legalone:8b into a 3-stage heterogeneous pipeline with lower-bound service times s (RTX 5090 / RTX 3090-97 / RTX 3090-98). Theorem 1 gives ; the classic homogeneous GPipe formula assumes every stage equals and gives . Their difference is exactly s — constant in , as Corollary 1 predicts. At the homogeneous formula over-predicts by 30.8%; the relative error decays to 0.7% by , but the absolute 2.05 s over-provisioning never disappears. When we instead assemble a 5-host qwen2.5:7b pipeline that includes a slow Turing host ( s), the constant bias balloons to 119.8 s — quantitatively demonstrating that the homogeneity error scales with the spread of , not with batch size. The production scheduler already places stages heterogeneously and therefore realizes the lower, correct makespan; a homogeneous planner would have over-provisioned by precisely this constant. (Caveat: the duration_s minimum conflates short outputs with long ones, so is a lower-bound proxy; the direction of the bias — homogeneous over-prediction — is robust to this.)
Corollary 5 — the sandwich direction is borne out at the request level. For all 8,571 completed requests, total_s ≥ duration_s (equivalently queue_wait_s ≥ 0): each request's end-to-end time exceeds its own compute, which is the single-request analogue of the Corollary 5 direction . We stress that this is a per-request latency fact, not a measurement of the system makespan — for M micro-batches , far larger than a single — and is therefore consistent with, but does not itself validate, the Corollary 5 sandwich (cf. §9). Queueing is pervasive: 61.8% of requests incur a non-zero wait (median 0.001 s, max 273.6 s). On the busiest host (RTX 5090, legalone:8b, n = 5,049) the median end-to-end latency is 8.59 s versus 1.13 s on an otherwise-idle GPU — a expansion driven by queueing and contention — which is exactly the load regime in which the upper (blocking) edge of the sandwich would bind for the full pipeline, and in which the overlap-gain ceiling of Corollary 5 is tightest. Figure 5 plots, on the left, the constant Corollary-1 bias for the legalone:8b pipeline; on the right, the per-host median points, all above the diagonal (single-request level).
8 Related Work
The results connect two literatures that have largely developed in parallel.
8.1 Relation to classical flow-shop theory
We state the connection to the scheduling textbook explicitly, because the single most likely review objection is that Theorem 1 “is just the critical path.” It is — and the point of this subsection is to say precisely what that means and why the result is nonetheless worth stating.
What is classical. Consider the S-stage flow shop with per-stage processing times and M jobs released in permutation order, scheduled fill-drain on a chain DAG (each stage holds at most one job; the pipeline drains at the end). The makespan equals the longest path through the DAG.

Figure 5: Closed form vs. production scheduler. Left: the GPipe homogeneous formula over-predicts makespan by a constant bias s for the legalone:8b 3-GPU pipeline (Corollary 1). Right: every production host sits on or above the diagonal (single-request level), consistent in direction with the Corollary 5 sandwich on 8,571 real requests.
For a serial chain this is the well-known identity
which is exactly the critical-path / CPM lower bound of Kelley and Walker [4] specialized to a chain. Graham’s list-scheduling bound [2] shows it is attainable: for unrelated machines Graham proves , and equality is achieved when the precedence graph is a chain, because no stage can start before its predecessor finishes and no stage can finish before its predecessor does. Johnson [3] characterized the optimal schedules for the two- and three-stage permutation flow shop, confirming the identity is tight at these small widths. For homogeneous stages this reduces to the GPipe formula . Theorem 1 is therefore the heterogeneous restatement of this identity; we claim no priority for it. HEFT [5] extends list scheduling to general heterogeneous DAGs by ranking tasks on upward rank and assigning each to its earliest-finishing processor — our serial pipeline is the special case in which the DAG is a chain, and that structural restriction is precisely what makes a closed form, rather than a heuristic, attainable.
What is new. The contribution is not the identity but three consequences that the flow-shop literature states only for the homogeneous or general-DAG case and that the LLM-systems literature does not state at all:
• Bias decomposition (Corollary 1). The homogeneous formula’s error is not a relative error that vanishes with ; it is the constant , independent of . This follows by substituting for each in Theorem 1 and subtracting — a direct corollary of the identity — yet it is exactly the quantity a real heterogeneous planner must know and that the systems papers [25, 26, 27, 28] leave implicit.
• Phase transition (Corollaries 2–4). The identity admits a clean additive-constant-vs.-throughput-bottleneck transition at . The critical-path literature gives no such threshold, because it treats communication as part of the per-stage duration rather than as an overlappable quantity.
- Sandwich (Corollary 5). Bounding a partially-overlapped real system between the async and blocking extremes is a statement the pure longest-path view cannot make: partial overlap is a degree of freedom the chain model does not natively contain.
The mapping is collected below.
| Classical flow-shop concept | Our notation / result |
|---|---|
| Longest-path lower bound (CPM, [4]) | — Theorem 1, no-communication lower edge |
| Chain-DAG attainability (Graham [2]) | exact closed form; no heuristic required |
| Homogeneous-stage identity (GPipe) | |
| Heterogeneity gap | Corollary 1 bias |
| Communication: additive vs. bottleneck | Corollaries 2–4 phase transition |
| Partial overlap (absent in chain model) | Corollary 5 sandwich |
One-line summary: Theorem 1 is the critical path; Corollaries 1–5 are what one learns by holding the chain structure fixed while letting the stage times and communication be heterogeneous and partially overlapped. The remaining subsections position the work against the parallel-training, serving, heterogeneous-GPU, and automatic-parallelism literatures.
Pipeline parallelism for training. Building on GPipe's homogeneous micro-batch pipeline analysis, Megatron-LM [6] systematized tensor/pipeline/expert parallelism and their interactions. PipeDream [7] relaxed the strict layer-grouped schedule to allow asynchronous weight updates; PipeDream-2BW [8] bounded the resulting staleness memory; Chimera [9] combined bidirectional pipelines; TeraPipe [10] exploited token-level pipelining; most recently, DeepSeek-V3's DualPipe [11] combined bidirectional filling with fine-grained compute–communication overlap, reducing the pipeline bubble from the scale of 1F1B/ZB1P to . These works target training (which has backward dependencies and weight synchronization) and uniformly assume homogeneous or near-homogeneous stages; the makespan consequences of stage heterogeneity are left implicit.
LLM serving systems. At the kernel level, FlashAttention [12] made attention IO-aware by tiling the computation between HBM and on-chip SRAM — the foundational memory-bound optimization for decode. At the system level, vLLM (built on PagedAttention [13]) and Orca [14] established memory-efficient continuous batching; TensorRT-LLM [15], FasterTransformer [16], and Hugging Face TGI [17] provide optimized kernels and scheduling; DeepSpeed-Inference [18] integrated ZeRO with inference; SGLang [19] introduced structured-language scheduling primitives. Sarathi-Serve [20] introduced chunked prefills and stall-free scheduling to minimize pipeline bubbles under PP; more recent systems disaggregate prefill and decode — DistServe [21], Splitwise [22] — trading complexity for goodput. On the theory side, Bari et al. [23] prove throughput-optimal routing and scheduling for two-phase (prefill/decode) workloads, and Mohanty et al. [24] analytically model deferred prefill for throughput maximization. These systems and theories provide strong mechanisms but leave the pipeline-stage scheduling decision (routing, unload, micro-batch sizing) without a competitive-ratio or closed-form characterization for the heterogeneous case; our Theorems 2–3 give exactly the closed form their partitioners implicitly optimize against.
Heterogeneous GPU inference. A recent line of work tackles precisely the deployment question we formalize. Zhang et al. [25] deploy LLM inference pipelines on heterogeneous GPUs and report average stage idle time exceeding 50% from unbalanced stages; Xiong et al. [26] build a high-throughput heterogeneous-cluster serving system; Naeem et al. [27] make scheduling stage-aware and identify link bandwidth as a first-order determinant; Hyperion [28] jointly optimizes partitioning and request scheduling across heterogeneous tiers. These systems are measurement-or heuristic-driven and do not state a closed-form makespan; our Theorems 1–3 supply exactly the closed form their partitioners implicitly optimize against, and Corollaries 1–4 give the bias decomposition and phase-transition condition those heuristics are missing.
Automatic parallelism. Alpa [29] automates inter- and intra-operator parallelism search but is measurement-driven without optimality guarantees; FlexFlow [30], Galvatron [31], and Unity [32] search the joint space of parallelism dimensions. Our work complements these by giving the exact makespan of a heterogeneous pure-forward pipeline under three communication regimes, which — unlike asymptotic or heuristic treatments — yields the precise bias decomposition and phase-transition condition that a partitioner can use as a direct objective.
9 Discussion: the Sandwich in Real Deployments
The value of Theorems 2 and 3 in combination is that they bound a real system without requiring a full model of its synchronization. A deployed serving runtime typically achieves partial overlap: NCCL transfers overlap compute for most of their duration, but kernel launches, stream barriers, and the head/tail of each transfer serialize with compute. Its true makespan therefore lies strictly between the two extremes:
This sandwich holds under the model’s assumptions A1–A5 — in particular under unbounded buffers, so that no stage is ever forced to idle waiting for a downstream stage to accept output. Under bounded buffers, backpressure can idle the bottleneck from the downstream side as well, so the true makespan may exceed ; the lower bound remains valid in all cases, but the upper bound then requires the bounded-buffer model of §10(ii). We therefore read the sandwich as the bound available before backpressure is modeled, and treat the deviation above as a direct measure of the cost of finite buffering — a quantity the framework makes observable but does not yet predict.
Defining the realized overlap ratio
the effective steady-state slope is — obtained by linearly interpolating between the two closed forms, recovering the async slope at and the blocking slope at . This has two direct uses. First, is measurable from logs: with the partition's , known (from profiler or from the values in the blocking model), two makespan measurements at different pin down exactly, giving operators a single scalar that summarizes how close their runtime is to the async ideal. Second, it bounds the payoff of engineering effort: the maximum throughput a team can recover by perfecting overlap is exactly relative to current throughput — if is already near 1, further overlap work is wasted effort better spent rebalancing compute. In the motivating cluster, preliminary profiling places high (NCCL async over PCIe, with per-stage times long relative to transfers), which — per Proposition 1 — redirects optimization effort from link tuning to partition balance.
Queueing evidence from production logs. The cluster behind this work operates a culture-and-tourism knowledge-base service on the heterogeneous host pool of §1. Across the completed requests that carried per-request timestamps, 61.8% waited in queue (mean 0.42 s, max 274 s). We report this as system-level evidence, not a validation of Theorems 2–3 — the logs are dispatch counters, not makespan measurements — but it is direct, log-visible confirmation of the direction : real requests are delayed beyond the ideal makespan whenever contention is present.
Measured heterogeneity. The same logs let us measure, rather than assume, the per-stage time heterogeneity of §1. On the 4,981 completed legalone:8b requests carrying per-request timestamps, the minimum (near-exclusive, low-queue) duration was 1.13 s on the RTX 5090 Laptop versus 2.6–2.9 s on the dual RTX 3090 — a 2.3× spread. We caution against reading this as a clean hardware ratio: the minimum duration also folds in output-length differences between the shortest requests, so 2.3× is an upper bound rather than a throughput measurement. The median, however, inverts the picture regardless of hardware: 8.57 s on the 5090 versus 4.6–4.8 s on the 3090s, because the 5090 carried 4,981 requests while each 3090 carried ~ 20. The same effect appears even between identical GPUs: bge-m3 medians on the two RTX 3090 hosts were 0.050 s and 0.017 s — a 3× gap attributable purely to load. The decisive point is that is load-dominated, not hardware-dominated: the 1.13 s-to-8.57 s spread between exclusive and loaded service on the same host shows the per-stage time is the state-dependent effect (assumption A4, §10(v)) that the closed forms deliberately abstract away — and that a follow-on stochastic refinement should capture.
10 Limitations and Honest Boundaries
Our closed forms are instances of the classical critical-path lower bound [2, 4] applied to the pipeline setting; the novelty lies in the application to heterogeneous LLM inference, the closed-form bias decomposition, and the optimization-priority corollary — not in a new lower-bound technique. The assumptions A1–A5 (§2) delimit applicability; each relaxation is a genuine open problem, not a minor extension:
(i) Bandwidth-limited communication. When multiple micro-batches share a link, the per-transfer time grows with concurrency, producing a -scale term that the constant- model of Theorems 2–3 does not cover. This is the regime of high-contention Ethernet backbones, and it is the single most important open extension.
(ii) Bounded buffers. Finite buffer forces backpressure, which can idle the bottleneck even when upstream stages are fast enough; the ASAP schedule is no longer optimal, and the “optimal micro-batch schedule” question becomes non-trivial.
(iii) Prefill-decode interleaving. Real serving interleaves a compute-bound prefill with the decode pipeline; the KV accumulation of prefill introduces backward-like dependencies absent from pure-forward inference, and the two phases have different profiles.
(iv) Backward dependencies (training). The pure-forward assumption excludes training, whose backward pass introduces a second, reversed traversal that interacts with the forward pass through the same links.
(v) Time-varying and state-dependent service times. The constant- assumption (A4) abstracts away feedback loops that real clusters exhibit: thermal throttling (sustained load raises temperature, lowers clock, and increases — a positive feedback), prefix/radix-cache hit rates (which make history-dependent and break micro-batch independence), and load-dependent arrival rates (variable batch sizes and generation lengths). Each introduces dynamics that the static critical-path model treats as constant, and each is a candidate for a queueing-theoretic or stochastic refinement.
Each of (i)–(v) is a concrete, 3-year-scope research target that builds directly on the framework here.
11 Conclusion
We derived exact closed-form makespan formulas for heterogeneous micro-batch pipelines under no, asynchronous, and blocking communication (Theorems 1–3), together with a clean decomposition of the classic GPipe-formula bias and a computable sandwich on the real system's makespan. The results yield a rigorous, quantifiable foundation for automatic partition-and-schedule optimization of heterogeneous GPU inference clusters, and a concrete optimization priority: balance compute before optimizing links. We also identified bandwidth-limited communication as the natural next step, where the constant- model breaks and the slope itself becomes communication-dominated.
A Proof Details
A.1 Direct solution of the communication-free recurrence (longest-path view)
For , recurrence (1) reads . View the schedule as a grid with columns (stages) and rows (micro-batches): is the maximum-weight monotone path from to , where each visited cell contributes weight and moves are rightward (next stage, same micro-batch) or downward (next micro-batch, same stage). Any such path visits cells in column , with , and its total weight is . Maximizing this linear objective over is attained by assigning the surplus cells to the column of maximum , i.e. and for . Hence
This is an independent, closed-form proof of Theorem 1 that does not rely on the ASAP schedule, and it makes transparent why the bottleneck dominates: the bottleneck’s is counted M times, while every other stage’s is counted once.
A.2 Why the blocking regime reduces exactly
The blocking recurrence (2) is obtained from (1) by noting that, when the send blocks the stage, stage 's next compute cannot begin until both the current micro-batch's send and the previous micro-batch's completion at stage have finished. The transfer therefore folds additively into the service time of stage , exactly as a larger would. Formally, replacing in the arrival term by zero and adding into preserves the max-plus structure, which is precisely the substitution with .
B Validation Configuration Table
All eleven configurations are validated in both async and blocking regimes; the maximum relative error vs. recurrences (1)/(2) is .
C Reproducibility
Seven scripts reproduce every number in this paper (all require only the Python standard library, except the figure scripts, which require matplotlib):
Table 2: Hand-crafted validation configurations (all validated in both async and blocking regimes).
| # | vector | vector | Regime stress |
|---|---|---|---|
| 1 | homogeneous baseline | ||
| 2 | illustrative 5090/3090/3090/1070, bottleneck at tail | ||
| 3 | bottleneck at head | ||
| 4 | bottleneck at middle | ||
| 5 | twin bottlenecks | ||
| 6 | uniform async comm, below slack | ||
| 7 | comm near slack of stage 0 | ||
| 8 | comm exceeds slack (phase transition, Thm 3) | ||
| 9 | comm far exceeds compute | ||
| 10 | non-uniform comm, homogeneous compute | ||
| 11 | near-bottleneck stage 3 with slow link |
(config 11: , phase transition)
-
validate_appendixB.py — reproduces the eleven configurations of Table 2 (Appendix B), validating Theorems 1–3 in both the async and blocking regimes.
-
hetero_pipeline.py — Theorem 1 (communication-free): closed form vs. recurrence, and the classic-formula bias.
-
hetero_pipeline_comm.py — Theorem 2 (async): closed form vs. recurrence across ten configurations.
-
hetero_pipelineBlocking.py — Theorem 3 (blocking): closed form vs. recurrence, plus the sandwich and gap formula of Corollary 5.
-
peer_review_fuzz.py — the -point randomized counterexample search (log-uniform over two decades, from to the compute).
-
plot_figs.py, plot_fig3.py — figure generation.
The recurrences and closed forms are evaluated in IEEE double-precision floating point. Across the full -point fuzz the worst observed relative deviation between recursion and closed form is below (theoretical value: exact identity), so the quoted bound carries a wide safety margin — the deviation is floating-point rounding, not truncation of printed decimals.
Data and Code Availability
The reference implementation (heteropipe), the dependency-free online calculators (calculator.html, calculator_zh.html), the de-identified production dataset backing §7.2 and Figure 5, and all reproducibility scripts are released at https://github.com/ytidb6688/heteropipe. The dataset (data/real_vs_formula.csv; 8,571 completed requests, 2026-09-03 to 2026-10-04) is de-identified: host identifiers are mapped to anonymized node-N labels, and no IP addresses, timestamps, request identifiers, or payloads are released. The dataset is licensed CC-BY-4.0; the code and documentation are licensed Apache-2.0.
Using heteropipe
The reference implementation is installable from PyPI and has no runtime dependencies:
pip install heteropipe
A representative call reproduces the §3.1 four-stage example:
from heteropipe import Pipeline
p = Pipeline(tau=[0.5, 1.0, 1.0, 5.0]) # Sec. 3.1 four-stage example
p.bias() # 12.5 -- Corollary 1, the constant GPipe homogeneity bias
p.async_(M=1) # 7.5 -- Theorem 2 makespan (matches Sec. 3.1)
The same formulas, the de-identified §7.2 dataset, and all reproducibility scripts are available at https://github.com/ytidb6688/heteropipe.
References
[1] Huang Y, Cheng H, Bapna A, et al. GPipe: Efficient training of giant neural networks using pipeline parallelism. Advances in Neural Information Processing Systems (NeurIPS), 2019.
[2] Graham R L. Bounds on multiprocessing timing anomalies. SIAM Journal on Applied Mathematics, 17(2):416–429, 1969.
[3] Johnson S M. Optimal two- and three-stage production schedules with setup times included. Naval Research Logistics Quarterly, 1(1):61–68, 1954.
[4] Kelley J E, Walker M R. Critical-path planning and scheduling. Proceedings of the Eastern Joint IRE-AIEE-ACM Computer Conference, 1959.
[5] Topcuoglu H, Hariri S, Wu M-Y. Performance-effective and low-complexity task scheduling for heterogeneous computing. IEEE Transactions on Parallel and Distributed Systems, 13(3):260–274, 2002.
[6] Narayanan D, Shoeybi M, Casper J, et al. Efficient large-scale language model training on GPU clusters using Megatron-LM. SC '21: International Conference for High Performance Computing, Networking, Storage and Analysis, 2021.
[7] Narayanan D, Harlap A, Phanishayee A, et al. PipeDream: generalized pipeline parallelism for DNN training. SOSP '19, 2019.
[8] Narayanan D, Phanishayee A, Shi K, Chen X, Zaharia M. Memory-efficient pipeline-parallel DNN training. MLSys '21, 2021.
[9] Li S, Hoefler T. Chimera: Efficiently training large-scale neural networks with bidirectional pipelines. SC '21, 2021.
[10] Li Z, Zhuang S, Guo S, et al. TeraPipe: Token-level pipeline parallelism for training large-scale language models. ICML '21, 2021.
[11] DeepSeek-AI. DeepSeek-V3 technical report. arXiv:2412.19437, 2024.
[12] Dao T, Fu D Y, Ermon S, Rudra A, Ré C. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. NeurIPS, 2022.
[13] Kwon W, Li Z, Zhuang S, et al. Efficient memory management for large language model serving with PagedAttention. SOSP '23, 2023.
[14] Yu G-I, Jeong J S, Kim G-W, Kim S, Chun B-G. Orca: A distributed serving system for transformer-based generative models. OSDI '22, 2022.
[15] NVIDIA. TensorRT-LLM. GitHub repository, 2023.
[16] NVIDIA. FasterTransformer. GitHub repository, 2022.
[17] Hugging Face. Text Generation Inference (TGI). GitHub repository, 2023.
[18] Aminabadi R Y, Rajbhandari S, Awan A A, et al. DeepSpeed-Inference: Enabling efficient inference of transformer models at unprecedented scale. SC '22, 2022.
[19] Zheng L, Yin L, Xie Z, et al. SGLang: Efficient execution of structured language model programs. NeurIPS '24, 2024.
[20] Agrawal A, Kedia N, Panwar A, et al. Taming throughput-latency tradeoff in LLM inference with Sarathi-Serve. OSDI, 2024.
[21] Zhong Y, Liu S, Chen J, et al. DistServe: Disaggregating prefill and decoding for goodput-optimized large language model serving. OSDI '24, 2024.
[22] Patel P, Choukse E, Zhang C, et al. Splitwise: Efficient generative LLM inference using phase splitting. ISCA '24, 2024.
[23] Bari A, Hegde P, de Veciana G. Optimal scheduling algorithms for LLM inference: Theory and practice. Proceedings of the ACM on Measurement and Analysis of Computing Systems, 9(3), 2025.
[24] Mohanty M, Bolar G, Patil P, et al. Deferred prefill for throughput maximization in LLM inference. EuroMLSys, 2025.
[25] Zhang J, Hou J, Zhang B, Li X-Y. Deploy efficient large language model distributed inference pipeline for heterogeneous GPUs. IEEE/ACM IWQoS, 2025.
[26] Xiong Y, Huang J, Huang W, et al. High-throughput LLM inference on heterogeneous clusters. arXiv:2504.15303, 2025.
[27] Naeem R, Buyantogtokh T, Rizk H, Amano T, Yamaguchi H. Transformer-based resource and stage-aware scheduling for model-parallel LLM inference. ICDCN Companion, 2026.
[28] Ma M, Xu X, Xu M, et al. Hyperion: Hierarchical scheduling for parallel LLM acceleration in multi-tier networks. arXiv:2511.14450, 2025.
[29] Zheng L, Li Z, Zhang H, et al. Alpa: Automating inter- and intra-operator parallelism for distributed deep learning. OSDI '22, 2022.
[30] Jia Z, Zaharia M, Aiken A. Beyond data and model parallelism for deep neural networks. Proceedings of Machine Learning and Systems (SysML), 2019.
[31] Miao X, Wang Y, Jiang Y, et al. Galvatron: Efficient transformer training over multiple GPUs using automatic parallelism. Proceedings of the VLDB Endowment, 16(3), 2023.
[32] Unger C, Jia Z, Wu W, et al. Unity: Accelerating DNN training through joint optimization of algebraic transformations and parallelization. OSDI '22, 2022.