@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 4286cc5ec2
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, 21:45 UTC

fix(minicpmv): fix audio inference by handling meta device in init_re… (#36751)

Signed-off-by: caitianchi <caitianchi@modelbest.cn>

tc-mb committed Mar 11, 2026 at 18:06 UTC 4286cc5ec24cf7a6d7c1a47e89dba914881be89a
1 file changed +10 -8
vllm/model_executor/models/minicpmv.py
+10 -8
@@ -1453,10 +1453,11 @@ class MiniCPMV2_6(MiniCPMVBaseModel, SupportsLoRA):
1453 quant_config=quant_config,
1454 prefix=prefix,
1455 )
1456 -
1457 - return resampler.to(
1458 - device=current_platform.device_type, dtype=torch.get_default_dtype()
1459 - )
1456 + target_device = current_platform.device_type
1457 + target_dtype = torch.get_default_dtype()
1458 + if any(p.is_meta for p in resampler.parameters()):
1459 + return resampler.to_empty(device=target_device).to(dtype=target_dtype)
1460 + return resampler.to(device=target_device, dtype=target_dtype)
1461
1462 def get_vision_hidden_states(self, data: MiniCPMVImagePixelInputs) -> torch.Tensor:
1463 pixel_values = data["pixel_values"]
@@ -1649,10 +1650,11 @@ class MiniCPMV4_5(MiniCPMVBaseModel, SupportsLoRA):
1650 quant_config=quant_config,
1651 prefix=prefix,
1652 )
1652 -
1653 - return resampler.to(
1654 - device=current_platform.device_type, dtype=torch.get_default_dtype()
1655 - )
1653 + target_device = current_platform.device_type
1654 + target_dtype = torch.get_default_dtype()
1655 + if any(p.is_meta for p in resampler.parameters()):
1656 + return resampler.to_empty(device=target_device).to(dtype=target_dtype)
1657 + return resampler.to(device=target_device, dtype=target_dtype)
1658
1659 def get_vision_hidden_states(self, data: MiniCPMVImagePixelInputs) -> torch.Tensor:
1660 pixel_values = data["pixel_values"]