"docs/assets/img/disagg-comm-stack.svg" did not exist on "bf61a5df924a656566478336d95310b2750cefee"
test_gemma.py 762 Bytes
Newer Older
1
2
3
4
5
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import numpy as np
import pytest

6
MODELS = ["google/gemma-2b", "google/gemma-2-2b"]
7
8
9


@pytest.mark.parametrize("model", MODELS)
10
11
12
13
def test_dummy_loader(vllm_runner, monkeypatch, model: str) -> None:
    with monkeypatch.context() as m:
        m.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
        with vllm_runner(
14
15
            model,
            load_format="dummy",
16
        ) as llm:
17
18
19
20
            normalizers = llm.apply_model(
                lambda model: model.model.normalizer.cpu().item()
            )
            config = llm.llm.llm_engine.model_config.hf_config
21
            assert np.allclose(normalizers, config.hidden_size**0.5, rtol=2e-3)