Skip to content

Commit 044ffd7

Browse files
committed
Add support for qwen3_vl and qwen3_vl_moe
Signed-off-by: booker123456 <945658361@qq.com>
1 parent 240ea55 commit 044ffd7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

vllm_ascend/models/qwen3_vl.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
class AscendQwen3_VisionPatchEmbed(Qwen3_VisionPatchEmbed):
43-
43+
4444
def forward(self, x: torch.Tensor) -> torch.Tensor:
4545
x = x.matmul(
4646
self.proj.weight.data.view(self.hidden_size, -1).transpose(0, 1))
@@ -71,14 +71,16 @@ def __init__(
7171
use_data_parallel=use_data_parallel)
7272

7373
def forward(self, x: torch.Tensor, cu_seqlens: torch.Tensor,
74-
cos: torch.Tensor, sin: torch.Tensor) -> torch.Tensor:
74+
cos: torch.Tensor, sin: torch.Tensor) -> torch.Tensor:
7575
x = x + self.attn(
7676
self.norm1(x), cu_seqlens=cu_seqlens, cos=cos, sin=sin)
7777

7878
x = x + self.mlp(self.norm2(x))
7979
return x
8080

81+
8182
class AscendQwen3_VisionTransformer(Qwen3_VisionTransformer):
83+
8284
def __init__(
8385
self,
8486
vision_config: Qwen3VLVisionConfig,
@@ -198,4 +200,4 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
198200
norm_eps=getattr(config, "rms_norm_eps", 1e-6),
199201
quant_config=self._maybe_ignore_quant_config(quant_config),
200202
prefix=maybe_prefix(prefix, "visual"),
201-
use_data_parallel=self.use_data_parallel)
203+
use_data_parallel=self.use_data_parallel)

vllm_ascend/models/qwen3_vl_moe.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
Qwen3MoeSparseMoeBlock)
4141
from vllm.model_executor.models.qwen3_vl_moe import (
4242
Qwen3MoeLLMForCausalLM, Qwen3MoeLLMModel, Qwen3VLDummyInputsBuilder,
43-
Qwen3VLMoeForConditionalGeneration, Qwen3VLMoeProcessingInfo,
43+
Qwen3VLMoeForConditionalGeneration, Qwen3VLMoeProcessingInfo,
4444
Qwen3VLMultiModalProcessor)
4545
from vllm.model_executor.models.utils import (
4646
PPMissingLayer, WeightsMapper, make_empty_intermediate_tensors_factory,
@@ -62,6 +62,7 @@
6262
"deepstack_input_embeds": 0
6363
})
6464
class AscendQwen3MoeLLMModel(Qwen3MoeLLMModel):
65+
6566
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
6667
nn.Module.__init__(self)
6768
config = vllm_config.model_config.hf_config.get_text_config()

0 commit comments

Comments
 (0)