Merge remote-tracking branch 'origin/main' into dev/rebase-v0.16.0
This commit is contained in:
commit
93eeb1a4c8
8 files changed
+432
-376
No files matched your search
+105
-105
@@ -139,41 +139,41 @@ steps:
|
|||||||
- "/fsx/hf_cache:/fsx/hf_cache"
|
- "/fsx/hf_cache:/fsx/hf_cache"
|
||||||
|
|
||||||
|
|
||||||
- label: "Benchmark&Engine Test"
|
# - label: "Benchmark&Engine Test"
|
||||||
timeout_in_minutes: 15
|
# timeout_in_minutes: 15
|
||||||
depends_on: image-build
|
# depends_on: image-build
|
||||||
commands:
|
# commands:
|
||||||
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
# - export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
||||||
- pytest -s -v tests/benchmarks/test_serve_cli.py
|
# - pytest -s -v tests/benchmarks/test_serve_cli.py
|
||||||
- pytest -s -v tests/engine/test_async_omni_engine_abort.py
|
# - pytest -s -v tests/engine/test_async_omni_engine_abort.py
|
||||||
agents:
|
# agents:
|
||||||
queue: "mithril-h100-pool"
|
# queue: "mithril-h100-pool"
|
||||||
plugins:
|
# plugins:
|
||||||
- kubernetes:
|
# - kubernetes:
|
||||||
podSpec:
|
# podSpec:
|
||||||
containers:
|
# containers:
|
||||||
- image: public.ecr.aws/q9t5s3a7/vllm-ci-test-repo:$BUILDKITE_COMMIT
|
# - image: public.ecr.aws/q9t5s3a7/vllm-ci-test-repo:$BUILDKITE_COMMIT
|
||||||
resources:
|
# resources:
|
||||||
limits:
|
# limits:
|
||||||
nvidia.com/gpu: 2
|
# nvidia.com/gpu: 2
|
||||||
volumeMounts:
|
# volumeMounts:
|
||||||
- name: devshm
|
# - name: devshm
|
||||||
mountPath: /dev/shm
|
# mountPath: /dev/shm
|
||||||
- name: hf-cache
|
# - name: hf-cache
|
||||||
mountPath: /root/.cache/huggingface
|
# mountPath: /root/.cache/huggingface
|
||||||
env:
|
# env:
|
||||||
- name: HF_HOME
|
# - name: HF_HOME
|
||||||
value: /root/.cache/huggingface
|
# value: /root/.cache/huggingface
|
||||||
nodeSelector:
|
# nodeSelector:
|
||||||
node.kubernetes.io/instance-type: gpu-h100-sxm
|
# node.kubernetes.io/instance-type: gpu-h100-sxm
|
||||||
volumes:
|
# volumes:
|
||||||
- name: devshm
|
# - name: devshm
|
||||||
emptyDir:
|
# emptyDir:
|
||||||
medium: Memory
|
# medium: Memory
|
||||||
- name: hf-cache
|
# - name: hf-cache
|
||||||
hostPath:
|
# hostPath:
|
||||||
path: /mnt/hf-cache
|
# path: /mnt/hf-cache
|
||||||
type: DirectoryOrCreate
|
# type: DirectoryOrCreate
|
||||||
|
|
||||||
- label: "Omni Model Test"
|
- label: "Omni Model Test"
|
||||||
timeout_in_minutes: 15
|
timeout_in_minutes: 15
|
||||||
@@ -194,42 +194,42 @@ steps:
|
|||||||
volumes:
|
volumes:
|
||||||
- "/fsx/hf_cache:/fsx/hf_cache"
|
- "/fsx/hf_cache:/fsx/hf_cache"
|
||||||
|
|
||||||
- label: "Omni Model Test with H100"
|
# - label: "Omni Model Test with H100"
|
||||||
timeout_in_minutes: 20
|
# timeout_in_minutes: 20
|
||||||
depends_on: image-build
|
# depends_on: image-build
|
||||||
commands:
|
# commands:
|
||||||
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
# - export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
||||||
- export VLLM_TEST_CLEAN_GPU_MEMORY="1"
|
# - export VLLM_TEST_CLEAN_GPU_MEMORY="1"
|
||||||
- pytest -s -v tests/e2e/offline_inference/test_qwen3_omni.py
|
# - pytest -s -v tests/e2e/offline_inference/test_qwen3_omni.py
|
||||||
- pytest -s -v tests/e2e/online_serving/test_qwen3_omni.py -m "core_model" --run-level "core_model"
|
# - pytest -s -v tests/e2e/online_serving/test_qwen3_omni.py -m "core_model" --run-level "core_model"
|
||||||
agents:
|
# agents:
|
||||||
queue: "mithril-h100-pool"
|
# queue: "mithril-h100-pool"
|
||||||
plugins:
|
# plugins:
|
||||||
- kubernetes:
|
# - kubernetes:
|
||||||
podSpec:
|
# podSpec:
|
||||||
containers:
|
# containers:
|
||||||
- image: public.ecr.aws/q9t5s3a7/vllm-ci-test-repo:$BUILDKITE_COMMIT
|
# - image: public.ecr.aws/q9t5s3a7/vllm-ci-test-repo:$BUILDKITE_COMMIT
|
||||||
resources:
|
# resources:
|
||||||
limits:
|
# limits:
|
||||||
nvidia.com/gpu: 2
|
# nvidia.com/gpu: 2
|
||||||
volumeMounts:
|
# volumeMounts:
|
||||||
- name: devshm
|
# - name: devshm
|
||||||
mountPath: /dev/shm
|
# mountPath: /dev/shm
|
||||||
- name: hf-cache
|
# - name: hf-cache
|
||||||
mountPath: /root/.cache/huggingface
|
# mountPath: /root/.cache/huggingface
|
||||||
env:
|
# env:
|
||||||
- name: HF_HOME
|
# - name: HF_HOME
|
||||||
value: /root/.cache/huggingface
|
# value: /root/.cache/huggingface
|
||||||
nodeSelector:
|
# nodeSelector:
|
||||||
node.kubernetes.io/instance-type: gpu-h100-sxm
|
# node.kubernetes.io/instance-type: gpu-h100-sxm
|
||||||
volumes:
|
# volumes:
|
||||||
- name: devshm
|
# - name: devshm
|
||||||
emptyDir:
|
# emptyDir:
|
||||||
medium: Memory
|
# medium: Memory
|
||||||
- name: hf-cache
|
# - name: hf-cache
|
||||||
hostPath:
|
# hostPath:
|
||||||
path: /mnt/hf-cache
|
# path: /mnt/hf-cache
|
||||||
type: DirectoryOrCreate
|
# type: DirectoryOrCreate
|
||||||
|
|
||||||
- label: "Qwen3-TTS E2E Test"
|
- label: "Qwen3-TTS E2E Test"
|
||||||
timeout_in_minutes: 20
|
timeout_in_minutes: 20
|
||||||
@@ -251,40 +251,40 @@ steps:
|
|||||||
volumes:
|
volumes:
|
||||||
- "/fsx/hf_cache:/fsx/hf_cache"
|
- "/fsx/hf_cache:/fsx/hf_cache"
|
||||||
|
|
||||||
- label: "Diffusion Image Edit Test with H100 (1 GPU)"
|
# - label: "Diffusion Image Edit Test with H100 (1 GPU)"
|
||||||
timeout_in_minutes: 20
|
# timeout_in_minutes: 20
|
||||||
depends_on: image-build
|
# depends_on: image-build
|
||||||
commands:
|
# commands:
|
||||||
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
# - export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
||||||
- pytest -s -v tests/e2e/online_serving/test_image_gen_edit.py
|
# - pytest -s -v tests/e2e/online_serving/test_image_gen_edit.py
|
||||||
agents:
|
# agents:
|
||||||
queue: "mithril-h100-pool"
|
# queue: "mithril-h100-pool"
|
||||||
plugins:
|
# plugins:
|
||||||
- kubernetes:
|
# - kubernetes:
|
||||||
podSpec:
|
# podSpec:
|
||||||
containers:
|
# containers:
|
||||||
- image: public.ecr.aws/q9t5s3a7/vllm-ci-test-repo:$BUILDKITE_COMMIT
|
# - image: public.ecr.aws/q9t5s3a7/vllm-ci-test-repo:$BUILDKITE_COMMIT
|
||||||
resources:
|
# resources:
|
||||||
limits:
|
# limits:
|
||||||
nvidia.com/gpu: 1
|
# nvidia.com/gpu: 1
|
||||||
volumeMounts:
|
# volumeMounts:
|
||||||
- name: devshm
|
# - name: devshm
|
||||||
mountPath: /dev/shm
|
# mountPath: /dev/shm
|
||||||
- name: hf-cache
|
# - name: hf-cache
|
||||||
mountPath: /root/.cache/huggingface
|
# mountPath: /root/.cache/huggingface
|
||||||
env:
|
# env:
|
||||||
- name: HF_HOME
|
# - name: HF_HOME
|
||||||
value: /root/.cache/huggingface
|
# value: /root/.cache/huggingface
|
||||||
nodeSelector:
|
# nodeSelector:
|
||||||
node.kubernetes.io/instance-type: gpu-h100-sxm
|
# node.kubernetes.io/instance-type: gpu-h100-sxm
|
||||||
volumes:
|
# volumes:
|
||||||
- name: devshm
|
# - name: devshm
|
||||||
emptyDir:
|
# emptyDir:
|
||||||
medium: Memory
|
# medium: Memory
|
||||||
- name: hf-cache
|
# - name: hf-cache
|
||||||
hostPath:
|
# hostPath:
|
||||||
path: /mnt/hf-cache
|
# path: /mnt/hf-cache
|
||||||
type: DirectoryOrCreate
|
# type: DirectoryOrCreate
|
||||||
|
|
||||||
# - label: "Bagel Text2Img Model Test with H100"
|
# - label: "Bagel Text2Img Model Test with H100"
|
||||||
# timeout_in_minutes: 30
|
# timeout_in_minutes: 30
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ steps:
|
|||||||
if: build.env("NIGHTLY") == "1"
|
if: build.env("NIGHTLY") == "1"
|
||||||
commands:
|
commands:
|
||||||
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
||||||
- pytest -s -v tests/e2e/online_serving/test_qwen3_omni_expansion.py
|
- pytest -s -v tests/e2e/online_serving/test_qwen3_omni_expansion.py -m "advanced_model" --run-level "advanced_model"
|
||||||
- pytest -s -v tests/examples/online_serving/test_qwen3_omni.py
|
- pytest -s -v tests/examples/online_serving/test_qwen3_omni.py -m "advanced_model" --run-level "advanced_model"
|
||||||
agents:
|
agents:
|
||||||
queue: "mithril-h100-pool"
|
queue: "mithril-h100-pool"
|
||||||
plugins:
|
plugins:
|
||||||
@@ -43,7 +43,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- export VLLM_LOGGING_LEVEL=DEBUG
|
- export VLLM_LOGGING_LEVEL=DEBUG
|
||||||
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
- export VLLM_WORKER_MULTIPROC_METHOD=spawn
|
||||||
- pytest -s -v tests/examples/online_serving/test_qwen2_5_omni.py
|
- pytest -s -v tests/examples/online_serving/test_qwen2_5_omni.py -m "advanced_model" --run-level "advanced_model"
|
||||||
agents:
|
agents:
|
||||||
queue: "gpu_4_queue" # g6.12xlarge instance on AWS, has 4 L4 GPU
|
queue: "gpu_4_queue" # g6.12xlarge instance on AWS, has 4 L4 GPU
|
||||||
plugins:
|
plugins:
|
||||||
|
|||||||
+10
-3
@@ -1057,7 +1057,8 @@ def omni_server(request, run_level):
|
|||||||
Multi-stage initialization can take 10-20+ minutes.
|
Multi-stage initialization can take 10-20+ minutes.
|
||||||
"""
|
"""
|
||||||
with _omni_server_lock:
|
with _omni_server_lock:
|
||||||
model, stage_config_path = request.param
|
*port, model, stage_config_path = request.param
|
||||||
|
port = port[0] if port else None
|
||||||
if run_level == "advanced_model":
|
if run_level == "advanced_model":
|
||||||
stage_config_path = modify_stage_config(
|
stage_config_path = modify_stage_config(
|
||||||
stage_config_path,
|
stage_config_path,
|
||||||
@@ -1070,7 +1071,8 @@ def omni_server(request, run_level):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
with OmniServer(model, ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"]) as server:
|
server_args = ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"]
|
||||||
|
with OmniServer(model, server_args, port=port) if port else OmniServer(model, server_args) as server:
|
||||||
print("OmniServer started successfully")
|
print("OmniServer started successfully")
|
||||||
yield server
|
yield server
|
||||||
print("OmniServer stopping...")
|
print("OmniServer stopping...")
|
||||||
@@ -1288,11 +1290,15 @@ class OpenAIClientHandler:
|
|||||||
|
|
||||||
responses = []
|
responses = []
|
||||||
stream = request_config.get("stream", False)
|
stream = request_config.get("stream", False)
|
||||||
|
modalities = request_config.get("modalities", ["text", "audio"])
|
||||||
|
|
||||||
if request_num == 1:
|
if request_num == 1:
|
||||||
# Send single request
|
# Send single request
|
||||||
chat_completion = self.client.chat.completions.create(
|
chat_completion = self.client.chat.completions.create(
|
||||||
model=request_config.get("model"), messages=request_config.get("messages"), stream=stream
|
model=request_config.get("model"),
|
||||||
|
messages=request_config.get("messages"),
|
||||||
|
stream=stream,
|
||||||
|
modalities=modalities,
|
||||||
)
|
)
|
||||||
|
|
||||||
if stream:
|
if stream:
|
||||||
@@ -1314,6 +1320,7 @@ class OpenAIClientHandler:
|
|||||||
self.client.chat.completions.create,
|
self.client.chat.completions.create,
|
||||||
model=request_config.get("model"),
|
model=request_config.get("model"),
|
||||||
messages=request_config.get("messages"),
|
messages=request_config.get("messages"),
|
||||||
|
modalities=modalities,
|
||||||
stream=stream,
|
stream=stream,
|
||||||
)
|
)
|
||||||
futures.append(future)
|
futures.append(future)
|
||||||
|
|||||||
@@ -4,66 +4,55 @@
|
|||||||
E2E Online tests for Qwen3-Omni model.
|
E2E Online tests for Qwen3-Omni model.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import concurrent.futures
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"
|
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import openai
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tests.conftest import (
|
from tests.conftest import (
|
||||||
OmniServer,
|
|
||||||
convert_audio_to_text,
|
|
||||||
cosine_similarity_text,
|
|
||||||
dummy_messages_from_mix_data,
|
dummy_messages_from_mix_data,
|
||||||
generate_synthetic_audio,
|
generate_synthetic_audio,
|
||||||
generate_synthetic_image,
|
generate_synthetic_image,
|
||||||
|
generate_synthetic_video,
|
||||||
|
modify_stage_config,
|
||||||
)
|
)
|
||||||
|
from tests.utils import hardware_test
|
||||||
|
|
||||||
models = ["Qwen/Qwen3-Omni-30B-A3B-Instruct"]
|
models = ["Qwen/Qwen3-Omni-30B-A3B-Instruct"]
|
||||||
|
|
||||||
# CI stage config for 2*H100-80G GPUs
|
AUDIO_KEY = ["water", "chirping", "crackling"]
|
||||||
stage_configs = [str(Path(__file__).parent.parent / "stage_configs" / "qwen3_omni_ci.yaml")]
|
IMAGE_KEY = ["square", "quadrate"]
|
||||||
|
VIDEO_KEY = ["sphere", "globe", "circle", "round", "ball"]
|
||||||
|
|
||||||
|
|
||||||
|
def get_chunk_config(default_path):
|
||||||
|
path = modify_stage_config(
|
||||||
|
default_path,
|
||||||
|
updates={
|
||||||
|
"async_chunk": True,
|
||||||
|
"stage_args": {
|
||||||
|
0: {
|
||||||
|
"engine_args.custom_process_next_stage_input_func": "vllm_omni.model_executor.stage_input_processors.qwen3_omni.thinker2talker_async_chunk"
|
||||||
|
},
|
||||||
|
1: {
|
||||||
|
"engine_args.custom_process_next_stage_input_func": "vllm_omni.model_executor.stage_input_processors.qwen3_omni.talker2code2wav_async_chunk"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
deletes={"stage_args": {2: ["custom_process_input_func"]}},
|
||||||
|
)
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
# CI stage config for 2*H100-80G GPUs
|
||||||
|
default_path = str(Path(__file__).parent.parent / "stage_configs" / "qwen3_omni_ci.yaml")
|
||||||
|
stage_configs = [default_path, get_chunk_config(default_path)]
|
||||||
# Create parameter combinations for model and stage config
|
# Create parameter combinations for model and stage config
|
||||||
test_params = [(model, stage_config) for model in models for stage_config in stage_configs]
|
test_params = [(model, stage_config) for model in models for stage_config in stage_configs]
|
||||||
|
|
||||||
|
|
||||||
_omni_server_lock = threading.Lock()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
|
||||||
def omni_server(request):
|
|
||||||
"""Start vLLM-Omni server as a subprocess with actual model weights.
|
|
||||||
Uses session scope so the server starts only once for the entire test session.
|
|
||||||
Multi-stage initialization can take 10-20+ minutes.
|
|
||||||
"""
|
|
||||||
with _omni_server_lock:
|
|
||||||
model, stage_config_path = request.param
|
|
||||||
|
|
||||||
print(f"Starting OmniServer with model: {model}")
|
|
||||||
|
|
||||||
with OmniServer(model, ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"]) as server:
|
|
||||||
print("OmniServer started successfully")
|
|
||||||
yield server
|
|
||||||
print("OmniServer stopping...")
|
|
||||||
|
|
||||||
print("OmniServer stopped")
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def client(omni_server):
|
|
||||||
"""OpenAI client for the running vLLM-Omni server."""
|
|
||||||
return openai.OpenAI(
|
|
||||||
base_url=f"http://{omni_server.host}:{omni_server.port}/v1",
|
|
||||||
api_key="EMPTY",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def get_system_prompt():
|
def get_system_prompt():
|
||||||
return {
|
return {
|
||||||
"role": "system",
|
"role": "system",
|
||||||
@@ -83,7 +72,10 @@ def get_system_prompt():
|
|||||||
def get_prompt(prompt_type="text_only"):
|
def get_prompt(prompt_type="text_only"):
|
||||||
prompts = {
|
prompts = {
|
||||||
"text_only": "What is the capital of China?",
|
"text_only": "What is the capital of China?",
|
||||||
"mix": "What is recited in the audio? What is in this image? Describe the video briefly.",
|
"mix": "What is recited in the audio? What is in this image? What is in this video?",
|
||||||
|
"text_video": "What is in this video? ",
|
||||||
|
"text_image": "What is in this image? ",
|
||||||
|
"text_audio": "What is in this audio? ",
|
||||||
}
|
}
|
||||||
return prompts.get(prompt_type, prompts["text_only"])
|
return prompts.get(prompt_type, prompts["text_only"])
|
||||||
|
|
||||||
@@ -93,196 +85,228 @@ def get_max_batch_size(size_type="few"):
|
|||||||
return batch_sizes.get(size_type, 5)
|
return batch_sizes.get(size_type, 5)
|
||||||
|
|
||||||
|
|
||||||
def get_deploy_config(deploy_type="TP1"):
|
@pytest.mark.advanced_model
|
||||||
result = {
|
@pytest.mark.omni
|
||||||
"TP1": {
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
"stage_args": {
|
|
||||||
0: {
|
|
||||||
"engine_args.gpu_memory_utilization": 0.95,
|
|
||||||
"engine_args.tensor_parallel_size": 1,
|
|
||||||
"runtime.devices": "0",
|
|
||||||
},
|
|
||||||
2: {"runtime.devices": "1"},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result.get(deploy_type, result["TP1"])
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_text_to_text_001(client: openai.OpenAI, omni_server) -> None:
|
def test_text_to_audio_001(omni_server, openai_client) -> None:
|
||||||
"""Test processing text, generating text output via OpenAI API."""
|
|
||||||
messages = dummy_messages_from_mix_data(system_prompt=get_system_prompt(), content_text=get_prompt())
|
messages = dummy_messages_from_mix_data(system_prompt=get_system_prompt(), content_text=get_prompt())
|
||||||
|
|
||||||
# Test single completion
|
request_config = {
|
||||||
start_time = time.perf_counter()
|
"model": omni_server.model,
|
||||||
chat_completion = client.chat.completions.create(
|
"messages": messages,
|
||||||
model=omni_server.model, messages=messages, max_tokens=20, modalities=["text"]
|
"modalities": ["audio"],
|
||||||
)
|
"key_words": {"text": ["beijing"]},
|
||||||
# Verify E2E
|
}
|
||||||
print(f"the request e2e is: {time.perf_counter() - start_time}")
|
|
||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
|
||||||
|
|
||||||
# Verify only output text
|
openai_client.send_request(request_config)
|
||||||
assert len(chat_completion.choices) == 1, "The generated content includes more than just text."
|
|
||||||
|
|
||||||
# Verify text output success
|
|
||||||
text_choice = chat_completion.choices[0]
|
|
||||||
assert text_choice.message.content is not None, "No text output is generated"
|
|
||||||
assert chat_completion.usage.completion_tokens <= 20, "The output length more than the requested max_tokens."
|
|
||||||
assert "beijing" in text_choice.message.content.lower(), "The output do not contain keywords."
|
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_audio_to_text_001(client: openai.OpenAI, omni_server) -> None:
|
def test_text_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
"""Test processing text, generating text output via OpenAI API."""
|
messages = dummy_messages_from_mix_data(system_prompt=get_system_prompt(), content_text=get_prompt())
|
||||||
audio_data_url = f"data:audio/wav;base64,{generate_synthetic_audio(1, 1)['base64']}"
|
|
||||||
messages = dummy_messages_from_mix_data(audio_data_url=audio_data_url)
|
|
||||||
# Test single completion
|
|
||||||
start_time = time.perf_counter()
|
|
||||||
chat_completion = client.chat.completions.create(model=omni_server.model, messages=messages, modalities=["text"])
|
|
||||||
# Verify only output text
|
|
||||||
assert len(chat_completion.choices) == 1, "The generated content includes more than just text."
|
|
||||||
|
|
||||||
# Verify text output success
|
request_config = {
|
||||||
text_choice = chat_completion.choices[0]
|
"model": omni_server.model,
|
||||||
assert text_choice.message.content is not None, "No text output is generated"
|
"messages": messages,
|
||||||
assert "water" in text_choice.message.content.lower(), "The output do not contain keywords."
|
"key_words": {"text": ["beijing"]},
|
||||||
|
}
|
||||||
|
|
||||||
# Verify E2E
|
openai_client.send_request(request_config)
|
||||||
print(f"the request e2e is: {time.perf_counter() - start_time}")
|
|
||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_audio_to_text_audio_001(client: openai.OpenAI, omni_server) -> None:
|
def test_image_to_text_001(omni_server, openai_client) -> None:
|
||||||
"""Test processing text, generating audio output via OpenAI API."""
|
|
||||||
|
|
||||||
audio_data_url = f"data:audio/wav;base64,{generate_synthetic_audio(1, 5)['base64']}"
|
|
||||||
|
|
||||||
messages = dummy_messages_from_mix_data(audio_data_url=audio_data_url)
|
|
||||||
num_concurrent_requests = get_max_batch_size()
|
|
||||||
# Test single completion
|
|
||||||
e2e_list = list()
|
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=num_concurrent_requests) as executor:
|
|
||||||
# Submit multiple completion requests concurrently
|
|
||||||
futures = [
|
|
||||||
executor.submit(client.chat.completions.create, model=omni_server.model, messages=messages)
|
|
||||||
for _ in range(num_concurrent_requests)
|
|
||||||
]
|
|
||||||
start_time = time.perf_counter()
|
|
||||||
# Wait for all requests to complete and collect results
|
|
||||||
chat_completions = list()
|
|
||||||
for future in concurrent.futures.as_completed(futures):
|
|
||||||
chat_completions.append(future.result())
|
|
||||||
# Verify E2E
|
|
||||||
current_e2e = time.perf_counter() - start_time
|
|
||||||
print(f"the request e2e is: {current_e2e}")
|
|
||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
|
||||||
e2e_list.append(current_e2e)
|
|
||||||
|
|
||||||
print(f"the avg e2e is: {sum(e2e_list) / len(e2e_list)}")
|
|
||||||
# Verify all completions succeeded
|
|
||||||
assert len(chat_completions) == num_concurrent_requests, "Not all requests succeeded."
|
|
||||||
for chat_completion in chat_completions:
|
|
||||||
# Verify audio output success
|
|
||||||
audio_message = chat_completion.choices[1].message
|
|
||||||
audio_data = audio_message.audio.data
|
|
||||||
assert audio_data is not None, "No audio output is generated"
|
|
||||||
assert audio_message.audio.expires_at > time.time(), "The generated audio has expired."
|
|
||||||
|
|
||||||
# Verify text output success
|
|
||||||
text_choice = chat_completion.choices[0]
|
|
||||||
text_content = text_choice.message.content
|
|
||||||
assert text_choice.message.content is not None, "No text output is generated"
|
|
||||||
|
|
||||||
# Verify text output same as audio output
|
|
||||||
audio_content = convert_audio_to_text(audio_data)
|
|
||||||
print(f"text content is: {text_content}")
|
|
||||||
print(f"audio content is: {audio_content}")
|
|
||||||
similarity = cosine_similarity_text(audio_content, text_content)
|
|
||||||
print(f"similarity between audio and text is: {similarity}")
|
|
||||||
assert similarity > 0.9, "The audio content is not same as the text"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
|
||||||
def test_image_to_text_001(client: openai.OpenAI, omni_server) -> None:
|
|
||||||
"""Test processing text, generating text output via OpenAI API."""
|
|
||||||
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(224, 224)['base64']}"
|
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(224, 224)['base64']}"
|
||||||
messages = dummy_messages_from_mix_data(image_data_url=image_data_url)
|
messages = dummy_messages_from_mix_data(image_data_url=image_data_url)
|
||||||
# Test single completion
|
|
||||||
start_time = time.perf_counter()
|
|
||||||
chat_completion = client.chat.completions.create(
|
|
||||||
model=omni_server.model, messages=messages, max_tokens=100, modalities=["text"]
|
|
||||||
)
|
|
||||||
# Verify E2E
|
|
||||||
print(f"the request e2e is: {time.perf_counter() - start_time}")
|
|
||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
|
||||||
|
|
||||||
# Verify only output text
|
request_config = {
|
||||||
assert len(chat_completion.choices) == 1, "The generated content includes more than just text."
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"modalities": ["text"],
|
||||||
|
"key_words": {"image": IMAGE_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
# Verify text output success
|
openai_client.send_request(request_config)
|
||||||
text_choice = chat_completion.choices[0]
|
|
||||||
text_content = text_choice.message.content
|
|
||||||
assert text_content is not None, "No text output is generated"
|
|
||||||
assert chat_completion.usage.completion_tokens <= 100, "The output length more than the requested max_tokens."
|
|
||||||
assert "square" in text_content.lower(), "The output do not contain keywords."
|
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_image_to_text_audio_001(client: openai.OpenAI, omni_server) -> None:
|
def test_image_to_audio_001(omni_server, openai_client) -> None:
|
||||||
"""Test processing text, generating audio output via OpenAI API."""
|
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(224, 224)['base64']}"
|
||||||
|
messages = dummy_messages_from_mix_data(image_data_url=image_data_url)
|
||||||
|
|
||||||
num_concurrent_requests = get_max_batch_size()
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"modalities": ["audio"],
|
||||||
|
"key_words": {"image": IMAGE_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_image_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(1280, 720)['base64']}"
|
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(1280, 720)['base64']}"
|
||||||
|
|
||||||
messages = dummy_messages_from_mix_data(image_data_url=image_data_url)
|
messages = dummy_messages_from_mix_data(image_data_url=image_data_url)
|
||||||
|
|
||||||
# Test single completion
|
request_config = {
|
||||||
e2e_list = list()
|
"model": omni_server.model,
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=num_concurrent_requests) as executor:
|
"messages": messages,
|
||||||
# Submit multiple completion requests concurrently
|
"key_words": {"image": IMAGE_KEY},
|
||||||
futures = [
|
}
|
||||||
executor.submit(
|
|
||||||
client.chat.completions.create,
|
|
||||||
model=omni_server.model,
|
|
||||||
messages=messages,
|
|
||||||
)
|
|
||||||
for _ in range(num_concurrent_requests)
|
|
||||||
]
|
|
||||||
start_time = time.perf_counter()
|
|
||||||
# Wait for all requests to complete and collect results
|
|
||||||
chat_completions = list()
|
|
||||||
for future in concurrent.futures.as_completed(futures):
|
|
||||||
chat_completions.append(future.result())
|
|
||||||
# Verify E2E
|
|
||||||
current_e2e = time.perf_counter() - start_time
|
|
||||||
print(f"the request e2e is: {current_e2e}")
|
|
||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
|
||||||
e2e_list.append(current_e2e)
|
|
||||||
|
|
||||||
print(f"the avg e2e is: {sum(e2e_list) / len(e2e_list)}")
|
openai_client.send_request(request_config, request_num=get_max_batch_size())
|
||||||
# Verify all completions succeeded
|
|
||||||
assert len(chat_completions) == num_concurrent_requests, "Not all requests succeeded."
|
|
||||||
for chat_completion in chat_completions:
|
|
||||||
# Verify audio output success
|
|
||||||
audio_message = chat_completion.choices[1].message
|
|
||||||
audio_data = audio_message.audio.data
|
|
||||||
assert audio_data is not None, "No audio output is generated"
|
|
||||||
assert audio_message.audio.expires_at > time.time(), "The generated audio has expired."
|
|
||||||
|
|
||||||
# Verify text output success
|
|
||||||
text_choice = chat_completion.choices[0]
|
|
||||||
text_content = text_choice.message.content
|
|
||||||
assert text_content is not None, "No text output is generated"
|
|
||||||
assert "square" in text_content.lower(), "The output do not contain keywords."
|
|
||||||
|
|
||||||
# Verify text output same as audio output
|
@pytest.mark.advanced_model
|
||||||
audio_content = convert_audio_to_text(audio_data)
|
@pytest.mark.omni
|
||||||
print(f"text content is: {text_content}")
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
print(f"audio content is: {audio_content}")
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
similarity = cosine_similarity_text(audio_content, text_content)
|
def test_video_to_text_001(omni_server, openai_client) -> None:
|
||||||
print(f"similarity between audio and text is: {similarity}")
|
video_data_url = f"data:video/mp4;base64,{generate_synthetic_video(224, 224, 300)['base64']}"
|
||||||
assert similarity > 0.9, "The audio content is not same as the text"
|
messages = dummy_messages_from_mix_data(video_data_url=video_data_url)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"modalities": ["text"],
|
||||||
|
"key_words": {"video": VIDEO_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_video_to_audio_001(omni_server, openai_client) -> None:
|
||||||
|
video_data_url = f"data:video/mp4;base64,{generate_synthetic_video(224, 224, 300)['base64']}"
|
||||||
|
messages = dummy_messages_from_mix_data(video_data_url=video_data_url)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"modalities": ["audio"],
|
||||||
|
"key_words": {"video": VIDEO_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_video_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
|
video_data_url = f"data:video/mp4;base64,{generate_synthetic_video(224, 224, 300)['base64']}"
|
||||||
|
|
||||||
|
messages = dummy_messages_from_mix_data(video_data_url=video_data_url)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"key_words": {"video": VIDEO_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config, request_num=get_max_batch_size())
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_text_audio_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
|
audio_data_url = f"data:audio/wav;base64,{generate_synthetic_audio(5, 1)['base64']}"
|
||||||
|
messages = dummy_messages_from_mix_data(
|
||||||
|
audio_data_url=audio_data_url, system_prompt=get_system_prompt(), content_text=get_prompt("text_audio")
|
||||||
|
)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"modalities": ["text"],
|
||||||
|
"key_words": {"audio": AUDIO_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_text_image_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
|
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(224, 224)['base64']}"
|
||||||
|
|
||||||
|
messages = dummy_messages_from_mix_data(
|
||||||
|
image_data_url=image_data_url, system_prompt=get_system_prompt(), content_text=get_prompt("text_image")
|
||||||
|
)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"modalities": ["audio"],
|
||||||
|
"key_words": {"image": IMAGE_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_text_video_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
|
video_data_url = f"data:video/mp4;base64,{generate_synthetic_video(1280, 720, 30)['base64']}"
|
||||||
|
|
||||||
|
messages = dummy_messages_from_mix_data(
|
||||||
|
video_data_url=video_data_url, system_prompt=get_system_prompt(), content_text=get_prompt("text_video")
|
||||||
|
)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"key_words": {"video": VIDEO_KEY},
|
||||||
|
}
|
||||||
|
|
||||||
|
openai_client.send_request(request_config, request_num=get_max_batch_size())
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
|
def test_mix_to_text_audio_001(omni_server, openai_client) -> None:
|
||||||
|
video_data_url = f"data:video/mp4;base64,{generate_synthetic_video(224, 224, 300)['base64']}"
|
||||||
|
image_data_url = f"data:image/jpeg;base64,{generate_synthetic_image(224, 224)['base64']}"
|
||||||
|
audio_data_url = f"data:audio/wav;base64,{generate_synthetic_audio(5, 1)['base64']}"
|
||||||
|
messages = dummy_messages_from_mix_data(
|
||||||
|
system_prompt=get_system_prompt(),
|
||||||
|
video_data_url=video_data_url,
|
||||||
|
image_data_url=image_data_url,
|
||||||
|
audio_data_url=audio_data_url,
|
||||||
|
content_text=get_prompt("mix"),
|
||||||
|
)
|
||||||
|
|
||||||
|
request_config = {
|
||||||
|
"model": omni_server.model,
|
||||||
|
"messages": messages,
|
||||||
|
"stream": True,
|
||||||
|
"key_words": {"audio": AUDIO_KEY, "image": IMAGE_KEY, "video": VIDEO_KEY},
|
||||||
|
}
|
||||||
|
openai_client.send_request(request_config, request_num=get_max_batch_size())
|
||||||
@@ -13,10 +13,10 @@ stage_args:
|
|||||||
model_arch: Qwen2_5OmniForConditionalGeneration
|
model_arch: Qwen2_5OmniForConditionalGeneration
|
||||||
worker_type: ar
|
worker_type: ar
|
||||||
scheduler_cls: vllm_omni.core.sched.omni_ar_scheduler.OmniARScheduler
|
scheduler_cls: vllm_omni.core.sched.omni_ar_scheduler.OmniARScheduler
|
||||||
max_model_len: 2400
|
max_model_len: 16384
|
||||||
max_num_batched_tokens: 2400
|
max_num_batched_tokens: 16384
|
||||||
max_num_seqs: 1
|
max_num_seqs: 1
|
||||||
gpu_memory_utilization: 0.8
|
gpu_memory_utilization: 0.9
|
||||||
skip_mm_profiling: true
|
skip_mm_profiling: true
|
||||||
enforce_eager: true # Now we only support eager mode
|
enforce_eager: true # Now we only support eager mode
|
||||||
trust_remote_code: true
|
trust_remote_code: true
|
||||||
@@ -43,10 +43,10 @@ stage_args:
|
|||||||
model_arch: Qwen2_5OmniForConditionalGeneration
|
model_arch: Qwen2_5OmniForConditionalGeneration
|
||||||
worker_type: ar
|
worker_type: ar
|
||||||
scheduler_cls: vllm_omni.core.sched.omni_ar_scheduler.OmniARScheduler
|
scheduler_cls: vllm_omni.core.sched.omni_ar_scheduler.OmniARScheduler
|
||||||
max_model_len: 2400
|
max_model_len: 16384
|
||||||
max_num_batched_tokens: 2400
|
max_num_batched_tokens: 16384
|
||||||
max_num_seqs: 1
|
max_num_seqs: 1
|
||||||
gpu_memory_utilization: 0.8
|
gpu_memory_utilization: 0.9
|
||||||
skip_mm_profiling: true
|
skip_mm_profiling: true
|
||||||
enforce_eager: true
|
enforce_eager: true
|
||||||
trust_remote_code: true
|
trust_remote_code: true
|
||||||
@@ -58,7 +58,7 @@ stage_args:
|
|||||||
temperature: 0.9
|
temperature: 0.9
|
||||||
top_p: 0.8
|
top_p: 0.8
|
||||||
top_k: 40
|
top_k: 40
|
||||||
max_tokens: 128
|
max_tokens: 4096
|
||||||
seed: 42
|
seed: 42
|
||||||
detokenize: True
|
detokenize: True
|
||||||
repetition_penalty: 1.05
|
repetition_penalty: 1.05
|
||||||
@@ -66,7 +66,7 @@ stage_args:
|
|||||||
- stage_id: 2
|
- stage_id: 2
|
||||||
runtime:
|
runtime:
|
||||||
process: true
|
process: true
|
||||||
devices: "0" # Example: use a different GPU than the previous stage; use "0" if single GPU
|
devices: "2" # Example: use a different GPU than the previous stage; use "0" if single GPU
|
||||||
max_batch_size: 1
|
max_batch_size: 1
|
||||||
engine_args:
|
engine_args:
|
||||||
model_stage: code2wav
|
model_stage: code2wav
|
||||||
@@ -78,7 +78,7 @@ stage_args:
|
|||||||
trust_remote_code: true
|
trust_remote_code: true
|
||||||
enable_prefix_caching: false
|
enable_prefix_caching: false
|
||||||
engine_output_type: audio
|
engine_output_type: audio
|
||||||
max_num_batched_tokens: 4069
|
max_num_batched_tokens: 100000
|
||||||
engine_input_source: [1]
|
engine_input_source: [1]
|
||||||
final_output: true
|
final_output: true
|
||||||
final_output_type: audio
|
final_output_type: audio
|
||||||
@@ -86,7 +86,7 @@ stage_args:
|
|||||||
temperature: 0.0
|
temperature: 0.0
|
||||||
top_p: 1.0
|
top_p: 1.0
|
||||||
top_k: -1
|
top_k: -1
|
||||||
max_tokens: 128
|
max_tokens: 4096
|
||||||
seed: 42
|
seed: 42
|
||||||
detokenize: True
|
detokenize: True
|
||||||
repetition_penalty: 1.1
|
repetition_penalty: 1.1
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tests.conftest import OmniServer, convert_audio_file_to_text, cosine_similarity_text
|
from tests.conftest import convert_audio_file_to_text, cosine_similarity_text
|
||||||
|
from tests.utils import hardware_test
|
||||||
|
|
||||||
models = ["Qwen/Qwen2.5-Omni-7B"]
|
models = ["Qwen/Qwen2.5-Omni-7B"]
|
||||||
|
|
||||||
@@ -21,26 +22,7 @@ stage_configs = [str(Path(__file__).parent.parent.parent / "e2e" / "stage_config
|
|||||||
|
|
||||||
example_dir = str(Path(__file__).parent.parent.parent.parent / "examples" / "online_serving" / "qwen2_5_omni")
|
example_dir = str(Path(__file__).parent.parent.parent.parent / "examples" / "online_serving" / "qwen2_5_omni")
|
||||||
# Create parameter combinations for model and stage config
|
# Create parameter combinations for model and stage config
|
||||||
test_params = [(model, stage_config) for model in models for stage_config in stage_configs]
|
test_params = [(8091, model, stage_config) for model in models for stage_config in stage_configs]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
|
||||||
def omni_server(request):
|
|
||||||
"""Start vLLM-Omni server as a subprocess with actual model weights.
|
|
||||||
Uses module scope so the server starts only once per test module.
|
|
||||||
Multi-stage initialization can take 10-20+ minutes.
|
|
||||||
"""
|
|
||||||
model, stage_config_path = request.param
|
|
||||||
|
|
||||||
print(f"Starting OmniServer with model: {model}")
|
|
||||||
print("This may take 10-20+ minutes for initialization...")
|
|
||||||
|
|
||||||
with OmniServer(
|
|
||||||
model, ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"], port=8091
|
|
||||||
) as server:
|
|
||||||
print("OmniServer started successfully")
|
|
||||||
yield server
|
|
||||||
print("OmniServer stopped")
|
|
||||||
|
|
||||||
|
|
||||||
def run_cmd(command):
|
def run_cmd(command):
|
||||||
@@ -67,6 +49,9 @@ def extract_content_after_keyword(keywords, text):
|
|||||||
return matches[0]
|
return matches[0]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_send_multimodal_request_001(omni_server) -> None:
|
def test_send_multimodal_request_001(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -99,6 +84,9 @@ def test_send_multimodal_request_001(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_send_multimodal_request_002(omni_server) -> None:
|
def test_send_multimodal_request_002(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -131,6 +119,9 @@ def test_send_multimodal_request_002(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_send_multimodal_request_003(omni_server) -> None:
|
def test_send_multimodal_request_003(omni_server) -> None:
|
||||||
command = ["bash", os.path.join(example_dir, "run_curl_multimodal_generation.sh"), "mixed_modalities"]
|
command = ["bash", os.path.join(example_dir, "run_curl_multimodal_generation.sh"), "mixed_modalities"]
|
||||||
@@ -151,6 +142,9 @@ def test_send_multimodal_request_003(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_modality_control_001(omni_server) -> None:
|
def test_modality_control_001(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -178,6 +172,9 @@ def test_modality_control_001(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_modality_control_002(omni_server) -> None:
|
def test_modality_control_002(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -203,6 +200,9 @@ def test_modality_control_002(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_modality_control_003(omni_server) -> None:
|
def test_modality_control_003(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -237,6 +237,9 @@ def test_modality_control_003(omni_server) -> None:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="There is a known issue with stream error.")
|
@pytest.mark.skip(reason="There is a known issue with stream error.")
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "L4", "rocm": "MI325"}, num_cards={"cuda": 4, "rocm": 2})
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_stream_001(omni_server) -> None:
|
def test_stream_001(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tests.conftest import OmniServer, convert_audio_file_to_text, cosine_similarity_text
|
from tests.conftest import convert_audio_file_to_text, cosine_similarity_text
|
||||||
|
from tests.utils import hardware_test
|
||||||
|
|
||||||
models = ["Qwen/Qwen3-Omni-30B-A3B-Instruct"]
|
models = ["Qwen/Qwen3-Omni-30B-A3B-Instruct"]
|
||||||
|
|
||||||
@@ -21,26 +22,7 @@ stage_configs = [str(Path(__file__).parent.parent.parent / "e2e" / "stage_config
|
|||||||
|
|
||||||
example_dir = str(Path(__file__).parent.parent.parent.parent / "examples" / "online_serving" / "qwen3_omni")
|
example_dir = str(Path(__file__).parent.parent.parent.parent / "examples" / "online_serving" / "qwen3_omni")
|
||||||
# Create parameter combinations for model and stage config
|
# Create parameter combinations for model and stage config
|
||||||
test_params = [(model, stage_config) for model in models for stage_config in stage_configs]
|
test_params = [(8091, model, stage_config) for model in models for stage_config in stage_configs]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
|
||||||
def omni_server(request):
|
|
||||||
"""Start vLLM-Omni server as a subprocess with actual model weights.
|
|
||||||
Uses module scope so the server starts only once per test module..
|
|
||||||
Multi-stage initialization can take 10-20+ minutes.
|
|
||||||
"""
|
|
||||||
model, stage_config_path = request.param
|
|
||||||
|
|
||||||
print(f"Starting OmniServer with model: {model}")
|
|
||||||
print("This may take 10-20+ minutes for initialization...")
|
|
||||||
|
|
||||||
with OmniServer(
|
|
||||||
model, ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"], port=8091
|
|
||||||
) as server:
|
|
||||||
print("OmniServer started successfully")
|
|
||||||
yield server
|
|
||||||
print("OmniServer stopped")
|
|
||||||
|
|
||||||
|
|
||||||
def run_cmd(command):
|
def run_cmd(command):
|
||||||
@@ -67,6 +49,9 @@ def extract_content_after_keyword(keywords, text):
|
|||||||
return matches[0]
|
return matches[0]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_send_multimodal_request_001(omni_server) -> None:
|
def test_send_multimodal_request_001(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -92,6 +77,9 @@ def test_send_multimodal_request_001(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_send_multimodal_request_002(omni_server) -> None:
|
def test_send_multimodal_request_002(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -120,6 +108,9 @@ def test_send_multimodal_request_002(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_send_multimodal_request_003(omni_server) -> None:
|
def test_send_multimodal_request_003(omni_server) -> None:
|
||||||
command = ["bash", os.path.join(example_dir, "run_curl_multimodal_generation.sh"), "use_image"]
|
command = ["bash", os.path.join(example_dir, "run_curl_multimodal_generation.sh"), "use_image"]
|
||||||
@@ -134,6 +125,9 @@ def test_send_multimodal_request_003(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_modality_control_001(omni_server) -> None:
|
def test_modality_control_001(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -155,6 +149,9 @@ def test_modality_control_001(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_modality_control_002(omni_server) -> None:
|
def test_modality_control_002(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -175,6 +172,9 @@ def test_modality_control_002(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_modality_control_003(omni_server) -> None:
|
def test_modality_control_003(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
@@ -202,6 +202,9 @@ def test_modality_control_003(omni_server) -> None:
|
|||||||
# TODO: Verify the E2E latency after confirmation baseline.
|
# TODO: Verify the E2E latency after confirmation baseline.
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.advanced_model
|
||||||
|
@pytest.mark.omni
|
||||||
|
@hardware_test(res={"cuda": "H100", "rocm": "MI325"}, num_cards=2)
|
||||||
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
@pytest.mark.parametrize("omni_server", test_params, indirect=True)
|
||||||
def test_stream_001(omni_server) -> None:
|
def test_stream_001(omni_server) -> None:
|
||||||
command = [
|
command = [
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ def modify_stage(default_path, updates, deletes):
|
|||||||
|
|
||||||
|
|
||||||
def create_unique_server_params(configs: list[dict[str, Any]]) -> list[tuple[str, str, str]]:
|
def create_unique_server_params(configs: list[dict[str, Any]]) -> list[tuple[str, str, str]]:
|
||||||
unique_params = set()
|
unique_params = []
|
||||||
|
seen = set()
|
||||||
for config in configs:
|
for config in configs:
|
||||||
test_name = config["test_name"]
|
test_name = config["test_name"]
|
||||||
model = config["server_params"]["model"]
|
model = config["server_params"]["model"]
|
||||||
@@ -55,9 +56,13 @@ def create_unique_server_params(configs: list[dict[str, Any]]) -> list[tuple[str
|
|||||||
delete = config["server_params"].get("delete", None)
|
delete = config["server_params"].get("delete", None)
|
||||||
update = config["server_params"].get("update", None)
|
update = config["server_params"].get("update", None)
|
||||||
stage_config_path = modify_stage(stage_config_path, update, delete)
|
stage_config_path = modify_stage(stage_config_path, update, delete)
|
||||||
unique_params.add((test_name, model, stage_config_path))
|
|
||||||
|
|
||||||
return list(unique_params)
|
server_param = (test_name, model, stage_config_path)
|
||||||
|
if server_param not in seen:
|
||||||
|
seen.add(server_param)
|
||||||
|
unique_params.append(server_param)
|
||||||
|
|
||||||
|
return unique_params
|
||||||
|
|
||||||
|
|
||||||
def create_test_parameter_mapping(configs: list[dict[str, Any]]) -> dict[str, dict]:
|
def create_test_parameter_mapping(configs: list[dict[str, Any]]) -> dict[str, dict]:
|
||||||
@@ -95,6 +100,7 @@ def omni_server(request):
|
|||||||
print(f"Starting OmniServer with test: {test_name}, model: {model}")
|
print(f"Starting OmniServer with test: {test_name}, model: {model}")
|
||||||
|
|
||||||
with OmniServer(model, ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"]) as server:
|
with OmniServer(model, ["--stage-configs-path", stage_config_path, "--stage-init-timeout", "120"]) as server:
|
||||||
|
server.test_name = test_name
|
||||||
print("OmniServer started successfully")
|
print("OmniServer started successfully")
|
||||||
yield server
|
yield server
|
||||||
print("OmniServer stopping...")
|
print("OmniServer stopping...")
|
||||||
@@ -150,10 +156,15 @@ def get_benchmark_params_for_server(test_name: str) -> list:
|
|||||||
|
|
||||||
def create_benchmark_indices():
|
def create_benchmark_indices():
|
||||||
indices = []
|
indices = []
|
||||||
for test_name, config_data in server_to_benchmark_mapping.items():
|
seen = set()
|
||||||
params_list = config_data["benchmark_params"]
|
for config in BENCHMARK_CONFIGS:
|
||||||
for idx in range(len(params_list)):
|
test_name = config["test_name"]
|
||||||
indices.append((test_name, idx))
|
if test_name not in seen:
|
||||||
|
seen.add(test_name)
|
||||||
|
params_list = get_benchmark_params_for_server(test_name)
|
||||||
|
for idx in range(len(params_list)):
|
||||||
|
indices.append((test_name, idx))
|
||||||
|
|
||||||
return indices
|
return indices
|
||||||
|
|
||||||
|
|
||||||
@@ -164,6 +175,10 @@ benchmark_indices = create_benchmark_indices()
|
|||||||
def benchmark_params(request, omni_server):
|
def benchmark_params(request, omni_server):
|
||||||
"""Benchmark parameters fixture with proper parametrization"""
|
"""Benchmark parameters fixture with proper parametrization"""
|
||||||
test_name, param_index = request.param
|
test_name, param_index = request.param
|
||||||
|
|
||||||
|
if test_name != omni_server.test_name:
|
||||||
|
pytest.skip(f"Skipping parameter for {test_name} - current server is {omni_server.test_name}")
|
||||||
|
|
||||||
all_params = get_benchmark_params_for_server(test_name)
|
all_params = get_benchmark_params_for_server(test_name)
|
||||||
|
|
||||||
if not all_params:
|
if not all_params:
|
||||||
@@ -172,6 +187,10 @@ def benchmark_params(request, omni_server):
|
|||||||
if param_index >= len(all_params):
|
if param_index >= len(all_params):
|
||||||
raise ValueError(f"No benchmark parameters found for index {param_index} in test: {test_name}")
|
raise ValueError(f"No benchmark parameters found for index {param_index} in test: {test_name}")
|
||||||
|
|
||||||
|
current = param_index + 1
|
||||||
|
total = len(all_params)
|
||||||
|
print(f"\n Running benchmark {current}/{total} for {test_name}")
|
||||||
|
|
||||||
return {"test_name": test_name, "params": all_params[param_index]}
|
return {"test_name": test_name, "params": all_params[param_index]}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user