[ci] Add logic to change model to S3 path only when S3 CI env var is on (#13727)

Signed-off-by: <>
Co-authored-by: EC2 Default User <ec2-user@ip-172-31-63-253.us-west-2.compute.internal>
This commit is contained in:
Kevin H. Luu 2025-02-23 22:32:11 -08:00 committed by GitHub
parent e7ef74e26e
commit f90a375593
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import pytest
import ray import ray
from prometheus_client import REGISTRY from prometheus_client import REGISTRY
import vllm.envs as envs
from vllm import EngineArgs, LLMEngine from vllm import EngineArgs, LLMEngine
from vllm.distributed import cleanup_dist_env_and_memory from vllm.distributed import cleanup_dist_env_and_memory
from vllm.engine.arg_utils import AsyncEngineArgs from vllm.engine.arg_utils import AsyncEngineArgs
@ -141,8 +142,10 @@ def test_metric_set_tag_model_name(vllm_runner, model: str, dtype: str,
stat_logger = vllm_model.model.llm_engine.stat_loggers['prometheus'] stat_logger = vllm_model.model.llm_engine.stat_loggers['prometheus']
metrics_tag_content = stat_logger.labels["model_name"] metrics_tag_content = stat_logger.labels["model_name"]
if envs.VLLM_CI_USE_S3:
model = f"{MODEL_WEIGHTS_S3_BUCKET}/{model}"
if served_model_name is None or served_model_name == []: if served_model_name is None or served_model_name == []:
assert metrics_tag_content == f"{MODEL_WEIGHTS_S3_BUCKET}/{model}", ( assert metrics_tag_content == model, (
f"Metrics tag model_name is wrong! expect: {model!r}\n" f"Metrics tag model_name is wrong! expect: {model!r}\n"
f"actual: {metrics_tag_content!r}") f"actual: {metrics_tag_content!r}")
else: else:
@ -215,8 +218,9 @@ def test_engine_log_metrics_regression(
while engine.has_unfinished_requests(): while engine.has_unfinished_requests():
engine.step() engine.step()
assert_metrics(f"{MODEL_WEIGHTS_S3_BUCKET}/{model}", engine, if envs.VLLM_CI_USE_S3:
disable_log_stats, len(example_prompts)) model = f"{MODEL_WEIGHTS_S3_BUCKET}/{model}"
assert_metrics(model, engine, disable_log_stats, len(example_prompts))
@pytest.mark.parametrize("model", MODELS) @pytest.mark.parametrize("model", MODELS)