Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions vllm/platforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def tpu_platform_plugin() -> Optional[str]:
logger.debug("Confirmed TPU platform is available.")
except Exception as e:
logger.debug("TPU platform is not available because: %s", str(e))
pass

return "vllm.platforms.tpu.TpuPlatform" if is_tpu else None

Expand Down Expand Up @@ -112,7 +111,6 @@ def rocm_platform_plugin() -> Optional[str]:
amdsmi.amdsmi_shut_down()
except Exception as e:
logger.debug("ROCm platform is not available because: %s", str(e))
pass

return "vllm.platforms.rocm.RocmPlatform" if is_rocm else None

Expand All @@ -130,7 +128,6 @@ def hpu_platform_plugin() -> Optional[str]:
"habana_frameworks is not found.")
except Exception as e:
logger.debug("HPU platform is not available because: %s", str(e))
pass

return "vllm.platforms.hpu.HpuPlatform" if is_hpu else None

Expand All @@ -148,7 +145,6 @@ def xpu_platform_plugin() -> Optional[str]:
logger.debug("Confirmed XPU platform is available.")
except Exception as e:
logger.debug("XPU platform is not available because: %s", str(e))
pass

return "vllm.platforms.xpu.XPUPlatform" if is_xpu else None

Expand All @@ -170,7 +166,6 @@ def cpu_platform_plugin() -> Optional[str]:

except Exception as e:
logger.debug("CPU platform is not available because: %s", str(e))
pass

return "vllm.platforms.cpu.CpuPlatform" if is_cpu else None

Expand Down Expand Up @@ -222,8 +217,11 @@ def resolve_current_platform_cls_qualname() -> str:
platform_cls_qualname = func()
if platform_cls_qualname is not None:
activated_plugins.append(name)
logger.info("Platform plugin %s loaded.", name)
logger.warning(
"Platform plugin %s function's return value is None", name)
except Exception:
pass
logger.exception("Failed to load platform plugin %s", name)

activated_builtin_plugins = list(
set(activated_plugins) & set(builtin_platform_plugins.keys()))
Expand Down
4 changes: 2 additions & 2 deletions vllm/platforms/hpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def get_attn_backend_cls(cls, selected_backend: _Backend, head_size: int,
def is_async_output_supported(cls, enforce_eager: Optional[bool]) -> bool:
return True

@staticmethod
def inference_mode():
@classmethod
def inference_mode(cls):
return torch.no_grad()

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions vllm/platforms/rocm.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ def get_device_capability(cls,
major, minor = torch.cuda.get_device_capability(device_id)
return DeviceCapability(major=major, minor=minor)

@staticmethod
@classmethod
@with_amdsmi_context
def is_fully_connected(physical_device_ids: list[int]) -> bool:
def is_fully_connected(cls, physical_device_ids: list[int]) -> bool:
"""
Query if the set of gpus are fully connected by xgmi (1 hop)
"""
Expand Down
14 changes: 8 additions & 6 deletions vllm/platforms/xpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ def get_attn_backend_cls(cls, selected_backend: _Backend, head_size: int,
logger.info("Using IPEX attention backend.")
return "vllm.attention.backends.ipex_attn.IpexAttnBackend"

@staticmethod
@classmethod
def get_device_capability(
device_id: int = 0) -> Optional[DeviceCapability]:
cls,
device_id: int = 0,
) -> Optional[DeviceCapability]:
# capacity format differs from cuda's and will cause unexpected
# failure, so use None directly
return None

@staticmethod
def get_device_name(device_id: int = 0) -> str:
@classmethod
def get_device_name(cls, device_id: int = 0) -> str:
return torch.xpu.get_device_name(device_id)

@classmethod
Expand All @@ -57,8 +59,8 @@ def get_device_total_memory(cls, device_id: int = 0) -> int:
def is_async_output_supported(cls, enforce_eager: Optional[bool]) -> bool:
return True

@staticmethod
def inference_mode():
@classmethod
def inference_mode(cls):
return torch.no_grad()

@classmethod
Expand Down