From e7cba8f6b109c3baee107a222c79365e7f3ea70f Mon Sep 17 00:00:00 2001 From: Naman Lalit Date: Fri, 26 Sep 2025 17:07:36 -0700 Subject: [PATCH] [Bugfix] Optimize CpuGpuBuffer initialization (#25447) Signed-off-by: Naman Lalit Signed-off-by: yewentao256 --- vllm/v1/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/v1/utils.py b/vllm/v1/utils.py index ec4417290f611..ee0c1168f3cd0 100644 --- a/vllm/v1/utils.py +++ b/vllm/v1/utils.py @@ -117,7 +117,7 @@ class CpuGpuBuffer: dtype=dtype, device="cpu", pin_memory=pin_memory) - self.gpu = self.cpu.to(device) + self.gpu = torch.zeros_like(self.cpu, device=device) self.np: np.ndarray # To keep type hints simple (avoiding generics and subclasses), we # only conditionally create the numpy array attribute. This can cause