Skip to content

[Qwen3.8-Next] Add pipeline-parallel PD prefill with MTP - #38698

Closed
zhangxiaolei123456 wants to merge 11 commits into
sgl-project:mainfrom
bytedance-iaas:feat/qwen38-flash-next-pp-pd
Closed

zhangxiaolei123456 wants to merge 11 commits into
sgl-project:mainfrom
bytedance-iaas:feat/qwen38-flash-next-pp-pd

Conversation

@zhangxiaolei123456

@zhangxiaolei123456 zhangxiaolei123456 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Enable pipeline-parallel prefill for Qwen3.8-Flash-Next (Qwen4Exp) with PD disaggregation and native NEXTN/MTP.

This PR depends on #36651 for PD state transfer. It adds the missing model-level PP execution path and extends state transfer to include the MTP draft's QSA state.

The initial scope is PP-enabled prefill with PP=1 decode. Pipeline-parallel speculative decode is not enabled.

Modifications

  • Thread PPProxyTensors through the Qwen4Exp model wrappers. Run token embedding on the first stage, relay the full HyperConnection stream between stages, and apply final contraction on the last stage.
  • Restrict PLE execution, request-state allocation, and weight loading to the owning stage.
  • Enable CUDA PP + single-layer EAGLE/NEXTN on PD prefill nodes with overlap scheduling disabled.
  • Add a PP-aware embedding/head accessor and handle non-last-stage workers without a local draft runner.
  • Transfer draft QSA pending keys, RoPE state, and compressed keys through the existing state components, using reserved layer IDs to distinguish them from target state.
  • Add regression tests for PP forwarding, stage ownership, MTP embedding loading, configuration validation, and draft QSA state metadata.

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ❌ Run #34368276373
Latest PR Test (Extra): ❌ Run #34368271662
Latest PR Test (AMD ROCm 10): ❌ Run #34368275874

YAMY1234 added a commit to YAMY1234/sglang that referenced this pull request Sep 17, 2026
Port target-only PP support from upstream PR sgl-project#38698 commit 9f3718b: relay hyper-connection tensors, shard ownership, weight filtering, and PLE state allocation.
YAMY1234 added a commit to YAMY1234/sglang that referenced this pull request Sep 17, 2026
Port the CUDA PD-prefill gate, stage-local MTP layer setup, non-owner EAGLE worker behavior, and draft QSA state transfer from PR sgl-project#38698 while preserving the existing aggregate PP speculation path.
@YAMY1234

YAMY1234 commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Hi @zhangxiaolei123456, since this branch no longer merges after #30775 / #39378 / #40045, I opened #40501 which carries your two commits (authorship kept) rebased onto main plus the follow-up fixes we needed for Qwen3.8-Flash-Next PP; the QSA PD state-transfer commits on this branch are already on main via #36651. Happy to fold it back here or hand it over if you prefer.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks @zhangxiaolei123456. Closing this because you have 9 PRs open and none updated in 7 days, over our soft cap of 5 for idle PRs.

Reopen the two or three you most want reviewed - a short active set moves faster than a long idle one.

Some directories moved recently, so an older branch may need retargeting:
sgl-kernel/ -> python/sglang/kernels/aot/, python/sglang/jit_kernel/
-> python/sglang/kernels/jit/, docs/ -> docs/docs/ (.mdx),
bench_serving.py -> benchmark/serving.py, test/srt/ -> test/registered/.

@github-actions github-actions Bot closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants