Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
48b8456f
Unverified
Commit
48b8456f
authored
Dec 14, 2025
by
zifeitong
Committed by
GitHub
Dec 14, 2025
Browse files
[Bugfix] Revert Qwen2-VL part of change in #28271 (#30542)
Signed-off-by:
Zifei Tong
<
zifeitong@gmail.com
>
parent
5b64ac21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
vllm/model_executor/models/qwen2_vl.py
vllm/model_executor/models/qwen2_vl.py
+12
-1
No files found.
vllm/model_executor/models/qwen2_vl.py
View file @
48b8456f
...
@@ -50,7 +50,7 @@ from vllm.attention.layer import (
...
@@ -50,7 +50,7 @@ from vllm.attention.layer import (
)
)
from
vllm.config
import
VllmConfig
from
vllm.config
import
VllmConfig
from
vllm.config.multimodal
import
BaseDummyOptions
from
vllm.config.multimodal
import
BaseDummyOptions
from
vllm.distributed
import
parallel_state
from
vllm.distributed
import
parallel_state
,
tensor_model_parallel_all_gather
from
vllm.distributed
import
utils
as
dist_utils
from
vllm.distributed
import
utils
as
dist_utils
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
from
vllm.model_executor.layers.activation
import
QuickGELU
from
vllm.model_executor.layers.activation
import
QuickGELU
...
@@ -360,10 +360,21 @@ class Qwen2VisionAttention(nn.Module):
...
@@ -360,10 +360,21 @@ class Qwen2VisionAttention(nn.Module):
def
split_qkv
(
self
,
qkv
:
torch
.
Tensor
)
->
tuple
[
torch
.
Tensor
,
...]:
def
split_qkv
(
self
,
qkv
:
torch
.
Tensor
)
->
tuple
[
torch
.
Tensor
,
...]:
# [s, b, 3 * head * head_dim]
# [s, b, 3 * head * head_dim]
seq_len
,
bs
,
_
=
qkv
.
shape
seq_len
,
bs
,
_
=
qkv
.
shape
if
self
.
tp_size
>
1
:
qkv
=
tensor_model_parallel_all_gather
(
qkv
)
# [s, b, 3 * head * head_dim] -> 3 * [s, b, head * head_dim]
# [s, b, 3 * head * head_dim] -> 3 * [s, b, head * head_dim]
q
,
k
,
v
=
qkv
.
chunk
(
3
,
dim
=
2
)
q
,
k
,
v
=
qkv
.
chunk
(
3
,
dim
=
2
)
# 3 * [s, b, head * head_dim]
if
self
.
tp_size
>
1
:
splitter
=
partial
(
dist_utils
.
split_tensor_along_last_dim
,
num_partitions
=
self
.
tp_size
)
q
=
splitter
(
q
)[
self
.
tp_rank
]
k
=
splitter
(
k
)[
self
.
tp_rank
]
v
=
splitter
(
v
)[
self
.
tp_rank
]
# 3 * [s, b, head * head_dim] -> 3 * [s, b, head, head_dim]
# 3 * [s, b, head * head_dim] -> 3 * [s, b, head, head_dim]
new_shape
=
(
new_shape
=
(
seq_len
,
seq_len
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment