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
f17c0758
Unverified
Commit
f17c0758
authored
Sep 13, 2025
by
Samit
Committed by
GitHub
Sep 12, 2025
Browse files
[Model] Switch to Fused RMSNorm in GLM-4.1V model (#24733)
Signed-off-by:
SamitHuang
<
285365963@qq.com
>
parent
b0d1213a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
vllm/model_executor/models/glm4_1v.py
vllm/model_executor/models/glm4_1v.py
+3
-2
No files found.
vllm/model_executor/models/glm4_1v.py
View file @
f17c0758
...
@@ -419,15 +419,16 @@ class Glm4vVisionBlock(nn.Module):
...
@@ -419,15 +419,16 @@ class Glm4vVisionBlock(nn.Module):
max_seqlen
:
Optional
[
int
]
=
None
,
# Only used for Flash Attention
max_seqlen
:
Optional
[
int
]
=
None
,
# Only used for Flash Attention
seqlens
:
Optional
[
list
[
int
]]
=
None
,
# Only used for xFormers
seqlens
:
Optional
[
list
[
int
]]
=
None
,
# Only used for xFormers
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
x
=
x
+
self
.
attn
(
x
_attn
=
self
.
attn
(
self
.
norm1
(
x
),
self
.
norm1
(
x
),
cu_seqlens
=
cu_seqlens
,
cu_seqlens
=
cu_seqlens
,
rotary_pos_emb
=
rotary_pos_emb
,
rotary_pos_emb
=
rotary_pos_emb
,
max_seqlen
=
max_seqlen
,
max_seqlen
=
max_seqlen
,
seqlens
=
seqlens
,
seqlens
=
seqlens
,
)
)
x_fused_norm
,
residual
=
self
.
norm2
(
x
,
residual
=
x_attn
)
x
=
residual
+
self
.
mlp
(
x_fused_norm
)
x
=
x
+
self
.
mlp
(
self
.
norm2
(
x
))
return
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