Came across this post today. Really interesting stuff.
The way AI infra is evolving is crazy. AI truly is the future. @indiaai @svembu@SarvamAI@vishnuvig
How do you get up to 2.9x prefill throughput on the same GPUs and kernels?
We introduce WavePP, a new runtime reaching state of the art for pipeline parallelism (PP) prefill.
The question was: “What if each PP stage ran as an independent, lightweight model worker?”
To answer this, we had to rethink everything, from request admission, prefix reuse agreements, and how to divide work.
In experiments on TensorRT-LLM PP4, WavePP delivers up to 2.91x throughput on GLM-5.2 and 2.02x on MiniMax M2.7 under high prefix reuse against the same kernels on the same GPUs.
This is what we changed 🧵
These results also extend beyond our runtime.
On Kimi K3, WavePP achieves the highest measured throughput in all 18 tested settings at concurrency 8 and above, across cold, cached, and mixed workloads, against the evaluated TRT-LLM, SGLang, and vLLM configurations.
Cold prefill, 65.5K–262K inputs:
+3.0–9.5% over SGLang PP8 and +2.4–10.8% over vLLM PP8. Against TRT-LLM TP8/EP8, throughput improves by 45.3–90.1%.
90% prefix reuse, 131K–262K inputs:
+5.4–20.6% over SGLang PP8 and +23.7–56.5% over vLLM PP8.
Mixed traffic—75% warm requests, 25% cold:
+4.9–5.1% over SGLang PP8 and +14.0–14.9% over vLLM PP8, across all three tested concurrencies.
We measured how much WavePP adds over our base (which was TensorRT-LLM), with the same kernels, on the same hardware.
WavePP improves throughput in 37/40 settings across GLM-5.2 and MiniMax M2.7.
On cold and mixed traffic at concurrency 8–32, throughput improves by 1.9–9.1% on GLM-5.2 and 7.5–10.7% on MiniMax M2.7.
With long cached prefixes and only 4K tokens left to compute (common in agentic continuations), the gap grows with load:
64 concurrent requests: +39.0% throughput on GLM and +24.8% on MiniMax.
128 concurrent requests: 2.91× throughput on GLM and 2.02× on MiniMax, with approximately 71% and 55% lower median prefill completion time, respectively.
We find that as concurrency increases, admission costs can actually become more expensive, the actual throughput can reduce in the base version, while WavePP still continues to scale.
Asynchronous admission allows reuse agreement, resource reservation, and other host work proceed while admitted waves continue to execute. With leases and capacity escrows we keep these resource commitments safe, while MPU works in the scheduler to make it more effective.
Both are indeed required in our work.
For Kimi K3 with 131K inputs, 90% prefix reuse, and concurrency eight, throughput progresses from:
96.8K → 149.0K → 211.2K input tokens/s.
Due first to asynchronous admission, and then due to MPU.
Once the requests are ready, we still need to divide the amount of work efficiently across the pipeline.
We may think that greedily filling each micro-batch is efficient, but that might only fill a few ranks with useful work, while other ranks stay idle. This idle time is a massive GPU underutilization!
We introduce a Maximum Pipeline Utilization (MPU) policy that chooses the budget of each wave that still allows enough waves to be created to occupy all the PP stages, keeping all GPUs used as effectively as possible!
This policy is extremely lightweight and simple!
But determining cache reuse length is not enough. Each PP stage must guarantee its peers that it will retain that prefix cache during execution as well.
So, we locally lease the agreed upon prefix, which guarantees that it will not be evicted when we reach the request’s execution time, and hand it over just before execution when it is materialized.
But that is insufficient! What if we have multiple concurrent requests, but each of them protects its own prefix cache and the radix tree has nothing to evict or offload anymore to fit the uncached suffix!?
For this, we also reserve the remaining space that is needed to store the uncached suffix in an escrow.
We don’t immediately evict useful content while making an escrow. These cache blocks remain reclaimable, so another request can claim them to retain longer reusable prefixes for themselves, provided that alternative targets can be found for offload or eviction.
The actual eviction only takes place when the request enters the PP stage. This allows later requests that might still use the KV to claim it later, raising KV hit rate.
First, we can make the cache reads much cheaper by building sharded, chained-hash indices of the radix tree.
Each shard has its own lock, though different shards can be read concurrently allowing multiple requests to proceed concurrently.
For dense attention prefixes, we can gallop forward and bisect the index, leading to only O(log(N)) reads of the index, where N is the number of eligible blocks.
At high concurrency, we found that the requests would queue to access the tree, with median wait times reaching up to 64.4 ms. With this approach, we take this down to 24 μs.
This means that even when multiple requests are being received concurrently and we need to determine their local prefix reuse lengths, the first round of traversal becomes extremely cheap.
Now, with independent cache management, the reuse agreement becomes a distributed agreement problem. Each stage has only access to its own view of its prefix. Each time it needs to check how much cache it has, it must walk its prefix radix tree.
In a straightforward implementation, it communicates how much cache it has to the other ranks, then also protects this cache from eviction. We could either optimistically protect the longest branch based on a local view and trim later based on disagreements, or we wait for agreement and only then protect the branch, but both need another traversal, and we could make other requests wait unnecessarily.
Linear attention complicates this further if the checkpoints can be evicted independently from the KV cache, and we cannot rewind from a later position.
Multiple requests complicate this even further, since they could independently cause evictions between tree traversals if we allow them to proceed concurrently. If we hold them to sequential admission, then admission can end up being far too slow!
Clearly, we need a solution that keeps prefix reuse determination cheap, concurrent, and correct!
In WavePP, we separate admission from execution, with dedicated threads and communications processes that allow waves to keep resource preparation and prefix reuse agreement overlapped while waves continue computing!
Pipeline parallelism has many advantages over tensor parallelism (TP), ranging from more cache storage space to fewer collective operations. Keeping separate layers on separate GPUs allows us to run different chunks through different stages concurrently, and also increases the number of in-flight tokens significantly.
We wanted each stage, which may hold different layers, to manage its own cache and request preparation. That way each stage handles memory pressure independently, and request preparation doesn’t require a shared barrier across all stages.
This appears as waves of chunks moving from one stage to another smoothly and effectively.
However, the stages must still agree on the amount of prefix to reuse since now their caches may diverge.
@boschindia@BoschGlobal Practically a nightmare buying Bosch micro. Magnetron failed in 3 years. Got it replaced and in 18 months it's the same story. Took over a week ages to get an engineer he had no idea why it's failing. Getting the part will take another 7 days. In Pune.
10/ There are actually some limits on how much we can certify acceptance. We see that R_p(R) ≤ log 2 for any single token criteria with a non-empty rejection region, while R_p^tree(m) ≤ log(m+1).
This means that, if the KL divergence exceeds log 2 for greedy acceptance, we can not give a uniform greedy acceptance guarantee from KL alone. For m branches, this quantity changes to log(m+1).
9/ For tree decoding, the drafter branches at several points and produces a tree of possible token sequences. Suppose at a single point, we will branch into m sequences, those being the top m tokens proposed by q.
Define: γ_m = p(x₀) − p(x₍ₘ₎), where x₍ₘ₎ is the m-th most probable token other than x₀, i.e. the (m+1)st token of p. We see that the sharp worst-case threshold based on margin is:
Comparing this to the greedy case, we actually asymptotically bound KL (m+1)/2 times larger than the greedy case. Note that m = 1 recovers the greedy case exactly!
8/ Medusa adds an entropy-dependent threshold, θ_H, and accepts when p(y) > θ_H, assuming that θ_H < p(x₀).
For a fixed target distribution p, we find that this acceptance criterion also has the same lower-level set structure as our previous examples. Define margin: γ_H = p(x₀) − θ_H. We obtain the following sufficient condition to guarantee acceptance below:
7/ We can also consider a multiplicative condition for relaxed acceptance: p(y) > α·p(x₀), for some 0 < α < 1.
We obtain the following asymptotically tight lower bound on the rejection threshold (a KL below that guarantees acceptance):
The tight example is once again pleasantly simple.
This time, the threshold also depends on max p = p(x₀)