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
6 changes: 4 additions & 2 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@ def __init__(

from vllm.platforms import current_platform

if self.enable_sleep_mode and not current_platform.is_cuda():
raise ValueError("Sleep mode is only supported on CUDA devices.")
if (self.enable_sleep_mode
and not current_platform.is_sleep_mode_available()):
raise ValueError(
"Sleep mode is not supported on current platform.")

hf_config = get_config(self.hf_config_path or self.model,
trust_remote_code, revision, code_revision,
Expand Down
3 changes: 3 additions & 0 deletions vllm/platforms/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def is_cuda_alike(self) -> bool:
"""Stateless version of :func:`torch.cuda.is_available`."""
return self._enum in (PlatformEnum.CUDA, PlatformEnum.ROCM)

def is_sleep_mode_available(self) -> bool:
return self._enum == PlatformEnum.CUDA

@classmethod
def get_attn_backend_cls(cls, selected_backend: _Backend, head_size: int,
dtype: torch.dtype, kv_cache_dtype: Optional[str],
Expand Down