@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / b050700462
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 6, 05:45 UTC

[Perf] Optimize glm4.xv VIT (#37779)

Signed-off-by: Yang <lymailforjob@gmail.com>

Yang Liu committed Mar 22, 2026 at 02:12 UTC b0507004625a7e684ee9df1bc9a2058b9258fd5a
1 file changed +1 -2
vllm/model_executor/models/glm4_1v.py
+1 -2
@@ -758,11 +758,10 @@ class Glm4vVisionTransformer(nn.Module):
758 grid_thw[:, 1] * grid_thw[:, 2], grid_thw[:, 0]
759 ).cumsum(dim=0, dtype=torch.int32)
760 cu_seqlens = torch.cat([cu_seqlens.new_zeros(1), cu_seqlens])
761 - cu_seqlens = cu_seqlens.to(self.device, non_blocking=True)
762 -
761 # pre-compute max_seqlen for attn mask to reduce cuMemcpy operations
762 max_seqlen = self.compute_attn_mask_seqlen(cu_seqlens)
763 seqlens = (cu_seqlens[1:] - cu_seqlens[:-1]).tolist()
764 + cu_seqlens = cu_seqlens.to(self.device, non_blocking=True)
765 x = self.embeddings(
766 x, seqlens, grid_thw, image_type_ids[:, 0], image_type_ids[:, 1]
767 )