Skip to content

Commit 0c5452b

Browse files
committed
fix circular import
1 parent 281b2e9 commit 0c5452b

File tree

2 files changed

+41
-32
lines changed

2 files changed

+41
-32
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""Core benchmark execution logic for the Qwen3-VL (Q3VL) benchmark."""
2+
3+
from __future__ import annotations
4+
5+
import mlperf_loadgen as lg
6+
from loguru import logger
7+
8+
from .schema import Dataset, Endpoint, Settings
9+
from .task import ShopifyGlobalCatalogue
10+
11+
12+
def run_benchmark(
13+
settings: Settings,
14+
dataset: Dataset,
15+
endpoint: Endpoint,
16+
random_seed: int,
17+
) -> None:
18+
"""Run the Qwen3-VL (Q3VL) benchmark."""
19+
logger.info("Running Qwen3-VL (Q3VL) benchmark with settings: {}", settings)
20+
logger.info("Running Qwen3-VL (Q3VL) benchmark with dataset: {}", dataset)
21+
logger.info(
22+
"Running Qwen3-VL (Q3VL) benchmark with OpenAI API endpoint: {}",
23+
endpoint,
24+
)
25+
logger.info("Running Qwen3-VL (Q3VL) benchmark with random seed: {}", random_seed)
26+
test_settings, log_settings = settings.to_lgtype()
27+
task = ShopifyGlobalCatalogue(
28+
dataset=dataset,
29+
endpoint=endpoint,
30+
settings=settings.test,
31+
random_seed=random_seed,
32+
)
33+
sut = task.construct_sut()
34+
qsl = task.construct_qsl()
35+
logger.info("Starting the Qwen3-VL (Q3VL) benchmark with LoadGen...")
36+
lg.StartTestWithLogSettings(sut, qsl, test_settings, log_settings)
37+
logger.info("The Qwen3-VL (Q3VL) benchmark with LoadGen completed.")
38+
lg.DestroyQSL(qsl)
39+
lg.DestroySUT(sut)
40+

multimodal/qwen3-vl/src/mlperf_inf_mm_q3vl/cli.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
from importlib.metadata import entry_points
77
from typing import Annotated
88

9-
import mlperf_loadgen as lg
109
from loguru import logger
1110
from pydantic import FilePath # noqa: TC002
1211
from pydantic_typer import Typer
1312
from typer import Option
1413

14+
from .benchmark import run_benchmark
1515
from .deploy import LocalVllmDeployer
1616
from .evaluation import run_evaluation
1717
from .log import setup_loguru_for_benchmark
1818
from .schema import Dataset, Endpoint, Settings, Verbosity, VllmEndpoint
19-
from .task import ShopifyGlobalCatalogue
2019

2120
app = Typer()
2221
benchmark_app = Typer()
@@ -126,36 +125,6 @@ def benchmark_endpoint(
126125
)
127126

128127

129-
def run_benchmark(
130-
settings: Settings,
131-
dataset: Dataset,
132-
endpoint: Endpoint,
133-
random_seed: int,
134-
) -> None:
135-
"""Run the Qwen3-VL (Q3VL) benchmark."""
136-
logger.info("Running Qwen3-VL (Q3VL) benchmark with settings: {}", settings)
137-
logger.info("Running Qwen3-VL (Q3VL) benchmark with dataset: {}", dataset)
138-
logger.info(
139-
"Running Qwen3-VL (Q3VL) benchmark with OpenAI API endpoint: {}",
140-
endpoint,
141-
)
142-
logger.info("Running Qwen3-VL (Q3VL) benchmark with random seed: {}", random_seed)
143-
test_settings, log_settings = settings.to_lgtype()
144-
task = ShopifyGlobalCatalogue(
145-
dataset=dataset,
146-
endpoint=endpoint,
147-
settings=settings.test,
148-
random_seed=random_seed,
149-
)
150-
sut = task.construct_sut()
151-
qsl = task.construct_qsl()
152-
logger.info("Starting the Qwen3-VL (Q3VL) benchmark with LoadGen...")
153-
lg.StartTestWithLogSettings(sut, qsl, test_settings, log_settings)
154-
logger.info("The Qwen3-VL (Q3VL) benchmark with LoadGen completed.")
155-
lg.DestroyQSL(qsl)
156-
lg.DestroySUT(sut)
157-
158-
159128
@benchmark_app.command(name="vllm")
160129
def benchmark_vllm(
161130
*,

0 commit comments

Comments
 (0)