[Hardware][Intel] Support compressed-tensor W8A8 for CPU backend (#7257)

This commit is contained in:
Li, Jiang
2024-09-11 09:46:46 -07:00
committed by GitHub
parent 3b7fea770f
commit 0b952af458
18 changed files with 686 additions and 43 deletions
+7 -3
View File
@@ -1,5 +1,5 @@
import enum
from typing import Tuple
from typing import Optional, Tuple
import torch
@@ -8,6 +8,7 @@ class PlatformEnum(enum.Enum):
CUDA = enum.auto()
ROCM = enum.auto()
TPU = enum.auto()
CPU = enum.auto()
UNSPECIFIED = enum.auto()
@@ -23,9 +24,12 @@ class Platform:
def is_tpu(self) -> bool:
return self._enum == PlatformEnum.TPU
def is_cpu(self) -> bool:
return self._enum == PlatformEnum.CPU
@staticmethod
def get_device_capability(device_id: int = 0) -> Tuple[int, int]:
raise NotImplementedError
def get_device_capability(device_id: int = 0) -> Optional[Tuple[int, int]]:
return None
@staticmethod
def get_device_name(device_id: int = 0) -> str: