File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ steps:
264264 - pytest -v -s v1/structured_output
265265 - pytest -v -s v1/spec_decode
266266 - pytest -v -s v1/kv_connector/unit
267+ - pytest -v -s v1/metrics
267268 - pytest -v -s v1/test_serial_utils.py
268269 - pytest -v -s v1/test_utils.py
269270 - pytest -v -s v1/test_oracle.py
Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3+ import os
4+
35import pytest
46import ray
57
8+ from vllm .config import ModelDType
69from vllm .sampling_params import SamplingParams
710from vllm .v1 .engine .async_llm import AsyncEngineArgs , AsyncLLM
811from vllm .v1 .metrics .ray_wrappers import RayPrometheusStatLogger
@@ -27,7 +30,7 @@ def use_v1_only(monkeypatch):
2730def test_engine_log_metrics_ray (
2831 example_prompts ,
2932 model : str ,
30- dtype : str ,
33+ dtype : ModelDType ,
3134 max_tokens : int ,
3235) -> None :
3336 """ Simple smoke test, verifying this can be used without exceptions.
@@ -37,11 +40,14 @@ def test_engine_log_metrics_ray(
3740 class EngineTestActor :
3841
3942 async def run (self ):
40- engine_args = AsyncEngineArgs (
41- model = model ,
42- dtype = dtype ,
43- disable_log_stats = False ,
44- )
43+ # Set environment variable inside the Ray actor since environment
44+ # variables from pytest fixtures don't propagate to Ray actors
45+ os .environ ['VLLM_USE_V1' ] = '1'
46+
47+ engine_args = AsyncEngineArgs (model = model ,
48+ dtype = dtype ,
49+ disable_log_stats = False ,
50+ enforce_eager = True )
4551
4652 engine = AsyncLLM .from_engine_args (
4753 engine_args , stat_loggers = [RayPrometheusStatLogger ])
Original file line number Diff line number Diff line change @@ -51,7 +51,13 @@ class RayGaugeWrapper(RayPrometheusMetric):
5151 def __init__ (self ,
5252 name : str ,
5353 documentation : Optional [str ] = "" ,
54- labelnames : Optional [list [str ]] = None ):
54+ labelnames : Optional [list [str ]] = None ,
55+ multiprocess_mode : Optional [str ] = "" ):
56+
57+ # All Ray metrics are keyed by WorkerId, so multiprocess modes like
58+ # "mostrecent", "all", "sum" do not apply. This logic can be manually
59+ # implemented at the observability layer (Prometheus/Grafana).
60+ del multiprocess_mode
5561 labelnames_tuple = tuple (labelnames ) if labelnames else None
5662 self .metric = ray_metrics .Gauge (name = name ,
5763 description = documentation ,
You can’t perform that action at this time.
0 commit comments