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
b0507004
Unverified
Commit
b0507004
authored
Mar 22, 2026
by
Yang Liu
Committed by
GitHub
Mar 22, 2026
Browse files
[Perf] Optimize glm4.xv VIT (#37779)
Signed-off-by:
Yang
<
lymailforjob@gmail.com
>
parent
5dac719b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
vllm/model_executor/models/glm4_1v.py
vllm/model_executor/models/glm4_1v.py
+1
-2
No files found.
vllm/model_executor/models/glm4_1v.py
View file @
b0507004
...
...
@@ -758,11 +758,10 @@ class Glm4vVisionTransformer(nn.Module):
grid_thw
[:,
1
]
*
grid_thw
[:,
2
],
grid_thw
[:,
0
]
).
cumsum
(
dim
=
0
,
dtype
=
torch
.
int32
)
cu_seqlens
=
torch
.
cat
([
cu_seqlens
.
new_zeros
(
1
),
cu_seqlens
])
cu_seqlens
=
cu_seqlens
.
to
(
self
.
device
,
non_blocking
=
True
)
# pre-compute max_seqlen for attn mask to reduce cuMemcpy operations
max_seqlen
=
self
.
compute_attn_mask_seqlen
(
cu_seqlens
)
seqlens
=
(
cu_seqlens
[
1
:]
-
cu_seqlens
[:
-
1
]).
tolist
()
cu_seqlens
=
cu_seqlens
.
to
(
self
.
device
,
non_blocking
=
True
)
x
=
self
.
embeddings
(
x
,
seqlens
,
grid_thw
,
image_type_ids
[:,
0
],
image_type_ids
[:,
1
]
)
...
...
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