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
d1fb65bd
Unverified
Commit
d1fb65bd
authored
Jul 19, 2025
by
Seiji Eicher
Committed by
GitHub
Jul 20, 2025
Browse files
Enable v1 metrics tests (#20953)
Signed-off-by:
Seiji Eicher
<
seiji@anyscale.com
>
parent
3a1d8940
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
.buildkite/test-pipeline.yaml
.buildkite/test-pipeline.yaml
+1
-0
tests/v1/metrics/test_ray_metrics.py
tests/v1/metrics/test_ray_metrics.py
+12
-6
vllm/v1/metrics/ray_wrappers.py
vllm/v1/metrics/ray_wrappers.py
+7
-1
No files found.
.buildkite/test-pipeline.yaml
View file @
d1fb65bd
...
@@ -264,6 +264,7 @@ steps:
...
@@ -264,6 +264,7 @@ steps:
-
pytest -v -s v1/structured_output
-
pytest -v -s v1/structured_output
-
pytest -v -s v1/spec_decode
-
pytest -v -s v1/spec_decode
-
pytest -v -s v1/kv_connector/unit
-
pytest -v -s v1/kv_connector/unit
-
pytest -v -s v1/metrics
-
pytest -v -s v1/test_serial_utils.py
-
pytest -v -s v1/test_serial_utils.py
-
pytest -v -s v1/test_utils.py
-
pytest -v -s v1/test_utils.py
-
pytest -v -s v1/test_oracle.py
-
pytest -v -s v1/test_oracle.py
...
...
tests/v1/metrics/test_ray_metrics.py
View file @
d1fb65bd
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import
os
import
pytest
import
pytest
import
ray
import
ray
from
vllm.config
import
ModelDType
from
vllm.sampling_params
import
SamplingParams
from
vllm.sampling_params
import
SamplingParams
from
vllm.v1.engine.async_llm
import
AsyncEngineArgs
,
AsyncLLM
from
vllm.v1.engine.async_llm
import
AsyncEngineArgs
,
AsyncLLM
from
vllm.v1.metrics.ray_wrappers
import
RayPrometheusStatLogger
from
vllm.v1.metrics.ray_wrappers
import
RayPrometheusStatLogger
...
@@ -27,7 +30,7 @@ MODELS = [
...
@@ -27,7 +30,7 @@ MODELS = [
def
test_engine_log_metrics_ray
(
def
test_engine_log_metrics_ray
(
example_prompts
,
example_prompts
,
model
:
str
,
model
:
str
,
dtype
:
str
,
dtype
:
ModelDType
,
max_tokens
:
int
,
max_tokens
:
int
,
)
->
None
:
)
->
None
:
""" Simple smoke test, verifying this can be used without exceptions.
""" Simple smoke test, verifying this can be used without exceptions.
...
@@ -37,11 +40,14 @@ def test_engine_log_metrics_ray(
...
@@ -37,11 +40,14 @@ def test_engine_log_metrics_ray(
class
EngineTestActor
:
class
EngineTestActor
:
async
def
run
(
self
):
async
def
run
(
self
):
engine_args
=
AsyncEngineArgs
(
# Set environment variable inside the Ray actor since environment
model
=
model
,
# variables from pytest fixtures don't propagate to Ray actors
os
.
environ
[
'VLLM_USE_V1'
]
=
'1'
engine_args
=
AsyncEngineArgs
(
model
=
model
,
dtype
=
dtype
,
dtype
=
dtype
,
disable_log_stats
=
False
,
disable_log_stats
=
False
,
)
enforce_eager
=
True
)
engine
=
AsyncLLM
.
from_engine_args
(
engine
=
AsyncLLM
.
from_engine_args
(
engine_args
,
stat_loggers
=
[
RayPrometheusStatLogger
])
engine_args
,
stat_loggers
=
[
RayPrometheusStatLogger
])
...
...
vllm/v1/metrics/ray_wrappers.py
View file @
d1fb65bd
...
@@ -51,7 +51,13 @@ class RayGaugeWrapper(RayPrometheusMetric):
...
@@ -51,7 +51,13 @@ class RayGaugeWrapper(RayPrometheusMetric):
def
__init__
(
self
,
def
__init__
(
self
,
name
:
str
,
name
:
str
,
documentation
:
Optional
[
str
]
=
""
,
documentation
:
Optional
[
str
]
=
""
,
labelnames
:
Optional
[
list
[
str
]]
=
None
):
labelnames
:
Optional
[
list
[
str
]]
=
None
,
multiprocess_mode
:
Optional
[
str
]
=
""
):
# All Ray metrics are keyed by WorkerId, so multiprocess modes like
# "mostrecent", "all", "sum" do not apply. This logic can be manually
# implemented at the observability layer (Prometheus/Grafana).
del
multiprocess_mode
labelnames_tuple
=
tuple
(
labelnames
)
if
labelnames
else
None
labelnames_tuple
=
tuple
(
labelnames
)
if
labelnames
else
None
self
.
metric
=
ray_metrics
.
Gauge
(
name
=
name
,
self
.
metric
=
ray_metrics
.
Gauge
(
name
=
name
,
description
=
documentation
,
description
=
documentation
,
...
...
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