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
3f50c148
Unverified
Commit
3f50c148
authored
Jan 24, 2025
by
youkaichao
Committed by
GitHub
Jan 24, 2025
Browse files
[core] add wake_up doc and some sanity check (#12361)
Signed-off-by:
youkaichao
<
youkaichao@gmail.com
>
parent
8c01b802
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
vllm/entrypoints/llm.py
vllm/entrypoints/llm.py
+3
-0
vllm/executor/executor_base.py
vllm/executor/executor_base.py
+9
-0
No files found.
vllm/entrypoints/llm.py
View file @
3f50c148
...
...
@@ -1157,6 +1157,9 @@ class LLM:
self
.
llm_engine
.
sleep
(
level
=
level
)
def
wake_up
(
self
):
"""
Wake up the engine from sleep mode. See the :meth:`sleep` method
for more details."""
self
.
llm_engine
.
wake_up
()
# LEGACY
...
...
vllm/executor/executor_base.py
View file @
3f50c148
...
...
@@ -47,6 +47,7 @@ class ExecutorBase(ABC):
self
.
prompt_adapter_config
=
vllm_config
.
prompt_adapter_config
self
.
observability_config
=
vllm_config
.
observability_config
self
.
_init_executor
()
self
.
is_sleeping
=
False
@
abstractmethod
def
_init_executor
(
self
)
->
None
:
...
...
@@ -194,10 +195,18 @@ class ExecutorBase(ABC):
self
.
collective_rpc
(
"stop_profile"
)
def
sleep
(
self
,
level
:
int
=
1
):
if
self
.
is_sleeping
:
logger
.
warning
(
"Executor is already sleeping."
)
return
self
.
collective_rpc
(
"sleep"
,
kwargs
=
dict
(
level
=
level
))
self
.
is_sleeping
=
True
def
wake_up
(
self
):
if
not
self
.
is_sleeping
:
logger
.
warning
(
"Executor is not sleeping."
)
return
self
.
collective_rpc
(
"wake_up"
)
self
.
is_sleeping
=
False
def
save_sharded_state
(
self
,
...
...
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