[CI][Perf] migrate diffusion DFX benches to vllm bench serve --omni (#7737)
Signed-off-by: wangyu <410167048@qq.com>
This commit is contained in:
1 parent
a4ad73e08b
commit
0570b0da7e
30 files changed
+2040
-729
No files matched your search
+43
-13
@@ -1,3 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
@@ -84,17 +87,20 @@ def resolve_pytest_marks(mark_field: Any) -> list[pytest.MarkDecorator]:
|
||||
raise ValueError(f"mark must be a list; got {type(mark_field).__name__}")
|
||||
|
||||
|
||||
def _mark_names(mark_field: Any) -> set[str]:
|
||||
if isinstance(mark_field, list):
|
||||
return {str(item) for item in mark_field if isinstance(item, str)}
|
||||
return set()
|
||||
|
||||
|
||||
def is_diffusion_perf_config(cfg: dict[str, Any]) -> bool:
|
||||
"""True for perf JSON cases intended for ``run_diffusion_benchmark.py``."""
|
||||
if cfg.get("server_type") is not None:
|
||||
return True
|
||||
return "diffusion" in _mark_names(cfg.get("mark"))
|
||||
"""True for perf JSON cases intended for ``run_diffusion_benchmark.py``.
|
||||
|
||||
Schema split (not marks / endpoints):
|
||||
|
||||
- ``benchmark_params[].dataset`` → diffusion client (``run_diffusion_benchmark.py``)
|
||||
- ``benchmark_params[].dataset_name`` → ``vllm bench serve --omni`` (``run_benchmark.py``)
|
||||
"""
|
||||
for params in cfg.get("benchmark_params") or []:
|
||||
if not isinstance(params, dict):
|
||||
continue
|
||||
if "dataset" in params and "dataset_name" not in params:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _marks_by_test_name(configs: list[dict[str, Any]]) -> dict[str, list[pytest.MarkDecorator]]:
|
||||
@@ -654,6 +660,7 @@ def run_benchmark(
|
||||
random_output_len: Any | None = None,
|
||||
resource_label: str | None = None,
|
||||
num_warmups: int = 2,
|
||||
benchmark_params_name: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Run one ``vllm bench serve --omni`` iteration and return parsed metrics.
|
||||
|
||||
@@ -662,15 +669,35 @@ def run_benchmark(
|
||||
maps keep every hardware bucket, but each metric is reduced to the value for
|
||||
this concurrency / request-rate step. If the benchmark exits without writing a
|
||||
result file, ``result_omni_template.json`` is used as a fallback.
|
||||
|
||||
``benchmark_params_name`` (the ``name`` field from ``benchmark_params``) is
|
||||
persisted in the result JSON and filename so multiple generation configs
|
||||
under one ``test_name`` stay distinguishable (e.g. Wan USP2 832x480 vs
|
||||
1280x720).
|
||||
"""
|
||||
current_dt = datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||
ri = _safe_filename_token(random_input_len)
|
||||
ro = _safe_filename_token(random_output_len)
|
||||
hw = resource_label_for_filename(resource_label)
|
||||
name_token = _safe_filename_token(benchmark_params_name) if benchmark_params_name else ""
|
||||
if name_token == "na":
|
||||
name_token = ""
|
||||
name_parts = [f"result_{test_name}"]
|
||||
if hw:
|
||||
result_filename = f"result_{test_name}_{hw}_{dataset_name}_{flow}_{num_prompt}_in{ri}_out{ro}_{current_dt}.json"
|
||||
else:
|
||||
result_filename = f"result_{test_name}_{dataset_name}_{flow}_{num_prompt}_in{ri}_out{ro}_{current_dt}.json"
|
||||
name_parts.append(hw)
|
||||
if name_token:
|
||||
name_parts.append(name_token)
|
||||
name_parts.extend(
|
||||
[
|
||||
str(dataset_name),
|
||||
str(flow),
|
||||
str(num_prompt),
|
||||
f"in{ri}",
|
||||
f"out{ro}",
|
||||
current_dt,
|
||||
]
|
||||
)
|
||||
result_filename = "_".join(name_parts) + ".json"
|
||||
if "--result-filename" in args:
|
||||
print(f"The result file will be overwritten by {result_filename}")
|
||||
command = (
|
||||
@@ -740,6 +767,9 @@ def run_benchmark(
|
||||
if random_output_len is not None:
|
||||
result["random_output_len"] = random_output_len
|
||||
result["Hardware"] = hardware_json_value(resource_label)
|
||||
result["test_name"] = test_name
|
||||
if benchmark_params_name:
|
||||
result["name"] = benchmark_params_name
|
||||
with open(result_path, "w", encoding="utf-8") as f:
|
||||
json.dump(result, f, ensure_ascii=False, indent=2)
|
||||
return result
|
||||
|
||||
Reference in new issue
Block a user