Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
d2020aca
"vscode:/vscode.git/clone" did not exist on "4eafc729285e459a5fc96efd6f7b313b155cad48"
Unverified
Commit
d2020aca
authored
Apr 15, 2025
by
Shuqiao Li
Committed by
GitHub
Apr 14, 2025
Browse files
config check sleep mode support oot platforms (#16562)
parent
1eb3c2ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
vllm/config.py
vllm/config.py
+4
-2
vllm/platforms/interface.py
vllm/platforms/interface.py
+3
-0
No files found.
vllm/config.py
View file @
d2020aca
...
@@ -417,8 +417,10 @@ class ModelConfig:
...
@@ -417,8 +417,10 @@ class ModelConfig:
from
vllm.platforms
import
current_platform
from
vllm.platforms
import
current_platform
if
self
.
enable_sleep_mode
and
not
current_platform
.
is_cuda
():
if
(
self
.
enable_sleep_mode
raise
ValueError
(
"Sleep mode is only supported on CUDA devices."
)
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
,
hf_config
=
get_config
(
self
.
hf_config_path
or
self
.
model
,
trust_remote_code
,
revision
,
code_revision
,
trust_remote_code
,
revision
,
code_revision
,
...
...
vllm/platforms/interface.py
View file @
d2020aca
...
@@ -148,6 +148,9 @@ class Platform:
...
@@ -148,6 +148,9 @@ class Platform:
"""Stateless version of :func:`torch.cuda.is_available`."""
"""Stateless version of :func:`torch.cuda.is_available`."""
return
self
.
_enum
in
(
PlatformEnum
.
CUDA
,
PlatformEnum
.
ROCM
)
return
self
.
_enum
in
(
PlatformEnum
.
CUDA
,
PlatformEnum
.
ROCM
)
def
is_sleep_mode_available
(
self
)
->
bool
:
return
self
.
_enum
==
PlatformEnum
.
CUDA
@
classmethod
@
classmethod
def
get_attn_backend_cls
(
cls
,
selected_backend
:
_Backend
,
head_size
:
int
,
def
get_attn_backend_cls
(
cls
,
selected_backend
:
_Backend
,
head_size
:
int
,
dtype
:
torch
.
dtype
,
kv_cache_dtype
:
Optional
[
str
],
dtype
:
torch
.
dtype
,
kv_cache_dtype
:
Optional
[
str
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment