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
556ef7f7
Unverified
Commit
556ef7f7
authored
Feb 14, 2025
by
Jun Duan
Committed by
GitHub
Feb 14, 2025
Browse files
[Misc] Log time consumption of sleep and wake-up (#13115)
Signed-off-by:
Jun Duan
<
jun.duan.phd@outlook.com
>
parent
83481ceb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
vllm/executor/executor_base.py
vllm/executor/executor_base.py
+9
-0
No files found.
vllm/executor/executor_base.py
View file @
556ef7f7
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
import
asyncio
import
asyncio
import
time
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
from
typing
import
(
Any
,
Awaitable
,
Callable
,
Dict
,
List
,
Optional
,
Set
,
Tuple
,
from
typing
import
(
Any
,
Awaitable
,
Callable
,
Dict
,
List
,
Optional
,
Set
,
Tuple
,
Union
)
Union
)
...
@@ -200,15 +201,23 @@ class ExecutorBase(ABC):
...
@@ -200,15 +201,23 @@ class ExecutorBase(ABC):
if
self
.
is_sleeping
:
if
self
.
is_sleeping
:
logger
.
warning
(
"Executor is already sleeping."
)
logger
.
warning
(
"Executor is already sleeping."
)
return
return
time_before_sleep
=
time
.
perf_counter
()
self
.
collective_rpc
(
"sleep"
,
kwargs
=
dict
(
level
=
level
))
self
.
collective_rpc
(
"sleep"
,
kwargs
=
dict
(
level
=
level
))
time_after_sleep
=
time
.
perf_counter
()
self
.
is_sleeping
=
True
self
.
is_sleeping
=
True
logger
.
info
(
"It took %.6f seconds to fall asleep."
,
time_after_sleep
-
time_before_sleep
)
def
wake_up
(
self
):
def
wake_up
(
self
):
if
not
self
.
is_sleeping
:
if
not
self
.
is_sleeping
:
logger
.
warning
(
"Executor is not sleeping."
)
logger
.
warning
(
"Executor is not sleeping."
)
return
return
time_before_wakeup
=
time
.
perf_counter
()
self
.
collective_rpc
(
"wake_up"
)
self
.
collective_rpc
(
"wake_up"
)
time_after_wakeup
=
time
.
perf_counter
()
self
.
is_sleeping
=
False
self
.
is_sleeping
=
False
logger
.
info
(
"It took %.6f seconds to wake up."
,
time_after_wakeup
-
time_before_wakeup
)
def
save_sharded_state
(
def
save_sharded_state
(
self
,
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