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
9dd02d85
Unverified
Commit
9dd02d85
authored
Jan 13, 2025
by
Siyuan Li
Committed by
GitHub
Jan 13, 2025
Browse files
[Bug] Fix usage of `.transpose()` and `.view()` consecutively. (#11979)
parent
f7b3ba82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
vllm/attention/layer.py
vllm/attention/layer.py
+1
-1
vllm/model_executor/models/intern_vit.py
vllm/model_executor/models/intern_vit.py
+1
-1
No files found.
vllm/attention/layer.py
View file @
9dd02d85
...
...
@@ -230,7 +230,7 @@ class MultiHeadAttention(nn.Module):
value
,
scale
=
self
.
scale
)
out
=
out
.
transpose
(
1
,
2
)
return
out
.
view
(
bsz
,
q_len
,
-
1
)
return
out
.
reshape
(
bsz
,
q_len
,
-
1
)
def
unified_attention
(
...
...
vllm/model_executor/models/intern_vit.py
View file @
9dd02d85
...
...
@@ -271,7 +271,7 @@ class InternSdpaAttention(nn.Module):
v
=
v
.
transpose
(
1
,
2
)
x
=
F
.
scaled_dot_product_attention
(
q
,
k
,
v
,
scale
=
self
.
scale
)
x
=
x
.
transpose
(
1
,
2
).
view
(
B
,
N
,
-
1
)
x
=
x
.
transpose
(
1
,
2
).
reshape
(
B
,
N
,
-
1
)
x
=
self
.
proj
(
x
)
return
x
...
...
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