Skip to content

Commit 2b3f7ed

Browse files
committed
fix api mistakes
Signed-off-by: Chendi Xue <chendi.xue@intel.com>
1 parent d34a733 commit 2b3f7ed

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

vllm_omni/platforms/cuda/platform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def get_device_name(cls, device_id: int = 0) -> str:
118118

119119
@classmethod
120120
def reset_peak_memory_stats(cls, device: torch.device | None = None) -> None:
121-
torch.xpu.reset_peak_memory_stats(device)
121+
torch.cuda.reset_peak_memory_stats(device)
122122

123123
@classmethod
124124
def current_device_index(cls) -> int:
125-
return torch.xpu.current_device()
125+
return torch.cuda.current_device()

vllm_omni/platforms/npu/platform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def get_free_memory(cls, device: torch.device | None = None) -> int:
8484

8585
@classmethod
8686
def reset_peak_memory_stats(cls, device: torch.device | None = None) -> None:
87-
torch.xpu.reset_peak_memory_stats(device)
87+
torch.npu.reset_peak_memory_stats(device)
8888

8989
@classmethod
9090
def current_device_index(cls) -> int:
91-
return torch.xpu.current_device()
91+
return torch.npu.current_device()
9292

9393
@classmethod
9494
def get_device_total_memory(cls, device_id: int = 0) -> int:

vllm_omni/platforms/rocm/platform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def get_free_memory(cls, device: torch.device | None = None) -> int:
102102

103103
@classmethod
104104
def reset_peak_memory_stats(cls, device: torch.device | None = None) -> None:
105-
torch.xpu.reset_peak_memory_stats(device)
105+
torch.cuda.reset_peak_memory_stats(device)
106106

107107
@classmethod
108108
def current_device_index(cls) -> int:
109-
return torch.xpu.current_device()
109+
return torch.cuda.current_device()

0 commit comments

Comments
 (0)