Conversation
Keep the verified SM90 Triton path while routing TMA-packed SM100 scales through DeepGEMM without an invalid logical reshape.
Own the deterministic fused quantization sources and neutral runtime contract in vLLM so the standalone extension no longer depends on a patched SGLang checkout.
Recompute dynamic expert launch metadata during replay so DS4 EP rollouts remain bitwise aligned with eager execution.
…roject#52626) Signed-off-by: Hollow Man <hollowman@opensuse.org>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Replace the meta placeholder on first weight sync while preserving in-place updates after CUDA graph capture.
Skip bucket-level broadcast refresh until dummy MHC parameters have been materialized by the first full sync.
Keep prefill and decode launch geometry request-local so DS4 outputs remain bitwise invariant across batch compositions.
Use score and source index as a stable key so packed requests select and order identical sparse KV rows across batch compositions.
Group adjacent requests only when their fixed sparse workspace shapes match, preserving batch invariance without one launch per token.
Match vLLM score and tie ordering in the standalone DS4 kernel so BI replay is repeatable without changing sparse-attention reduction order.
Route prefill top-k through the stable DS4 extension and define the request count used by mixed-prefill warmup so the published overlay is self-contained.
Return request-local top-k indices and isolate identical-shaped FlashMLA requests so packed and singleton inference remain bitwise equivalent.
garrett361
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Sep 22, 2026
vllm-project/vllm#54955 is a "[Preview][DO NOT MERGE]" branch, so it can never be the event that lets us delete this patch. Cite #57798 instead, which fixes the DeepSeek V4 target models on top of the shared padded-sink helper in #57797. Verified against upstream main d90f0eade5: the bare params_dict[name][:n].copy_() is still there, so the patch is still needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
garrett361
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Sep 22, 2026
vllm-project/vllm#54955 is a "[Preview][DO NOT MERGE]" branch, so it can never be the event that lets us delete this patch. Cite #57798 instead, which fixes the DeepSeek V4 target models on top of the shared padded-sink helper in #57797. Verified against upstream main d90f0eade5: the bare params_dict[name][:n].copy_() is still there, so the patch is still needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
garrett361
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Sep 23, 2026
vllm-project/vllm#54955 is a "[Preview][DO NOT MERGE]" branch, so it can never be the event that lets us delete this patch. Cite #57798 instead, which fixes the DeepSeek V4 target models on top of the shared padded-sink helper in #57797. Verified against upstream main d90f0eade5: the bare params_dict[name][:n].copy_() is still there, so the patch is still needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Important
Preview only — DO NOT MERGE.
This draft collects the vLLM changes required for end-to-end DeepSeek-V4
train/rollout alignment. It is intentionally larger than an upstreamable PR.
After the preview is validated, it will be rebased onto current
mainandsplit by kernel, sparse attention, MoE/DeepEP, and reload support. Those
focused PRs are the changes intended to merge. The verl production recipe
will be updated after they land on official vLLM branches.
Purpose
Make DeepSeek-V4 rollout execution independent of request batching so the same
vLLM kernels can be used by the mLite actor recomputation path and produce
exactly matching probabilities.
Preview source:
ISEEKYAN/vllm:ds4-v9-rc11a6542cdebbaabbf9972c358de8d6baa54e46b0cdf12131335d84e9848e188905449230902eaf7ca7aa248fcfef5ba7a6bfb0ce314e328ce63abb9f9Default vLLM behavior is unchanged. The aligned path is enabled only with
VLLM_BATCH_INVARIANT=1and the required native libraries.Fused activation and FP8 quantization
csrc/batch_invariant/adds a standalonefused_silu_mul_per_token_group_quantoperator for contiguous andexpert-masked inputs.
geometry rather than selecting a path from batch-local M.
Blackwell.
2**31elements.
deep_gemm_moe.pyandbatched_deep_gemm_moe.py.In batch-invariant mode, missing kernel support is a hard error rather than a
silent fallback to a numerically different implementation.
Deterministic sparse top-k
csrc/ds4_bi_topk_extension.cuaddsds4_bi.top_k_per_row_prefill.This removes top-k set/order changes caused by equal scores, request offsets,
or decode-versus-prefill dispatch.
Sparse MLA and FlashMLA
vllm/models/deepseek_v4/nvidia/flashmla.pyand the sparse-attention helpersadd
VLLM_DS4_DECODE_KERNEL=sparse.flash_mla_sparse_fwd, matching the prefill attention path.grouped batch-local plan.
not neighboring sequence lengths.
This makes sparse index selection, KV gather order, and attention reduction
independent of the other requests in the batch.
DeepGEMM, MoE, and DeepEP
vllm/utils/deep_gemm.pyprobes and enables the batch-invariant DeepGEMMcontract, failing closed when the installed fork does not support it.
fixed expert capacity instead of
expert_num_tokens.max().torch.mmpath rather than anM-dependent low-latency GEMM.
join collectives and FP8 dispatch requests aligned quantization.
Together these changes fix route ordering, expert input quantization, grouped
GEMM geometry, and combine order across actor and rollout.
MHC, CUDA graphs, and weight reload
the batch-dependent fused path.
token order.
graph capture and replay.
finalize_weights_after_layerwise_reload()to refresh MHC broadcast weights.attn_sinkloading preserves-infpadding through the model weight loader.Hopper and Blackwell
projection path in batch-invariant mode.
than treating SM90 and SM100+ as numerically interchangeable.
Test Plan
quick_alignment_test, H100 aligned profile, andGB200 aligned profile.
Test Result
TODOTODO_VERL_PR_URLTODOTODOTODOEssential PR description checklist
Acknowledgements
The train/inference alignment strategy and deterministic kernel work are
informed by THUDM/slime#2262
and its SGLang/DeepGEMM/DeepEP alignment work led by
@zhuzilin.
Contributors
integration and the batch-invariant DeepSeek-V4 execution path.
36687196d62e0e26d4c29f19d505b1fc4e1df1e8, which widened fused-SiLUgroup counts and output offsets to 64-bit. The fix came from three failed
eight-node RL runs with long responses, added a
numel >= 2**31regression,and verified chunked/full bitwise parity on GB200 without measurable
regression.
@zobinHuang optimized the performance of
the batch-invariant vLLM execution path.