[CI/Build] Reduce more duplicate runner startup in tests (#52570)

Signed-off-by: Isotr0py <Isotr0py@outlook.com>
This commit is contained in:
Isotr0py
2026-08-17 05:19:07 +00:00
committed by GitHub
parent 311b3513af
commit 53e211d292
10 changed files with 647 additions and 916 deletions
+15 -17
View File
@@ -17,6 +17,15 @@ HF_IMAGE_PROMPTS = IMAGE_ASSETS.prompts(
}
)
IMAGE_SIZE_FACTOR_GROUPS = (
# Single-scale
(1.0,),
# Single-scale, batched
(1.0, 1.0, 1.0),
# Multi-scale
(0.25, 0.5, 1.0),
)
def run_awq_test(
vllm_runner: type[VllmRunner],
@@ -24,7 +33,7 @@ def run_awq_test(
source_model: str,
quant_model: str,
*,
size_factors: list[float],
size_factor_groups: tuple[tuple[float, ...], ...],
dtype: str,
max_tokens: int,
num_logprobs: int,
@@ -33,11 +42,12 @@ def run_awq_test(
):
images = [asset.pil_image for asset in image_assets]
inputs_per_image = [
inputs_per_image_and_size_group = [
(
[prompt for _ in size_factors],
[rescale_image_size(image, factor) for factor in size_factors],
)
for size_factors in size_factor_groups
for image, prompt in zip(images, HF_IMAGE_PROMPTS)
]
@@ -60,7 +70,7 @@ def run_awq_test(
vllm_model.generate_greedy_logprobs(
prompts, max_tokens, num_logprobs=num_logprobs, images=images
)
for prompts, images in inputs_per_image
for prompts, images in inputs_per_image_and_size_group
]
with vllm_runner(
@@ -77,7 +87,7 @@ def run_awq_test(
vllm_model.generate_greedy_logprobs(
prompts, max_tokens, num_logprobs=num_logprobs, images=images
)
for prompts, images in inputs_per_image
for prompts, images in inputs_per_image_and_size_group
]
for source_outputs, quant_outputs in zip(
@@ -128,17 +138,6 @@ def test_awq_load(
("source_model", "quant_model"),
[("OpenGVLab/InternVL2-2B", "OpenGVLab/InternVL2-2B-AWQ")],
)
@pytest.mark.parametrize(
"size_factors",
[
# Single-scale
[1.0],
# Single-scale, batched
[1.0, 1.0, 1.0],
# Multi-scale
[0.25, 0.5, 1.0],
],
)
@pytest.mark.parametrize("dtype", ["half"])
@pytest.mark.parametrize("max_tokens", [128])
@pytest.mark.parametrize("num_logprobs", [5])
@@ -148,7 +147,6 @@ def test_awq_models(
image_assets,
source_model,
quant_model,
size_factors,
dtype,
max_tokens,
num_logprobs,
@@ -158,7 +156,7 @@ def test_awq_models(
image_assets,
source_model,
quant_model,
size_factors=size_factors,
size_factor_groups=IMAGE_SIZE_FACTOR_GROUPS,
dtype=dtype,
max_tokens=max_tokens,
num_logprobs=num_logprobs,