[Fix] Fix gemma CI test failing on main (#20124)

Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com>
This commit is contained in:
Thomas Parnell 2025-06-27 06:06:59 +02:00 committed by GitHub
parent 8b64c895c0
commit e110930680
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,14 +7,21 @@ MODELS = ["google/gemma-2b", "google/gemma-2-2b", "google/gemma-3-4b-it"]
@pytest.mark.parametrize("model", MODELS) @pytest.mark.parametrize("model", MODELS)
def test_dummy_loader(vllm_runner, model: str) -> None: def test_dummy_loader(vllm_runner, monkeypatch, model: str) -> None:
with vllm_runner( with monkeypatch.context() as m:
model, m.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
load_format="dummy", with vllm_runner(
) as llm: model,
normalizers = llm.collective_rpc(lambda self: self.worker.model_runner. load_format="dummy",
model.model.normalizer.cpu().item()) ) as llm:
assert np.allclose( if model == "google/gemma-3-4b-it":
normalizers, normalizers = llm.model.collective_rpc(
llm.llm_engine.model_config.hf_config.hidden_size**0.5, lambda self: self.model_runner.model.language_model.model.
rtol=1e-3) normalizer.cpu().item())
config = llm.model.llm_engine.model_config.hf_config.text_config
else:
normalizers = llm.model.collective_rpc(
lambda self: self.model_runner.model.model.normalizer.cpu(
).item())
config = llm.model.llm_engine.model_config.hf_config
assert np.allclose(normalizers, config.hidden_size**0.5, rtol=2e-3)