Skip to content

Commit

Permalink
Added compression tests for qwen2-vl
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-savelyevv committed Dec 5, 2024
1 parent 7af7cdc commit 02e6dc9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/openvino/test_exporters_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ class OVCLIExportTestCase(unittest.TestCase):
"--dataset contextual --num-samples 1 --trust-remote-code",
{"int8": 4, "int4": 14},
),
(
"image-text-to-text",
"qwen2_vl",
'int4 --group-size 4 --ratio 0.9 --sensitivity-metric "mean_activation_magnitude" '
"--dataset contextual --num-samples 1 --trust-remote-code",
{"int8": 8, "int4": 22},
),
]
)

Expand Down
16 changes: 16 additions & 0 deletions tests/openvino/test_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,21 @@ class OVWeightCompressionTest(unittest.TestCase):
),
{"int4": 14, "int8": 4},
),
(
OVModelForVisualCausalLM,
"qwen2_vl",
True,
dict(
bits=4,
group_size=16,
dataset="contextual",
ratio=0.8,
sensitivity_metric="mean_activation_magnitude",
num_samples=1,
trust_remote_code=True,
),
{"int4": 20, "int8": 10},
),
]
)

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

if is_transformers_version(">=", "4.45.0"):
SUPPORTED_ARCHITECTURES_WITH_AUTO_COMPRESSION.append((OVModelForVisualCausalLM, "minicpmv", True))
SUPPORTED_ARCHITECTURES_WITH_AUTO_COMPRESSION.append((OVModelForVisualCausalLM, "qwen2_vl", False))

SUPPORTED_ARCHITECTURES_WITH_HYBRID_QUANTIZATION = [
(OVStableDiffusionPipeline, "stable-diffusion", 72, 195),
Expand Down
1 change: 1 addition & 0 deletions tests/openvino/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"llava_next": (30, 9, 1),
"minicpmv": (30, 26, 1, 6),
"nanollava": (30, 15, 1),
"qwen2_vl": (30, 1, 1, 10),
}

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

0 comments on commit 02e6dc9

Please sign in to comment.