[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 monkeypatch.context() as m:
m.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
with vllm_runner( with vllm_runner(
model, model,
load_format="dummy", load_format="dummy",
) as llm: ) as llm:
normalizers = llm.collective_rpc(lambda self: self.worker.model_runner. if model == "google/gemma-3-4b-it":
model.model.normalizer.cpu().item()) normalizers = llm.model.collective_rpc(
assert np.allclose( lambda self: self.model_runner.model.language_model.model.
normalizers, normalizer.cpu().item())
llm.llm_engine.model_config.hf_config.hidden_size**0.5, config = llm.model.llm_engine.model_config.hf_config.text_config
rtol=1e-3) 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)