main
py 39 lines 994 Bytes
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4 import pytest
5
6 from tests.utils import single_gpu_only
7 from vllm import SamplingParams
8
9 from .._correctness import check_mtp_correctness
10
11
12 @pytest.mark.parametrize(
13 ["model_setup", "mm_enabled", "expected_accuracy_threshold"],
14 [
15 (
16 ("mtp", "google/gemma-4-E4B-it", 1, "google/gemma-4-E4B-it-assistant"),
17 False,
18 0.50,
19 ), # gemma4 MTP with assistant model, ref: ~62%
20 ],
21 ids=["gemma4-e4b"],
22 )
23 @single_gpu_only
24 def test_mtp_correctness(
25 monkeypatch: pytest.MonkeyPatch,
26 sampling_config: SamplingParams,
27 model_setup: tuple[str, str, int, str | None],
28 mm_enabled: bool,
29 expected_accuracy_threshold: float,
30 vllm_runner,
31 ):
32 check_mtp_correctness(
33 monkeypatch,
34 sampling_config,
35 model_setup,
36 mm_enabled,
37 expected_accuracy_threshold,
38 vllm_runner,
39 )