Skip to content

Commit 392ef17

Browse files
committed
Adding support for qwen3_vl Dense
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
1 parent 1d23a92 commit 392ef17

File tree

6 files changed

+1791
-365
lines changed

6 files changed

+1791
-365
lines changed

QEfficient/transformers/models/pytorch_transforms.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,23 @@
168168
Qwen3Model,
169169
Qwen3RMSNorm,
170170
)
171+
from transformers.models.qwen3_vl.modeling_qwen3_vl import (
172+
Qwen3VLForConditionalGeneration,
173+
Qwen3VLModel,
174+
Qwen3VLTextAttention,
175+
Qwen3VLTextDecoderLayer,
176+
Qwen3VLTextModel,
177+
Qwen3VLTextRMSNorm,
178+
Qwen3VLVisionAttention,
179+
Qwen3VLVisionModel,
180+
)
171181
from transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe import (
172182
Qwen3VLMoeForConditionalGeneration,
173183
Qwen3VLMoeModel,
174184
Qwen3VLMoeTextAttention,
175185
Qwen3VLMoeTextDecoderLayer,
176186
Qwen3VLMoeTextModel,
177187
Qwen3VLMoeTextRMSNorm,
178-
Qwen3VLMoeTextSparseMoeBlock,
179188
Qwen3VLMoeVisionAttention,
180189
Qwen3VLMoeVisionModel,
181190
)
@@ -387,13 +396,22 @@
387396
QEffQwen3ForCausalLM,
388397
QEffQwen3Model,
389398
)
399+
from QEfficient.transformers.models.qwen3_vl.modeling_qwen3_vl import (
400+
QEffQwen3VLForConditionalGeneration,
401+
QEffQwen3VLModel,
402+
QEffQwen3VLTextAttention,
403+
QEffQwen3VLTextDecoderLayer,
404+
QEffQwen3VLTextModel,
405+
QEffQwen3VLVisionAttention,
406+
QEffQwen3VLVisionModel,
407+
)
390408
from QEfficient.transformers.models.qwen3_vl_moe.modeling_qwen3_vl_moe import (
391409
QEffQwen3VLMoeForConditionalGeneration,
392410
QEffQwen3VLMoeModel,
393411
QEffQwen3VLMoeTextAttention,
394412
QEffQwen3VLMoeTextDecoderLayer,
395413
QEffQwen3VLMoeTextModel,
396-
QEffQwen3VLMoeTextSparseMoeBlock,
414+
# QEffQwen3VLMoeTextSparseMoeBlock,
397415
QEffQwen3VLMoeVisionAttention,
398416
QEffQwen3VLMoeVisionModel,
399417
)
@@ -440,6 +458,7 @@ class CustomOpsTransform(ModuleMappingTransform):
440458
GraniteRMSNorm: CustomRMSNormAIC,
441459
GraniteMoeRMSNorm: CustomRMSNormAIC,
442460
Qwen3VLMoeTextRMSNorm: CustomRMSNormAIC,
461+
Qwen3VLTextRMSNorm: CustomRMSNormAIC,
443462
Gemma3RMSNorm: QEffGemma3CustomRMSNormAIC,
444463
# Qwen3VLMoeTextRMSNorm: CustomRMSNormAIC,
445464
}
@@ -597,7 +616,17 @@ class KVCacheTransform(ModuleMappingTransform):
597616
Qwen3VLMoeVisionAttention: QEffQwen3VLMoeVisionAttention,
598617
Qwen3VLMoeVisionModel: QEffQwen3VLMoeVisionModel,
599618
Qwen3VLMoeTextModel: QEffQwen3VLMoeTextModel,
600-
Qwen3VLMoeTextSparseMoeBlock: QEffQwen3VLMoeTextSparseMoeBlock,
619+
620+
#qwen3vl
621+
Qwen3VLForConditionalGeneration: QEffQwen3VLForConditionalGeneration,
622+
Qwen3VLModel: QEffQwen3VLModel,
623+
Qwen3VLTextAttention: QEffQwen3VLTextAttention,
624+
Qwen3VLTextDecoderLayer: QEffQwen3VLTextDecoderLayer,
625+
Qwen3VLVisionAttention: QEffQwen3VLVisionAttention,
626+
Qwen3VLVisionModel: QEffQwen3VLVisionModel,
627+
Qwen3VLTextModel: QEffQwen3VLTextModel,
628+
629+
# Qwen3VLMoeTextSparseMoeBlock: QEffQwen3VLMoeTextSparseMoeBlock,
601630
# Grok1
602631
# Qwen2_5_VLTextModel: QEffQwen2_5_VLTextModel,
603632
# Starcoder2
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -----------------------------------------------------------------------------
2+
#
3+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)