[CI] Reducing mithril-h100-pool in ready&merge CI, optimize ready CI duration (#4354)
Signed-off-by: [Your Name] <your.email@example.com> Signed-off-by: wangyu <410167048@qq.com> Signed-off-by: wangyu <53896905+yenuo26@users.noreply.github.com> Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com> Signed-off-by: [Your Name] <[Your Email]> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
e4026a50ad
commit
7619ed6b82
84 files changed
+1718
-2428
No files matched your search
@@ -45,7 +45,6 @@ from tests.helpers.assertions import (
|
||||
from tests.helpers.env import run_post_test_cleanup, run_pre_test_cleanup
|
||||
from tests.helpers.media import (
|
||||
_merge_base64_audio_to_segment,
|
||||
convert_audio_bytes_to_text,
|
||||
decode_b64_image,
|
||||
)
|
||||
from vllm_omni.config.stage_config import resolve_deploy_yaml
|
||||
@@ -898,16 +897,13 @@ class OpenAIClientHandler:
|
||||
if details := getattr(chunk.usage, "prompt_tokens_details", None):
|
||||
result.cached_tokens = details.cached_tokens
|
||||
|
||||
audio_content = None
|
||||
if audio_data:
|
||||
merged_seg = _merge_base64_audio_to_segment(audio_data)
|
||||
wav_buf = BytesIO()
|
||||
merged_seg.export(wav_buf, format="wav")
|
||||
result.audio_bytes = wav_buf.getvalue()
|
||||
audio_content = convert_audio_bytes_to_text(result.audio_bytes)
|
||||
result.text_content = text_content
|
||||
result.audio_data = audio_data
|
||||
result.audio_content = audio_content
|
||||
result.e2e_latency = time.perf_counter() - wall_start
|
||||
result.success = True
|
||||
except Exception as e:
|
||||
@@ -932,12 +928,9 @@ class OpenAIClientHandler:
|
||||
result.prompt_tokens = usage.prompt_tokens
|
||||
if details := getattr(usage, "prompt_tokens_details", None):
|
||||
result.cached_tokens = details.cached_tokens
|
||||
audio_content = None
|
||||
if audio_data:
|
||||
result.audio_bytes = base64.b64decode(audio_data)
|
||||
audio_content = convert_audio_bytes_to_text(result.audio_bytes)
|
||||
result.text_content = text_content
|
||||
result.audio_content = audio_content
|
||||
result.e2e_latency = time.perf_counter() - wall_start
|
||||
if chat_completion.choices and chat_completion.choices[0].logprobs is not None:
|
||||
result.logprobs = chat_completion.choices[0].logprobs.content
|
||||
@@ -1587,6 +1580,8 @@ class OpenAIClientHandler:
|
||||
extra_body["mm_processor_kwargs"] = mm
|
||||
if "sampling_params_list" in request_config:
|
||||
extra_body["sampling_params_list"] = request_config["sampling_params_list"]
|
||||
if request_config.get("extra_body"):
|
||||
extra_body.update(request_config["extra_body"])
|
||||
|
||||
create_kwargs: dict[str, Any] = {
|
||||
"model": request_config.get("model"),
|
||||
@@ -1648,8 +1643,8 @@ class OpenAIClientHandler:
|
||||
Process streaming /v1/audio/speech responses into an OmniResponse.
|
||||
|
||||
This mirrors _process_stream_omni_response but operates on low-level
|
||||
audio bytes and produces an OmniResponse with audio_content filled
|
||||
from Whisper transcription.
|
||||
audio bytes. Whisper transcription runs in assert_audio_speech_response
|
||||
when the run_level requires it.
|
||||
"""
|
||||
result = OmniResponse()
|
||||
|
||||
@@ -1685,14 +1680,9 @@ class OpenAIClientHandler:
|
||||
raise TypeError(f"Unsupported audio speech streaming response type: {type(response)}")
|
||||
|
||||
raw_bytes = bytes(data)
|
||||
if response_format == "pcm":
|
||||
transcript = None
|
||||
else:
|
||||
transcript = convert_audio_bytes_to_text(raw_bytes)
|
||||
|
||||
# Populate OmniResponse.
|
||||
result.audio_bytes = raw_bytes
|
||||
result.audio_content = transcript
|
||||
result.e2e_latency = time.perf_counter() - wall_start
|
||||
result.success = True
|
||||
result.audio_format = getattr(response, "response", None)
|
||||
@@ -1725,13 +1715,7 @@ class OpenAIClientHandler:
|
||||
else:
|
||||
raise TypeError(f"Unsupported audio speech response type: {type(response)}")
|
||||
|
||||
if response_format == "pcm":
|
||||
transcript = None
|
||||
else:
|
||||
transcript = convert_audio_bytes_to_text(raw_bytes)
|
||||
|
||||
result.audio_bytes = raw_bytes
|
||||
result.audio_content = transcript
|
||||
result.e2e_latency = time.perf_counter() - wall_start
|
||||
result.success = True
|
||||
result.audio_format = getattr(response, "response", None)
|
||||
@@ -2796,25 +2780,6 @@ class OmniRunnerHandler:
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def _core_model_stage_config_path_with_dummy_load_format(stage_config_path: str | None, run_level: str) -> str | None:
|
||||
"""For ``core_model`` runs, patch every stage in the deploy YAML to ``load_format: dummy``."""
|
||||
if run_level != "core_model" or stage_config_path is None:
|
||||
return stage_config_path
|
||||
from tests.helpers.stage_config import modify_stage_config
|
||||
|
||||
with open(stage_config_path, encoding="utf-8") as f:
|
||||
cfg = yaml.safe_load(f) or {}
|
||||
new_schema_stages = cfg.get("stages")
|
||||
stage_key = "stages" if new_schema_stages is not None else "stage_args"
|
||||
update_path = "load_format" if new_schema_stages is not None else "engine_args.load_format"
|
||||
stage_entries = cfg.get(stage_key, [])
|
||||
stage_ids = [stage["stage_id"] for stage in stage_entries if "stage_id" in stage]
|
||||
return modify_stage_config(
|
||||
stage_config_path,
|
||||
updates={stage_key: {stage_id: {update_path: "dummy"} for stage_id in stage_ids}},
|
||||
)
|
||||
|
||||
|
||||
def iter_omni_server(
|
||||
request: Any,
|
||||
run_level: str,
|
||||
@@ -2822,25 +2787,13 @@ def iter_omni_server(
|
||||
omni_fixture_lock: threading.Lock,
|
||||
) -> Generator[Any, Any, None]:
|
||||
"""Start/stop an Omni HTTP server; used by ``omni_server`` / ``omni_server_function`` fixtures."""
|
||||
from tests.helpers.stage_config import modify_stage_config
|
||||
from tests.helpers.stage_config import stage_config_path_for_run_level
|
||||
|
||||
with omni_fixture_lock:
|
||||
params: OmniServerParams = request.param
|
||||
model = model_prefix + params.model
|
||||
port = params.port
|
||||
stage_config_path = params.stage_config_path
|
||||
if run_level in {"advanced_model", "full_model"} and stage_config_path is not None:
|
||||
with open(stage_config_path, encoding="utf-8") as f:
|
||||
cfg = yaml.safe_load(f) or {}
|
||||
new_schema_stages = cfg.get("stages")
|
||||
stage_key = "stages" if new_schema_stages is not None else "stage_args"
|
||||
delete_path = "load_format" if new_schema_stages is not None else "engine_args.load_format"
|
||||
stage_entries = cfg.get(stage_key, [])
|
||||
stage_ids = [stage["stage_id"] for stage in stage_entries if "stage_id" in stage]
|
||||
stage_config_path = modify_stage_config(
|
||||
stage_config_path,
|
||||
deletes={stage_key: {stage_id: [delete_path] for stage_id in stage_ids}},
|
||||
)
|
||||
stage_config_path = stage_config_path_for_run_level(params.stage_config_path, run_level)
|
||||
|
||||
server_args = params.server_args or []
|
||||
if params.use_omni and params.stage_init_timeout is not None:
|
||||
@@ -2905,6 +2858,8 @@ def iter_omni_runner(
|
||||
omni_fixture_lock: threading.Lock,
|
||||
) -> Generator[Any, None, None]:
|
||||
"""Yield an :class:`OmniRunner`; used by ``omni_runner`` / ``omni_runner_function`` fixtures."""
|
||||
from tests.helpers.stage_config import stage_config_path_for_run_level
|
||||
|
||||
with omni_fixture_lock:
|
||||
param = request.param
|
||||
if not isinstance(param, (tuple, list)) or len(param) not in (2, 3):
|
||||
@@ -2918,7 +2873,7 @@ def iter_omni_runner(
|
||||
else:
|
||||
model, stage_config_path, extra = param[0], param[1], param[2]
|
||||
extra_omni_kwargs = dict(extra) if extra is not None else {}
|
||||
stage_config_path = _core_model_stage_config_path_with_dummy_load_format(stage_config_path, run_level)
|
||||
stage_config_path = stage_config_path_for_run_level(stage_config_path, run_level)
|
||||
model = model_prefix + model
|
||||
with OmniRunner(model, seed=42, stage_configs_path=stage_config_path, **extra_omni_kwargs) as runner:
|
||||
print("OmniRunner started successfully")
|
||||
|
||||
Reference in new issue
Block a user