Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,14 @@ jobs:
python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_tools_llm_benchmark.py -m "samples and transformers_lower_v5"
env:
SAMPLES_PY_DIR: "${{ env.SRC_DIR }}/tools"
- name: Test LLM Benchmark Tools with Qwen3-Omni model
if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).llm_bench }}
run: |
source ${{ env.INSTALL_DIR }}/setupvars.sh
python -m pip install transformers==5.1
python -m pytest -vs ${{ env.SRC_DIR }}/tests/python_tests/samples/test_tools_llm_benchmark.py -k "qwen3-omni"
env:
SAMPLES_PY_DIR: "${{ env.SRC_DIR }}/tools"

genai_nodejs_tests:
name: Node.js bindings tests
Expand Down
20 changes: 20 additions & 0 deletions tests/python_tests/samples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


def get_transformers_version():
"""Return (major, minor) of the installed transformers, or None if unavailable."""
try:
version = metadata.version("transformers")
except metadata.PackageNotFoundError:
return None
try:
major, minor = version.split(".")[:2]
return int(major), int(minor)
except ValueError:
return None


TRANSFORMERS_VERSION = get_transformers_version()

# Dictionary containing model configurations.
# Each key is a model identifier, and the value is a dictionary with:
# - "name": the model's name or path
Expand Down Expand Up @@ -197,6 +213,10 @@
"name": "optimum-intel-internal-testing/tiny-random-qwen3-vl",
"convert_args": ["--trust-remote-code", "--task", "image-text-to-text"],
},
"tiny-random-qwen3-omni": {
"name": "optimum-intel-internal-testing/tiny-random-qwen3-omni",
"convert_args": ["--trust-remote-code", "--task", "image-text-to-text"],
},
}

TEST_FILES = {
Expand Down
31 changes: 30 additions & 1 deletion tests/python_tests/samples/test_tools_llm_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from utils.constants import get_ov_cache_converted_models_dir
from utils.kokoro_test_assets import prepare_tiny_kokoro_model_path
from utils.kokoro_test_assets import prepare_tiny_kokoro_ov_path
from conftest import SAMPLES_PY_DIR, convert_model, download_test_content
from conftest import SAMPLES_PY_DIR, convert_model, download_test_content, TRANSFORMERS_VERSION


convert_draft_model = convert_model
download_mask_image = download_test_content
Expand Down Expand Up @@ -714,3 +715,31 @@ def test_python_tool_llm_benchmark_video_gen_json(
generate_llm_bench_input_generation_jsonl,
] + sample_args
run_sample(benchmark_py_command)

@pytest.mark.samples
@pytest.mark.skipif(
TRANSFORMERS_VERSION is None or TRANSFORMERS_VERSION < (5, 1),
reason="Requires transformers >= 5.1",
)
Comment thread
avasenin-14 marked this conversation as resolved.
@pytest.mark.parametrize("download_test_content", ["cat.png"], indirect=True)
@pytest.mark.parametrize("convert_model", ["tiny-random-qwen3-omni"], indirect=True)
@pytest.mark.parametrize(
"sample_args",
[
["-d", "cpu", "-n", "1", "--num_steps", "4", "--task", "visual_text_gen", "--optimum"],
["-d", "cpu", "-n", "1", "--num_steps", "4", "--task", "visual_text_gen", "--genai"],
],
)
Comment on lines +727 to +732
def test_python_tool_llm_benchmark_visual_text_gen(self, download_test_content, convert_model, sample_args):
benchmark_script = SAMPLES_PY_DIR / "llm_bench/benchmark.py"
benchmark_py_command = [
sys.executable,
benchmark_script,
"-m",
convert_model,
"--media",
download_test_content,
"--prompt",
"What animal is in this image?",
] + sample_args
run_sample(benchmark_py_command)
9 changes: 8 additions & 1 deletion tools/llm_bench/llm_bench_utils/config_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class UseCaseTextToSpeech(UseCase):
"videochat-flash-qwen",
"gemma4",
]
)
),
],
"speech_to_text": [UseCaseSpeech2Text(["whisper"])],
"image_cls": [UseCaseImageCls(["vit"])],
Expand Down Expand Up @@ -251,5 +251,12 @@ class UseCaseTextToSpeech(UseCase):
"text_to_speech": [UseCaseTextToSpeech(["speecht5", "kokoro"])],
}

try:
from optimum.intel.openvino import OVModelForMultimodalLM
except ImportError:
pass
else:
USE_CASES["visual_text_gen"].append(UseCaseVLM(["qwen3-omni"], ov_cls=OVModelForMultimodalLM))

Comment on lines +254 to +260
PA_ATTENTION_BACKEND = "PA"
SDPA_ATTENTION_BACKEND = "SDPA"
Loading