Repository navigation
[Refactor][DSv4.1] Remove duplicated code - #64974
Merged
gau-nernst merged 5 commits intoNov 3, 2026
Merged
Conversation
…of copying them deepseek_v41 carried byte-identical copies of several deepseek_v4 module-level helpers (three Triton kernels, the FlashInfer sparse helpers, two config readers) and three copies of DeepseekV4MixtureOfExperts. Import the helpers from deepseek_v4 and move DeepseekV4MixtureOfExperts into deepseek_v4/common/eplb_util.py so the NVIDIA and ROCm models share one copy. Only definitions whose source and referenced globals are identical in both packages are shared; no behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Canlin <canlinguosdu@gmail.com>
The helpers deepseek_v41 now imports from deepseek_v4 are part of the package's cross-module surface, so drop their leading underscores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Canlin <canlinguosdu@gmail.com>
hf_config_int/scheduler_config_int guarded against a missing model or scheduler config, but warmup always receives the engine's VllmConfig: max_num_batched_tokens is validated >= 1 and DeepseekV4/V41 configs expose sliding_window and index_topk at the top level, as the attention layers already assume. Read the fields directly; the generated warmup keys are unchanged for the V4 and V4.1 configs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Canlin <canlinguosdu@gmail.com>
The NVIDIA and ROCm DeepseekV4MoE classes have no common base, so a mixin shared across both can only type its MoE layers as Any. Keep it in deepseek_v4/nvidia/model.py, typed with the V4 MoE that the V4.1 NVIDIA MoE subclasses, and import it from there; the ROCm model keeps its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Canlin <canlinguosdu@gmail.com>
Contributor
Author
|
@Juntian777 @WoosukKwon Some clean up for DSv4.1. Could you please take a look? :) |
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
…e-v4-leaves Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Canlin <canlinguosdu@gmail.com>
Contributor
Author
|
/ci run |
|
✅ Triggered Buildkite CI #99427 for commit |
yaoyaoding
added a commit
to yaoyaoding/vllm
that referenced
this pull request
Nov 3, 2026
Resolve two conflicts under vllm/models/deepseek_v41/nvidia/: - dspark.py: keep main's dspark_fused_markov opt-in (vllm-project#64442) beside the draft executor's registration, and main's compute_draft_logits_local. - moe/routed_expert_gemm.py: take current_cu_stream from main's shared moe_tail_fusion primitives (vllm-project#64974) and keep the finalize kernel. Signed-off-by: Yaoyao Ding <yaoyaod@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Overview
Remove code that
deepseek_v41duplicates fromdeepseek_v4. No behavior change.Claims
deepseek_v41carried as byte-identical copies ofdeepseek_v4are removed and imported fromdeepseek_v4instead: the Triton kernelsquantize_and_insert_k_kernel,remap_flashinfer_indexandfill_short_context_topk_indices, and the FlashInfer sparse helpersget_flashinfer_dsv4_workspace,packed_block_span,pad_to_supported_q_headsandrequired_sm120_sparse_topk. They lose their leading underscore now that another package imports them.hf_config_int/scheduler_config_inthelpers. Warmup always receives the engine'sVllmConfig, so the warmup code now readssliding_window/index_topkdirectly, and themax_num_batched_tokens <= 0early return is dropped (the field is validated>= 1).deepseek_v41/nvidiaimportsDeepseekV4MixtureOfExpertsfromdeepseek_v4/nvidiainstead of keeping its own copy, since its MoE subclasses the V4 one. The ROCm model keeps its copy because its MoE has a different base.