-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[Model] Consolidate Deepseek-MoE implementation with DeepSeek-v2 #28101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
…deepseek-ocr-cpu Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
|
This pull request has merge conflicts that must be resolved before it can be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
vllm/vllm/model_executor/models/deepseek_v2.py
Lines 1277 to 1283 in 1ca29da
| class DeepseekV2ForCausalLM(nn.Module, SupportsPP, MixtureOfExperts, SupportsLoRA): | |
| packed_modules_mapping = { | |
| "gate_up_proj": ["gate_proj", "up_proj"], | |
| } | |
| def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): | |
| super().__init__() |
The old DeepseekForCausalLM exposed a packed_modules_mapping entry for "qkv_proj": ["q_proj", "k_proj", "v_proj"] so LoRA and quantization code could translate user‑facing module names to the packed QKVParallelLinear weights. After consolidating the Deepseek implementation into deepseek_v2.py, the new DeepseekForCausalLM simply inherits DeepseekV2ForCausalLM, whose mapping only includes gate_up_proj (and optionally fused_qkv_a_proj). As a result, LoRA loaders now have no mapping for q_proj, k_proj, or v_proj when targeting Deepseek MoE models (see vllm/lora/models.py for how these mappings are consumed), so adapters that previously worked will fail to register or load. Consider restoring the qkv_proj entry when self.use_mha is true so LoRA and packed quantization continue to work for the original Deepseek models.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
jikunshang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. thanks for refactoring!
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
|
LGTM. Thanks for the good work! I have validated Deepseek-OCR on Ascend NPU (910B) using the latest vllm-ascend main branch plus this PR, and the results are successful. |
…m-project#28101) Signed-off-by: Kunshang Ji <kunshang.ji@intel.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
…pSeek-v2 (vllm-project#28101) (vllm-project#14) Signed-off-by: Kunshang Ji <kunshang.ji@intel.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
How can I obtain a mirror environment that can successfully run DeepSeek-OCR? I tried the vllm-ascend-main image and found that its vllm version is v0.11.0. |
…m-project#28101) Signed-off-by: Kunshang Ji <kunshang.ji@intel.com> Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
Purpose
Test Plan
Test Result
Have confirmed CPU/XPU can run DeepSeek-COR now, and Deepseek-V2 isn't affected.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.