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
9b61dd41
Unverified
Commit
9b61dd41
authored
Feb 28, 2025
by
Yang Liu
Committed by
GitHub
Feb 28, 2025
Browse files
[Bugfix] Initialize attention bias on the same device as Query/Key/Value for QwenVL Series (#14031)
parent
f7bee5c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
vllm/model_executor/models/qwen2_5_vl.py
vllm/model_executor/models/qwen2_5_vl.py
+2
-1
vllm/model_executor/models/qwen2_vl.py
vllm/model_executor/models/qwen2_vl.py
+2
-1
No files found.
vllm/model_executor/models/qwen2_5_vl.py
View file @
9b61dd41
...
...
@@ -323,7 +323,8 @@ class Qwen2_5_VisionAttention(nn.Module):
seqlens
=
(
cu_seqlens
[
1
:]
-
cu_seqlens
[:
-
1
]).
tolist
()
attn_bias
=
BlockDiagonalMask
.
from_seqlens
(
q_seqlen
=
seqlens
,
kv_seqlen
=
None
)
kv_seqlen
=
None
,
device
=
q
.
device
)
context_layer
=
xops
.
memory_efficient_attention_forward
(
q
,
k
,
v
,
attn_bias
=
attn_bias
,
p
=
0
,
scale
=
None
)
...
...
vllm/model_executor/models/qwen2_vl.py
View file @
9b61dd41
...
...
@@ -367,7 +367,8 @@ class Qwen2VisionAttention(nn.Module):
seqlens
=
(
cu_seqlens
[
1
:]
-
cu_seqlens
[:
-
1
]).
tolist
()
attn_bias
=
BlockDiagonalMask
.
from_seqlens
(
q_seqlen
=
seqlens
,
kv_seqlen
=
None
)
kv_seqlen
=
None
,
device
=
q
.
device
)
context_layer
=
xops
.
memory_efficient_attention_forward
(
q
,
k
,
v
,
attn_bias
=
attn_bias
,
p
=
0
,
scale
=
None
)
...
...
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