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
15 changes: 4 additions & 11 deletions vllm/config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@

logger = init_logger(__name__)


def is_cumem_allocator_available() -> bool:
try:
from vllm.device_allocator.cumem import cumem_available
except ImportError:
return False

return cumem_available


RunnerOption = Literal["auto", RunnerType]
ConvertType = Literal["none", "embed", "classify"]
ConvertOption = Literal["auto", ConvertType]
Expand Down Expand Up @@ -542,7 +532,10 @@ def __post_init__(
"Enabling cumem allocator because sleep mode requires it."
)
self.enable_cumem_allocator = True
if self.enable_cumem_allocator and not is_cumem_allocator_available():
if (
self.enable_cumem_allocator
and not current_platform.is_cumem_allocator_available()
):
raise ValueError("cumem allocator is not supported on current platform.")

hf_config = get_config(
Expand Down
8 changes: 8 additions & 0 deletions vllm/platforms/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ def is_sleep_mode_available(self) -> bool:
# all ROCm platforms for now.
return self._enum in (PlatformEnum.CUDA, PlatformEnum.ROCM)

def is_cumem_allocator_available(self) -> bool:
try:
from vllm.device_allocator.cumem import cumem_available
except ImportError:
return False

return cumem_available

@classmethod
def get_pass_manager_cls(cls) -> str:
"""
Expand Down
Loading