mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-03-18 20:57:19 +08:00
fix for cpu
Signed-off-by: baonudesifeizhai <baonudesifeizhai@gmail.com>
This commit is contained in:
parent
a2774c4d69
commit
ff82fce3b2
@ -13,9 +13,7 @@ from vllm import LLM, SamplingParams
|
||||
from vllm.attention.backends.registry import AttentionBackendEnum
|
||||
from vllm.config import CompilationConfig, CompilationMode, CUDAGraphMode, PassConfig
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.utils.torch_utils import (
|
||||
is_torch_equal_or_newer,
|
||||
)
|
||||
from vllm.utils.torch_utils import is_torch_equal_or_newer
|
||||
|
||||
from ...utils import create_new_process_for_each_test
|
||||
|
||||
|
||||
@ -377,9 +377,12 @@ def _patch_get_raw_stream_if_needed():
|
||||
if is_torch_equal("2.9.0") or is_torch_equal("2.9.1"):
|
||||
import builtins
|
||||
|
||||
from torch._C import _cuda_getCurrentRawStream as _get_raw_stream
|
||||
# Check if CUDA functionality is available without initializing CUDA
|
||||
# _cuda_getCurrentRawStream only exists in CUDA builds of PyTorch
|
||||
if hasattr(torch._C, "_cuda_getCurrentRawStream"):
|
||||
from torch._C import _cuda_getCurrentRawStream as _get_raw_stream
|
||||
|
||||
builtins.get_raw_stream = _get_raw_stream
|
||||
builtins.get_raw_stream = _get_raw_stream
|
||||
|
||||
|
||||
_patch_get_raw_stream_if_needed()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user