Skip to content

Commit 1d50daf

Browse files
committed
move check to base class
Signed-off-by: Chendi Xue <chendi.xue@intel.com>
1 parent 0a90268 commit 1d50daf

File tree

5 files changed

+4
-16
lines changed

5 files changed

+4
-16
lines changed

vllm_omni/platforms/cuda/platform.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,3 @@ def get_free_memory(cls, device: torch.device | None = None) -> int:
115115
@classmethod
116116
def get_device_name(cls, device_id: int = 0) -> str:
117117
return torch.cuda.get_device_name(device_id)
118-
119-
@classmethod
120-
def supports_cpu_offload(cls) -> bool:
121-
return True

vllm_omni/platforms/interface.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def synchronize(cls) -> None:
9898
def get_free_memory(cls, device: torch.device | None = None) -> int:
9999
raise NotImplementedError
100100

101+
@classmethod
102+
def supports_cpu_offload(cls) -> bool:
103+
return True
104+
101105

102106
class UnspecifiedOmniPlatform(OmniPlatform):
103107
_omni_enum = OmniPlatformEnum.UNSPECIFIED

vllm_omni/platforms/npu/platform.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,3 @@ def get_free_memory(cls, device: torch.device | None = None) -> int:
8686
def get_device_total_memory(cls, device_id: int = 0) -> int:
8787
device_props = torch.npu.get_device_properties(device_id)
8888
return device_props.total_memory
89-
90-
@classmethod
91-
def supports_cpu_offload(cls) -> bool:
92-
return False

vllm_omni/platforms/rocm/platform.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,3 @@ def synchronize(cls) -> None:
9999
def get_free_memory(cls, device: torch.device | None = None) -> int:
100100
free, _ = torch.cuda.mem_get_info(device)
101101
return free
102-
103-
@classmethod
104-
def supports_cpu_offload(cls) -> bool:
105-
return True

vllm_omni/platforms/xpu/platform.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,3 @@ def get_free_memory(cls, device: torch.device | None = None) -> int:
7979
device_id = device.index if device.index is not None else 0
8080
props = torch.xpu.get_device_properties(device_id)
8181
return props.total_memory
82-
83-
@classmethod
84-
def supports_cpu_offload(cls) -> bool:
85-
return True

0 commit comments

Comments
 (0)