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 7, 01:30 UTC
[Bugfix] Avoid to replace non-tensor members in cpu model runner (#36430)
Signed-off-by: jiang1.li <jiang1.li@intel.com>
Li, Jiang committed
Mar 9, 2026 at 13:06 UTC
217f27598dbf3cc8ec0765cc3a41b667939ce6bb
1 file changed
+3
-3
vllm/v1/worker/cpu_model_runner.py
+3
-3
@@ -34,9 +34,9 @@ class CPUModelRunner(GPUModelRunner):
34
def replace_tensor(obj: Any, cpu_attr_name: str, device_attr_name) -> None:
35
cpu_tensor = getattr(obj, cpu_attr_name, None)
36
device_tensor = getattr(obj, device_attr_name, None)
37
- if cpu_tensor is not None and device_tensor is not None:
38
- assert isinstance(cpu_tensor, torch.Tensor)
39
- assert isinstance(device_tensor, torch.Tensor)
37
+ if isinstance(cpu_tensor, torch.Tensor) and isinstance(
38
+ device_tensor, torch.Tensor
39
+ ):
40
setattr(obj, device_attr_name, cpu_tensor)
41
42
for v in vars(self).values():