Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions vllm_ascend/spec_decode/mtp_proposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
_MTP_MODELS = {
"DeepseekV3ForCausalLM":
("vllm.model_executor.models.deepseek_mtp", "DeepSeekMTP"),
"DeepseekV32ForCausalLM":
("vllm.model_executor.models.deepseek_mtp", "DeepSeekMTP"),
Comment on lines +58 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The MTP implementation for DeepseekV32ForCausalLM is identical to that of DeepseekV3ForCausalLM. This creates code duplication. To enhance maintainability and prevent potential bugs should the implementation path change in the future, it would be better to define this shared implementation path as a constant and reuse it for both model architectures.

For example:

DEEPSEEK_MTP_IMPL = ("vllm.model_executor.models.deepseek_mtp", "DeepSeekMTP")

_MTP_MODELS = {
    "DeepseekV3ForCausalLM": DEEPSEEK_MTP_IMPL,
    "DeepseekV32ForCausalLM": DEEPSEEK_MTP_IMPL,
    "Qwen3NextForCausalLM":
    ("vllm_ascend.models.qwen3_next_mtp", "CustomQwen3NextMTP")
}

"Qwen3NextForCausalLM":
("vllm_ascend.models.qwen3_next_mtp", "CustomQwen3NextMTP")
}
Expand Down
Loading