Conversation
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Juntian Liu <Juntianl777@gmail.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Juntian Liu <Juntianl777@gmail.com>
Juntian777
requested review from
AndreasKaratzas,
WoosukKwon,
mgoin,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
September 14, 2026 22:11
WoosukKwon
approved these changes
Sep 15, 2026
Collaborator
|
/ci run |
|
✅ @Juntian777, CI is now available for this PR.
|
|
❌ This PR is 34 commits behind upstream |
Collaborator
|
/ci run |
WoosukKwon
enabled auto-merge (squash)
September 15, 2026 07:38
|
✅ Triggered Buildkite CI #89043 for commit |
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.
Purpose
Under sequence parallelism, the DeepSeek-V4.1 DSpark draft gathers BF16
[T_local, 4, H]residual streams and FP32[T_local, 4]pre-mix coefficients before collapsing them into[T, H]. The draft returns only the collapsed pre-norm head states; it does not export a full-HC MTP buffer at this boundary.Collapse each token's streams locally, then gather only
[T_local, H]and trim SP padding. This reduces the hidden-state gather payload by 4x forhc_mult=4and removes the pre-mix gather, reducing this tail from two collectives to one. The target model already follows this ordering when it does not need to export full HC states. Normalization remains incompute_logits.This is a communication optimization, not an output-correctness fix. SP currently requires PP=1, EP enabled, TP>1, and either a MegaMoE backend or DP>1.
Duplicate-work check
No existing issue was identified for this optimization; issue-number duplicate checks are not applicable. Open-PR searches covered
dspark collapse,DeepSeek sequence parallel,"hc_collapse_triton", and"dspark" "gather" in:title. No matching fix was found. Reviewed related PRs: #50658 projects Kimi-K3 target auxiliary states; #56438 handles V4.1 pipeline/SP stage boundaries; #51244 adds V4 kernel fusions; #56513 changes the ROCm delayed mHC projection. None applies this NVIDIA V4.1 draft-tail reorder.Test Plan
atol=0, rtol=0).mhc_post_tilelang+ collapse + productionsp_all_gather) before and after, using random tensors and no model weights. Check eager and captured outputs bitwise before timing. Include an NCCL-only control.Test Result
Scoped tail performance
One node, 4x NVIDIA GB200 connected by NV18 links. PyTorch 2.13.0+cu132, CUDA 13.2, NCCL 2.29.7, Triton 3.7.1, TileLang 0.1.12, FlashInfer 0.6.18. BF16 streams/output, FP32 mixes, H=5120, hc_mult=4. Measurement commit:
16dc4cc4d05f86cf8fd0c7413e327395337d2371(the standalone benchmark was subsequently removed from the PR; implementation and tests are unchanged), based on00972dfd72988942138a7a6089eaee08580210b8.CUDA graph internal events exclude CPU launch gaps. Each measurement flushes 128 MiB of L2 and uses a device-side all-reduce rendezvous before replay, outside the timed interval. Four pointer-distinct workspaces, 20 warmup replays, 50 samples per variant, alternating A/B order. Report the median of each sample's slowest rank. Compilation, allocation and input generation are outside timing; all production gather staging/copies remain inside. The benchmark also reports logical receive bytes per rank and payload/time; this is not a measurement of physical link bandwidth.
All times below are microseconds for the entire tail. Default-dispatch figures are from the repeat run.
The first default-dispatch run measured 1.29x/1.40x/2.10x/5.13x/5.76x/1.88x for the same ascending token counts. These are microbenchmark results, not end-to-end speedups.
Backend selection is part of the measured production wrapper: at T<=128, both versions' state gathers use MNNVL Lamport; at T=512, the original full-state gather falls back while the smaller collapsed gather still uses MNNVL; at T=2048, both state gathers fall back. The original pre-mix gather uses MNNVL throughout. The NCCL-only control disables custom gathers. Real distributed measurements cover TP4; TP8 is covered by single-GPU sharding-equivalence tests only.
AI assistance was used (OpenAI Codex) for implementation, tests, benchmarking, and this description.