Skip to content

Commit b824525

Browse files
authored
Move deepseek_v3 from deepseek_v2.py (#1793)
### What this PR does / why we need it? Before patch, we can see `vllm_ascend.models.deepseek_v2:CustomDeepseekV3ForCausalLM`, it seems not friendly format. ``` WARNING 07-14 23:57:34 [registry.py:413] Model architecture DeepseekV2ForCausalLM is already registered, and will be overwritten by the new model class vllm_ascend.models.deepseek_v2:CustomDeepseekV2ForCausalLM. WARNING 07-14 23:57:34 [registry.py:413] Model architecture DeepseekV3ForCausalLM is already registered, and will be overwritten by the new model class vllm_ascend.models.deepseek_v2:CustomDeepseekV3ForCausalLM. WARNING 07-14 23:57:34 [registry.py:413] Model architecture Qwen3MoeForCausalLM is already registered, and will be overwritten by the new model class vllm_ascend.models.qwen3_moe:CustomQwen3MoeForCausalLM. ``` ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Local Test. - vLLM version: v0.9.2 - vLLM main: vllm-project/vllm@bcdfb2a Signed-off-by: xleoken <xleoken@163.com>
1 parent ab68d31 commit b824525

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

vllm_ascend/models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def register_model():
77
from .deepseek_dbo import CustomDeepseekDBOForCausalLM # noqa: F401
88
from .deepseek_mtp import CustomDeepSeekMTP # noqa: F401
99
from .deepseek_v2 import CustomDeepseekV2ForCausalLM # noqa: F401
10-
from .deepseek_v2 import CustomDeepseekV3ForCausalLM # noqa: F401
10+
from .deepseek_v3 import CustomDeepseekV3ForCausalLM # noqa: F401
1111
from .qwen2_5_vl import \
1212
AscendQwen2_5_VLForConditionalGeneration # noqa: F401
1313
from .qwen2_vl import AscendQwen2VLForConditionalGeneration # noqa: F401
@@ -47,7 +47,7 @@ def register_model():
4747

4848
ModelRegistry.register_model(
4949
"DeepseekV3ForCausalLM",
50-
"vllm_ascend.models.deepseek_v2:CustomDeepseekV3ForCausalLM")
50+
"vllm_ascend.models.deepseek_v3:CustomDeepseekV3ForCausalLM")
5151

5252
ModelRegistry.register_model(
5353
"Qwen3MoeForCausalLM",

vllm_ascend/models/deepseek_v2.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,3 @@ def forward(
979979
attn_metadata, intermediate_tensors,
980980
inputs_embeds)
981981
return hidden_states
982-
983-
984-
class CustomDeepseekV3ForCausalLM(CustomDeepseekV2ForCausalLM):
985-
pass

vllm_ascend/models/deepseek_v3.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3+
# Copyright 2023 The vLLM team.
4+
# Copyright 2023 DeepSeek-AI and the HuggingFace Inc. team. All rights reserved.
5+
#
6+
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
7+
# and OPT implementations in this library. It has been modified from its
8+
# original forms to accommodate minor architectural differences compared
9+
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
10+
#
11+
# Licensed under the Apache License, Version 2.0 (the "License");
12+
# you may not use this file except in compliance with the License.
13+
# You may obtain a copy of the License at
14+
#
15+
# http://www.apache.org/licenses/LICENSE-2.0
16+
#
17+
# Unless required by applicable law or agreed to in writing, software
18+
# distributed under the License is distributed on an "AS IS" BASIS,
19+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
# See the License for the specific language governing permissions and
21+
# limitations under the License.
22+
23+
from vllm_ascend.models.deepseek_v2 import CustomDeepseekV2ForCausalLM
24+
25+
26+
class CustomDeepseekV3ForCausalLM(CustomDeepseekV2ForCausalLM):
27+
pass

0 commit comments

Comments
 (0)