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 14, 23:45 UTC
[Bugfix] Fix shape checking for Fuyu (#21709)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Jul 28, 2025 at 15:05 UTC
139a97ec563d305919f5f5ef1b5c878c1925fd54
1 file changed
+5
-4
vllm/model_executor/models/fuyu.py
+5
-4
@@ -55,14 +55,15 @@ class FuyuImagePatchInputs(TensorSchema):
55
"""
56
Dimensions:
57
- bn: Batch size * number of images
58
- - fn: Num channels * patch_size_x * patch_size_y
58
+ - bnp: Batch size * number of images * number of patches
59
+ - fn: patch_size_x * patch_size_y * num_channels
60
"""
61
62
type: Literal["image_patches"] = "image_patches"
63
64
flat_data: Annotated[
65
torch.Tensor,
65
- TensorShape("bn", "fn"),
66
+ TensorShape("bnp", "fn"),
67
]
68
69
patches_per_image: Annotated[list[int], TensorShape("bn")]
@@ -309,8 +310,8 @@ class FuyuForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
310
image_patches = kwargs.pop("image_patches", None)
311
if image_patches is not None:
312
image_patches_flat = flatten_bn(image_patches)
312
- flat_data = flatten_bn(image_patches, concat=True).data.to(
313
- self.vision_embed_tokens.weight.dtype)
313
+ flat_data = flatten_bn(image_patches_flat, concat=True)
314
+
315
return FuyuImagePatchInputs(
316
type="image_patches",
317
flat_data=flat_data,