[Bugfix][CPU] Fix CPU model runner v2 (#46365)

Signed-off-by: jiang1.li <jiang1.li@intel.com>
This commit is contained in:
Li, Jiang
2026-06-22 22:52:05 +08:00
committed by GitHub
parent 9a938df64e
commit 1c7bc18318
+5
View File
@@ -17,6 +17,10 @@ def noop(*args: Any, **kwargs: Any) -> None:
pass
def fake_pin_memory(self: torch.Tensor, *args: Any, **kwargs: Any) -> torch.Tensor:
return self
class _EventPlaceholder:
def __init__(self, *args, **kwargs) -> None:
self.record = noop
@@ -41,6 +45,7 @@ torch.cuda.set_stream = noop
torch.cuda.current_stream = lambda *args, **kwargs: _StreamPlaceholder()
torch.accelerator.synchronize = noop
torch.accelerator.empty_cache = noop
torch.Tensor.pin_memory = fake_pin_memory
# Patch vLLM torch utils
import vllm.utils.torch_utils as torch_utils