Skip to content

Commit 02e6dc9

Browse files
Added compression tests for qwen2-vl
1 parent 7af7cdc commit 02e6dc9

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

tests/openvino/test_exporters_cli.py

+7
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ class OVCLIExportTestCase(unittest.TestCase):
177177
"--dataset contextual --num-samples 1 --trust-remote-code",
178178
{"int8": 4, "int4": 14},
179179
),
180+
(
181+
"image-text-to-text",
182+
"qwen2_vl",
183+
'int4 --group-size 4 --ratio 0.9 --sensitivity-metric "mean_activation_magnitude" '
184+
"--dataset contextual --num-samples 1 --trust-remote-code",
185+
{"int8": 8, "int4": 22},
186+
),
180187
]
181188
)
182189

tests/openvino/test_quantization.py

+16
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,21 @@ class OVWeightCompressionTest(unittest.TestCase):
415415
),
416416
{"int4": 14, "int8": 4},
417417
),
418+
(
419+
OVModelForVisualCausalLM,
420+
"qwen2_vl",
421+
True,
422+
dict(
423+
bits=4,
424+
group_size=16,
425+
dataset="contextual",
426+
ratio=0.8,
427+
sensitivity_metric="mean_activation_magnitude",
428+
num_samples=1,
429+
trust_remote_code=True,
430+
),
431+
{"int4": 20, "int8": 10},
432+
),
418433
]
419434
)
420435

@@ -439,6 +454,7 @@ class OVWeightCompressionTest(unittest.TestCase):
439454

440455
if is_transformers_version(">=", "4.45.0"):
441456
SUPPORTED_ARCHITECTURES_WITH_AUTO_COMPRESSION.append((OVModelForVisualCausalLM, "minicpmv", True))
457+
SUPPORTED_ARCHITECTURES_WITH_AUTO_COMPRESSION.append((OVModelForVisualCausalLM, "qwen2_vl", False))
442458

443459
SUPPORTED_ARCHITECTURES_WITH_HYBRID_QUANTIZATION = [
444460
(OVStableDiffusionPipeline, "stable-diffusion", 72, 195),

tests/openvino/utils_tests.py

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
"llava_next": (30, 9, 1),
189189
"minicpmv": (30, 26, 1, 6),
190190
"nanollava": (30, 15, 1),
191+
"qwen2_vl": (30, 1, 1, 10),
191192
}
192193

193194
TEST_IMAGE_URL = "http://images.cocodataset.org/val2017/000000039769.jpg"

0 commit comments

Comments
 (0)