Repository navigation
[Perf] scheduler: broadcast TP requests via the shared-memory MessageQueue instead of gloo - #44202
Open
rahulvijayaraghavan wants to merge 1 commit into
Open
rahulvijayaraghavan wants to merge 1 commit into
rahulvijayaraghavan wants to merge 1 commit into
Conversation
rahulvijayaraghavan
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
October 14, 2026 05:07
rahulvijayaraghavan
force-pushed
the
req-broadcast-shm-mq
branch
from
October 15, 2026 04:19
1309561 to
edb1005
Compare
detain
added a commit
to detain/sglang
that referenced
this pull request
Oct 20, 2026
…/deferred/avoid map - 3A [24-35]: NVFP4 MoE boot sgl-project#39807/sgl-project#40173, block-FP8 TP refine sgl-project#42566, k-pool indexer split sgl-project#43619, SM120 skinny GEMM sgl-project#42865/sgl-project#42867, DeepGEMM warmup guards sgl-project#32686/sgl-project#43712, autotune sgl-project#43363/sgl-project#40420, mHC overlap sgl-project#42985, FP8-einsum precompile sgl-project#42821. - 3B [36-43]: PCIe CustomAllreduce VMM sgl-project#44448, EP local expert ids sgl-project#44480, shm TP broadcast sgl-project#44202, PCIe-IPC all-gather sgl-project#42863 + multicast guard sgl-project#41888, TP-sampling consistency sgl-project#41916/sgl-project#38565, draft embed/lm_head VRAM sgl-project#37155. - sgl-project#39807 toolchain commit verified safe against our CUDA_HOME=12.9 pin (cu13 fallback needs CUDA_HOME unset AND glibc>=2.41; we are 2.39). - stack_want.txt: execution-status banner. Branch tip 5dd6ec7.
Contributor
Author
|
@hnyls2002 @merrymercy could you take a look? This routes the per-step TP request broadcast through the existing shared-memory MessageQueue instead of gloo (same change vLLM made in vllm#5399). Eager-mode numbers in the description; CI needs the run-ci label |
rahulvijayaraghavan
force-pushed
the
req-broadcast-shm-mq
branch
from
October 20, 2026 06:22
edb1005 to
bd64c46
Compare
This comment has been minimized.
This comment has been minimized.
…Queue instead of gloo Keep gloo with --sleep-on-idle, where MessageQueue readers would busy-poll.
rahulvijayaraghavan
force-pushed
the
req-broadcast-shm-mq
branch
from
October 21, 2026 07:32
bd64c46 to
ae8a790
Compare
Contributor
Author
|
@hnyls2002 @ShangmingCai could you please review? Routes the per-step TP request broadcast through the shared-memory MessageQueue instead of gloo; falls back to gloo under sleep-on-idle |
Contributor
|
/tag-run-ci-label |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Once per decode step, TP rank 0 broadcasts the newly received requests to the other ranks over gloo, even when the
list is empty. gloo uses a binomial tree, so the last ranks wait for relays through other ranks, and each hop pays a
thread hand-off plus a socket round trip on cores that have meanwhile dropped into deep idle. The TP group already owns
a shared-memory
MessageQueuebroadcaster that nothing uses at runtime; this PR sends the request broadcast through it.flowchart TB subgraph gloo["gloo (current): binomial tree, 3 rounds at TP=8"] direction LR g0((r0)) -->|round 1| g1((r1)) g0 -->|round 2| g2((r2)) g1 -->|round 2| g3((r3)) g0 -->|round 3| g4((r4)) g1 -->|round 3| g5((r5)) g2 -->|round 3| g6((r6)) g3 -->|round 3| g7((r7)) end subgraph shm["shared memory (this PR): one write, every rank polls"] direction LR s0((r0)) -->|write| ring[/shared-memory ring/] ring -.-> s1((r1)) ring -.-> s2((r2)) ring -.-> s3((r3)) ring -.-> s4((r4)) ring -.-> s5((r5)) ring -.-> s6((r6)) ring -.-> s7((r7)) end gloo ~~~ shmThis matters where the host is on the critical path: in eager mode every rank issues all of the step's kernels, so a
rank that starts late behind the tree delays the whole step, while with CUDA graphs the hosts run ahead of the GPU and
the delay is hidden. vLLM made the same switch by default in vllm-project/vllm#5399 (June 2024, +3.5% on Llama-2-7B
TP=8 / 8xH100) and has kept shared memory as its only path since; as there, no flag is added. gloo is kept only under
--sleep-on-idle, where shared-memory readers would busy-poll while rank 0 sleeps.Accuracy Tests
No change to model execution; greedy output is identical on the shared-memory path, the gloo fallback and
--sleep-on-idle(Qwen3-8B TP=8, 8x L40S).Speed Tests and Profiling
8x NVIDIA L40S (PCIe), Qwen3-8B TP=8,
bench_servingrandom 256/256, eager (--cuda-graph-backend-decode disabled),radix cache off. base = main 2c1e859 vs base + this commit, four alternating pairs, one fresh server per run.
Every PR server is above every base server at every concurrency (run-to-run spread 1-2% on both sides); TPOT -1.8 to
-2.2%, p99 inter-token latency 5-6% lower.
Checklist
CI States
Latest PR Test (Base): ❌ Run #39562741553
Latest PR Test (Extra): ❌ Run #39562741723
Latest PR Test (AMD ROCm 10): ❌ Run #39562741448