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
272e31c0
Unverified
Commit
272e31c0
authored
Nov 18, 2024
by
Travis Johnson
Committed by
GitHub
Nov 19, 2024
Browse files
[Bugfix] Guard for negative counter metrics to prevent crash (#10430)
Signed-off-by:
Travis Johnson
<
tsjohnso@us.ibm.com
>
parent
74f8c2cf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+1
-1
vllm/engine/metrics.py
vllm/engine/metrics.py
+5
-0
No files found.
vllm/engine/llm_engine.py
View file @
272e31c0
...
@@ -1716,7 +1716,7 @@ class LLMEngine:
...
@@ -1716,7 +1716,7 @@ class LLMEngine:
# not counted (to avoid double counting)
# not counted (to avoid double counting)
actual_num_batched_tokens
=
scheduler_outputs
.
num_batched_tokens
# type: ignore
actual_num_batched_tokens
=
scheduler_outputs
.
num_batched_tokens
# type: ignore
num_generation_tokens_from_prefill_groups
=
0
.
num_generation_tokens_from_prefill_groups
=
0
# NOTE: if scheduler_outputs.num_prefill_groups > 0 and
# NOTE: if scheduler_outputs.num_prefill_groups > 0 and
# the len of scheduler_outputs.scheduled_seq_groups is !=
# the len of scheduler_outputs.scheduled_seq_groups is !=
# scheduler_outputs.num_prefill_groups, this means that
# scheduler_outputs.num_prefill_groups, this means that
...
...
vllm/engine/metrics.py
View file @
272e31c0
...
@@ -512,6 +512,11 @@ class PrometheusStatLogger(StatLoggerBase):
...
@@ -512,6 +512,11 @@ class PrometheusStatLogger(StatLoggerBase):
def
_log_counter
(
self
,
counter
,
data
:
Union
[
int
,
float
])
->
None
:
def
_log_counter
(
self
,
counter
,
data
:
Union
[
int
,
float
])
->
None
:
# Convenience function for logging to counter.
# Convenience function for logging to counter.
# Prevent ValueError from negative increment
if
data
<
0
:
logger
.
warning
(
"Skipping negative increment of %g to %s"
,
data
,
counter
)
return
counter
.
labels
(
**
self
.
labels
).
inc
(
data
)
counter
.
labels
(
**
self
.
labels
).
inc
(
data
)
def
_log_counter_labels
(
self
,
counter
,
data
:
CollectionsCounter
,
def
_log_counter_labels
(
self
,
counter
,
data
:
CollectionsCounter
,
...
...
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