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
3a922c1e
Unverified
Commit
3a922c1e
authored
May 02, 2024
by
Roy
Committed by
GitHub
May 01, 2024
Browse files
[Bugfix][Core] Fix and refactor logging stats (#4336)
parent
c47ba4aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
vllm/engine/async_llm_engine.py
vllm/engine/async_llm_engine.py
+9
-5
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+7
-5
No files found.
vllm/engine/async_llm_engine.py
View file @
3a922c1e
...
...
@@ -8,6 +8,7 @@ from typing import (Any, AsyncIterator, Callable, Dict, Iterable, List,
from
transformers
import
PreTrainedTokenizer
from
vllm.config
import
DecodingConfig
,
ModelConfig
from
vllm.core.scheduler
import
SchedulerOutputs
from
vllm.engine.arg_utils
import
AsyncEngineArgs
from
vllm.engine.llm_engine
import
LLMEngine
from
vllm.executor.ray_utils
import
initialize_ray_cluster
,
ray
...
...
@@ -15,7 +16,7 @@ from vllm.logger import init_logger
from
vllm.lora.request
import
LoRARequest
from
vllm.outputs
import
RequestOutput
from
vllm.sampling_params
import
SamplingParams
from
vllm.sequence
import
MultiModalData
from
vllm.sequence
import
MultiModalData
,
SamplerOutput
from
vllm.usage.usage_lib
import
UsageContext
logger
=
init_logger
(
__name__
)
...
...
@@ -224,8 +225,7 @@ class _AsyncLLMEngine(LLMEngine):
scheduler_outputs
.
ignored_seq_groups
,
seq_group_metadata_list
)
# Log stats.
if
self
.
log_stats
:
self
.
stat_logger
.
log
(
self
.
_get_stats
(
scheduler_outputs
))
self
.
do_log_stats
(
scheduler_outputs
,
output
)
return
request_outputs
...
...
@@ -707,9 +707,13 @@ class AsyncLLMEngine:
else
:
return
self
.
engine
.
get_decoding_config
()
async
def
do_log_stats
(
self
)
->
None
:
async
def
do_log_stats
(
self
,
scheduler_outputs
:
Optional
[
SchedulerOutputs
]
=
None
,
model_output
:
Optional
[
List
[
SamplerOutput
]]
=
None
)
->
None
:
if
self
.
engine_use_ray
:
await
self
.
engine
.
do_log_stats
.
remote
()
# type: ignore
await
self
.
engine
.
do_log_stats
.
remote
(
# type: ignore
scheduler_outputs
,
model_output
)
else
:
self
.
engine
.
do_log_stats
()
...
...
vllm/engine/llm_engine.py
View file @
3a922c1e
...
...
@@ -597,16 +597,18 @@ class LLMEngine:
scheduler_outputs
.
ignored_seq_groups
,
seq_group_metadata_list
)
# Log stats.
if
self
.
log_stats
:
self
.
stat_logger
.
log
(
self
.
_get_stats
(
scheduler_outputs
,
model_output
=
output
))
self
.
do_log_stats
(
scheduler_outputs
,
output
)
return
request_outputs
def
do_log_stats
(
self
)
->
None
:
def
do_log_stats
(
self
,
scheduler_outputs
:
Optional
[
SchedulerOutputs
]
=
None
,
model_output
:
Optional
[
List
[
SamplerOutput
]]
=
None
)
->
None
:
"""Forced log when no requests active."""
if
self
.
log_stats
:
self
.
stat_logger
.
log
(
self
.
_get_stats
(
scheduler_outputs
=
None
))
self
.
stat_logger
.
log
(
self
.
_get_stats
(
scheduler_outputs
,
model_output
))
def
_get_stats
(
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