@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7938d12119
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, 04:30 UTC

[Bugfix] Fix CPU backend crash in KV cache block zeroing (#37550)

Signed-off-by: DorBernsohn <dor.bernsohn@gmail.com>

DorBernsohn committed Mar 23, 2026 at 13:35 UTC 7938d121196d87a710b93e55ce4cefa6a11bedd8
1 file changed +5
vllm/v1/worker/cpu_model_runner.py
+5
@@ -88,6 +88,11 @@ class CPUModelRunner(GPUModelRunner):
88 def _sync_device(self) -> None:
89 pass
90
91 + def _zero_block_ids(self, block_ids: list[int]) -> None:
92 + # CPU attention assigns -INF to logits at invalid positions,
93 + # so stale KV cache data never affects computation.
94 + pass
95 +
96 def get_dp_padding(self, num_tokens: int) -> tuple[int, torch.Tensor | None]:
97 # Note: For CPU backend, dp padding is not required for now.
98 return 0, None