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
bcf6be4c
Commit
bcf6be4c
authored
Jul 11, 2025
by
zhuwenwen
Browse files
add qk contiguous
parent
3e0a595d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
vllm/model_executor/models/qwen3.py
vllm/model_executor/models/qwen3.py
+2
-2
vllm/model_executor/models/qwen3_moe.py
vllm/model_executor/models/qwen3_moe.py
+2
-2
No files found.
vllm/model_executor/models/qwen3.py
View file @
bcf6be4c
...
...
@@ -141,14 +141,14 @@ class Qwen3Attention(nn.Module):
if
envs
.
VLLM_USE_APEX_RN
:
q_by_head
=
self
.
q_norm
.
forward_apex
(
q_by_head
)
else
:
q_by_head
=
self
.
q_norm
(
q_by_head
)
q_by_head
=
self
.
q_norm
(
q_by_head
.
contiguous
()
)
q
=
q_by_head
.
view
(
q
.
shape
)
k_by_head
=
k
.
view
(
*
k
.
shape
[:
-
1
],
k
.
shape
[
-
1
]
//
self
.
head_dim
,
self
.
head_dim
)
if
envs
.
VLLM_USE_APEX_RN
:
k_by_head
=
self
.
k_norm
.
forward_apex
(
k_by_head
)
else
:
k_by_head
=
self
.
k_norm
(
k_by_head
)
k_by_head
=
self
.
k_norm
(
k_by_head
.
contiguous
()
)
k
=
k_by_head
.
view
(
k
.
shape
)
q
,
k
=
self
.
rotary_emb
(
positions
,
q
,
k
)
attn_output
=
self
.
attn
(
q
,
k
,
v
)
...
...
vllm/model_executor/models/qwen3_moe.py
View file @
bcf6be4c
...
...
@@ -234,7 +234,7 @@ class Qwen3MoeAttention(nn.Module):
if
envs
.
VLLM_USE_APEX_RN
:
q_by_head
=
self
.
q_norm
.
forward_apex
(
q_by_head
)
else
:
q_by_head
=
self
.
q_norm
(
q_by_head
)
q_by_head
=
self
.
q_norm
(
q_by_head
.
contiguous
()
)
q
=
q_by_head
.
view
(
q
.
shape
)
k_by_head
=
k
.
view
(
*
k
.
shape
[:
-
1
],
k
.
shape
[
-
1
]
//
self
.
head_dim
,
...
...
@@ -242,7 +242,7 @@ class Qwen3MoeAttention(nn.Module):
if
envs
.
VLLM_USE_APEX_RN
:
k_by_head
=
self
.
k_norm
.
forward_apex
(
k_by_head
)
else
:
k_by_head
=
self
.
k_norm
(
k_by_head
)
k_by_head
=
self
.
k_norm
(
k_by_head
.
contiguous
()
)
k
=
k_by_head
.
view
(
k
.
shape
)
q
,
k
=
self
.
rotary_emb
(
positions
,
q
,
k
)
attn_output
=
self
.
attn
(
q
,
k
,
v
)
...
...
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