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
4f0f844b
Unverified
Commit
4f0f844b
authored
Aug 13, 2025
by
Po-Han Huang (NVIDIA)
Committed by
GitHub
Aug 12, 2025
Browse files
Fix cuda illegal mem access with Llama4 TP8 + rms_norm custom op (#22701)
Signed-off-by:
Po-Han Huang
<
pohanh@nvidia.com
>
parent
c5830381
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
vllm/model_executor/models/llama4.py
vllm/model_executor/models/llama4.py
+6
-2
No files found.
vllm/model_executor/models/llama4.py
View file @
4f0f844b
...
...
@@ -224,10 +224,14 @@ class Llama4Attention(nn.Module):
if
self
.
rotary_emb
is
not
None
:
q
,
k
=
self
.
rotary_emb
(
positions
,
q
,
k
)
if
self
.
qk_norm
is
not
None
:
q
=
q
.
reshape
(
-
1
,
self
.
num_heads
,
self
.
head_dim
)
# Normalization is applied on the head_dim dimension. The rest of
# the dimensions are collapsed into a single dimension to support
# custom rms_norm cuda kernel.
q
=
q
.
reshape
(
-
1
,
self
.
head_dim
)
q
=
self
.
qk_norm
(
q
.
float
()).
reshape
(
-
1
,
self
.
q_size
).
to
(
q
.
dtype
)
k
=
k
.
reshape
(
-
1
,
self
.
num_kv_heads
,
self
.
head_dim
)
k
=
k
.
reshape
(
-
1
,
self
.
head_dim
)
k
=
self
.
qk_norm
(
k
.
float
()).
reshape
(
-
1
,
self
.
kv_size
).
to
(
k
.
dtype
)
# We are applying temperature tuning (https://arxiv.org/abs/2501.19399)
...
...
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