@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / fb4e8bf442
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 6, 08:15 UTC

[ROCm][CI] Fix accuracy for llama-nemotron-vl pooling tests (#37613)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>

Andreas Karatzas committed Mar 20, 2026 at 12:16 UTC fb4e8bf442c53a211d297d31f0381f16c40b1240
1 file changed +8 -1
tests/models/multimodal/pooling/test_llama_nemotron_vl.py
+8 -1
@@ -22,8 +22,10 @@ from vllm.entrypoints.chat_utils import (
22 ChatCompletionContentPartTextParam,
23 )
24 from vllm.entrypoints.pooling.score.utils import ScoreMultiModalParam
25 +from vllm.platforms import current_platform
26
27 from ....conftest import IMAGE_ASSETS, HfRunner, PromptImageInput, VllmRunner
28 +from ....utils import ROCM_ENGINE_KWARGS
29 from ...utils import check_embeddings_close
30
31 # Prefixes used by the model API
@@ -70,6 +72,7 @@ def _run_test(
72 max_model_len=2048,
73 enforce_eager=True,
74 trust_remote_code=True,
75 + **ROCM_ENGINE_KWARGS,
76 ) as vllm_model:
77 vllm_outputs = vllm_model.embed(input_texts, images=input_images)
78
@@ -250,6 +253,7 @@ def _run_vllm_reranker(
253 max_model_len=2048,
254 enforce_eager=True,
255 trust_remote_code=True,
256 + **ROCM_ENGINE_KWARGS,
257 ) as vllm_model:
258 has_images = any(img is not None for _, img in docs)
259
@@ -322,8 +326,11 @@ def _run_reranker_test(
326 assert len(hf_scores) == len(vllm_scores), (
327 f"Output length mismatch: HF={len(hf_scores)}, vLLM={len(vllm_scores)}"
328 )
329 + # NOTE: ROCm shows slightly higher numerical variance dues to different attention
330 + # backend between vLLM and HF; use a marginally looser tolerance
331 + rel_tol = 0.022 if current_platform.is_rocm() else 0.02
332 for i, (hf_score, vllm_score) in enumerate(zip(hf_scores, vllm_scores)):
326 - assert hf_score == pytest.approx(vllm_score, rel=0.02), (
333 + assert hf_score == pytest.approx(vllm_score, rel=rel_tol), (
334 f"Score mismatch at index {i}: HF={hf_score:.4f}, vLLM={vllm_score:.4f}"
335 )
336