[Hardware][Intel] Add CPU inference backend (#3634)
Co-authored-by: Kunshang Ji <kunshang.ji@intel.com> Co-authored-by: Yuan Zhou <yuan.zhou@intel.com>
This commit is contained in:
co-authored by
Kunshang Ji
Yuan Zhou
parent
eb69d68804
commit
0e3f06fe9c
@@ -117,6 +117,13 @@ def is_hip() -> bool:
|
||||
return torch.version.hip is not None
|
||||
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def is_cpu() -> bool:
|
||||
from importlib.metadata import version
|
||||
is_cpu_flag = "cpu" in version("vllm")
|
||||
return is_cpu_flag
|
||||
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def is_neuron() -> bool:
|
||||
try:
|
||||
@@ -362,6 +369,9 @@ def is_pin_memory_available() -> bool:
|
||||
elif is_neuron():
|
||||
print_warning_once("Pin memory is not supported on Neuron.")
|
||||
return False
|
||||
elif is_cpu():
|
||||
print_warning_once("Pin memory is not supported on CPU.")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user