Repository navigation
Description
Motivation
Pipeline parallelism is an important feature that can effectively reduce Long Context (e.g., 1M input tokens) TTFT, and it is also a promising optional parallel strategy for improving throughput.
Pipeline Parallelism Roadmap
- Long context prefill + PD Disaggregation @ShangmingCai @XucSh @alpha-baby @whybeyoung
- Achieve almost linear scaling by doing chunked pipeline parallelism with prefill on a long context (e.g., 1M)
- Compatible with different tp degree on decode (e.g., PP8TP8 on prefill +TP4 on decode, PP8TP1 on prefill + TP8 on decode)
- High throughput decoding @ShangmingCai @bluecoffee8
Currently, SGLang has supported Pipeline parallelism (#5724) in the main branch, and also made it compatible with the PD Disaggregation feature (#8846), but the implementation is not perfect, and there remains a lot of space for performance improvements. In other words, there still exist many pipeline bubbles (e.g., GPU's idle time) in the whole cluster for the current implementation.
To reduce PP bubbles, the refactoring works can be divided into the following sub-tasks:
Refactoring the PP communication strategy
- Use async send for PP stages communication in the new event loop (proposed by @alpha-baby in [OPT] enable pp send/recv overlap when pp size > 2Β #7979, adapted in the implementation of the new PP event loop by @merrymercy)
- Use async micro batch buffer and async P2P communication to allow overlapping the GPU computation and CPU processing, and avoid the last PP rank staggler (done by @merrymercy)
- Adapting the new event loop in the main branch @XucSh @ShangmingCai [PP] Refactor PP to async modeΒ #11852
- Detailed profiling and performance evaluation @whybeyoung @alpha-baby
- Reduce bubbles by reordering and minimizing the communication-related overhead and CPU stalls @ShangmingCai @XucSh @alpha-baby
Make new disagg prefill event loop compatible with PD Disaggregation
- Adapting the new event loop in the main branch @ShangmingCai @XucSh
- Reduce bubbles by reordering and minimizing the communication-related overhead and CPU stalls @alpha-baby @ShangmingCai @XucSh
- Reduce bubbles with Dynamic Chunking @ShangmingCai @XucSh @whybeyoung @bluecoffee8 [PP] Refactor PP to async modeΒ #11852
- Doc about usage of dynamic chunking [1/N] Update doc of Pipeline ParallelismΒ #14985 [Doc] Optimize pipeline parallelism docΒ #16630
- Failure handling and ensure eventual consistency @XucSh
Implement decode PP for PD Disaggregation
- Implement a new disaggr decode event loop for PD Disaggregation (or just use the new event loop pp like vanilla SGLang instance) @bluecoffee8 @ShangmingCai [PD] Add decode PP event loop for PD disaggregationΒ #14945
- KVCache transfer backend support @ShangmingCai @bluecoffee8 [PD] Support decode pp for PD disaggregationΒ #14265 Support PP x PD decode with nixl backendΒ #14392
- MTP compatibility and accuracy when prefill nodes don't set up MTP (not sending draft cache) @ShangmingCai @Ch3ngY1 [PD] Optimize MHA models pp util calculation logicΒ #17306 @ [Bugfix] Wrong Answer in PD disaggregation [P w/o SPS | D w/ SPS]Β #17212
- MTP compatibility and accuracy when prefill nodes set up MTP (with draft cache transfer) [RFC] GLM-5 Spec. Decode + PP in Disaggregation Decode ModeΒ #23162 Pipeline parallelism x speculative decoding (EAGLE/MTP) compatibilityΒ #30775
- Reduce bubbles by reordering and minimizing the communication-related overhead and CPU stalls @ssssnow @bluecoffee8
Compatibility with HiCache
- HiCache + PP support [HiCache] Add PP Support with suffix pp rankΒ #15175 @stmatengss
Compatibility with Context Parallelism
- Support DeepSeek V3.2 CP with PP [Feature] DeepSeek V3.2 Support CP8+PP2+TP8Β #15358 [DeepSeek 3.2] Support and optimize pipeline parallelis when context pipeline enabledΒ #16380 @whybeyoung @xu-yfei
- Support Qwen CP with PP @whybeyoung
Reduce code duplication and improve code readability
- Detailed in [Feature] Refactor pipeline parallelismΒ #11188
- Fix potential scheduler hang [Pipeline Parallelism][Bug] Fix scheduler hang in pipeline parallelism setupΒ #23006
- Add a test case to guard [Pipeline Parallelism][Bug] Fix scheduler hang in pipeline parallelism setupΒ #23006
We welcome contributors who are interested in these tasks and willing to join us for rapid development.
Related resources
No response
Activity
[-][Feature] Refactoring and Improving Pipeline Parallelism[/-][+][Roadmap] Pipeline parallelism refactoring roadmap[/+]jianfei-wangg commentedon Nov 18, 2025
HelloοΌis there any plan to support speculative decoding when pp is enabled?
ShangmingCai commentedon Nov 18, 2025
@jianfei-wangg It should be OK with PD disaggregation (Prefill PP + Decode MTP), but for normal pp loop, I think we are not gonna make it a high-priority task currently.
jianfei-wangg commentedon Nov 18, 2025
@ShangmingCai Thanks for reply. But I wonder whether it is OK with PD.
ShangmingCai commentedon Nov 18, 2025
@jianfei-wangg It does affect the accept rate to some extent, not too much for MTP, but could be significant for draft-model-based methods. In fact, I haven't put too much effort and attention into PD + draft-model-based spec methods, we think MTP and EAGLE are more important.
ShangmingCai commentedon Dec 12, 2025
More info:
[-][Roadmap] Pipeline parallelism refactoring roadmap[/-][+][Roadmap] Pipeline parallelism roadmap[/+]nihao1997 commentedon Jan 22, 2026
Hello, great work! However, I currently have an issue: if our requests include a grammar, it can cause inconsistencies among the requests in the disagg_prefill_bootstrap_queue across different pipeline parallel (PP) stages, leading SGLang to crash.
For now, Iβve modified the code to synchronously wait for the grammar processing to complete before enqueuing the request. Is there a better solution to this problem?
sglang/python/sglang/srt/managers/scheduler.py
Line 1573 in d6e2b88
ShangmingCai commentedon Jan 22, 2026
@nihao1997 Hello, you can reference this PR: #16820. If this won't help, welcome submit an issue or a PR to discuss this problem.
zwc163 commentedon Jan 28, 2026
Can we support MTP under PP parallelism?
ShangmingCai commentedon Jan 29, 2026
@zwc163 Yes, of course. Prefill PP (without setting mtp params) + Decode MTP has already been supported. But MTP compatibility when prefill nodes are configured MTP (with draft cache transfer) still needs some time. I am currently busy with other things.
guoyuhong commentedon Jan 29, 2026
@ShangmingCai It seems your use case involves disaggregation. If we donβt use PD Disaggregation, would it still be possible to support PP + MTP?
ShangmingCai commentedon Jan 30, 2026
@guoyuhong I guess you mean decode PP + MTP? Not yet. We need to make PP compatible with MTP first.
CloudyDory commentedon Jan 31, 2026
Hi, vLLM has a environment variable "VLLM_PP_LAYER_PARTITION" that controls how to split model in pipeline parallelism. This is very useful in scenarios where the GPUs in a cluster are different (for example, 4090s + 5090s). Does sglang has a similar feature?
ShangmingCai commentedon Jan 31, 2026
@CloudyDory Sure, try
SGLANG_PP_LAYER_PARTITION. You can find all env vars here: https://github.com/sgl-project/sglang/blob/main/docs/references/environment_variables.md?plain=1github-actions commentedon Apr 2, 2026
This issue has been automatically closed due to inactivity. Please feel free to reopen it if needed.
github-actions commentedon Jun 19, 2026
This issue has been automatically closed due to inactivity. Please feel free to reopen it if needed.
Eviannn commentedon Jul 1, 2026
Hi, are u planning to support piecewise-cuda-graph + pp and overlap-schedule + pp?
ShangmingCai commentedon Jul 1, 2026
@Eviannn I think PP does not need overlap scheduling since the CPU overhead is already hidden either in the GPU execution or in the proxy communication. You can consider it is inherited inside PP.
As for PCG/BCG, I think it would be great if this feature works under PP mode, but I think this combination has some specific impl need to be handled, not sure whether it works for all kinds of models currently. Welcome to testing and contributing if you find this topic interesting.
dongyibo commentedon Jul 9, 2026
@ShangmingCai Hello, our current deployment setup is pd-disagg + mtp. However, due to the urgent need for 1M context, we need to enable pp on the p node, but we don't want to lose the acceleration effect of mtp on the d node.
Therefore, we hope the p node can support the pp+mtp functionality. Could you please consider this when you have time? Thank you~
liao4s commentedon Sep 3, 2026
Hello. Although the roadmap indicates that asynchronous communication for PP ranks has been implemented, I have found that inter-PP-rank communication in sglang still synchronous. As shown in the code snippet below, this implementation forces the GPU to wait for the proxy tensor from the previous operation to finish sending before proceeding to the next inference batch, resulting in significant bubbles. The recv operation is the same. This can be confirmed by the trace screenshot below (based on a deployment of the first 64 layers of the Kimi-K3 model using PP=16 on H20 GPUs).
Really hope to receive a reply after you see this. Thank you!