From 90f4936d9ee05f6108a401a3acc5c5631f5835f7 Mon Sep 17 00:00:00 2001 From: stefankoncarevic Date: Wed, 7 Oct 2026 10:21:47 +0200 Subject: [PATCH] [CI/Build] Widen the ragged prefill scoring tolerance, drop batch invariance (#60192) Signed-off-by: Stefan Koncarevic --- tests/v1/sample/test_logprobs.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/v1/sample/test_logprobs.py b/tests/v1/sample/test_logprobs.py index 813bea0bf3..a9b73f0ca2 100644 --- a/tests/v1/sample/test_logprobs.py +++ b/tests/v1/sample/test_logprobs.py @@ -1408,10 +1408,6 @@ def test_prompt_logprobs_with_chunking_and_preemption(): def test_prompt_logprob_token_ids_with_chunking_and_preemption(monkeypatch): """Per-row scores stay row-aligned across chunked prefill and preemption.""" monkeypatch.setenv("VLLM_USE_V2_MODEL_RUNNER", "1") - # The ragged check below compares a second generate call against the first - # one. Default kernel selection varies between processes, which moves bf16 - # logprob tails by up to 0.2; under this the two runs are bit-identical. - monkeypatch.setenv("VLLM_BATCH_INVARIANT", "1") prompts = [ "The following numbers of the sequence " @@ -1474,7 +1470,10 @@ def test_prompt_logprob_token_ids_with_chunking_and_preemption(monkeypatch): assert float(scores.max()) <= 1e-3, "logprobs must be <= 0" # Ragged rows: each row keeps a prefix of the candidates and must - # reproduce that prefix of the full scores, with -inf padding. + # reproduce that prefix of the full scores, with -inf padding. On ROCm + # the second generate call picks its own kernels, which moves bf16 + # tails by up to 0.19; a misaligned row is off by nats either way. + ragged_atol = 0.2 if current_platform.is_rocm() else 1e-2 ragged_params = make_params(lambda j: candidate_ids(j)[: 1 + j % 4]) ragged_outputs = vllm_model.llm.generate(token_prompts, ragged_params) for output, ragged_output in zip(outputs, ragged_outputs): @@ -1483,7 +1482,7 @@ def test_prompt_logprob_token_ids_with_chunking_and_preemption(monkeypatch): n = 1 + j % 4 expected[j, :n] = output.prompt_token_id_logprobs[j, :n] np.testing.assert_allclose( - ragged_output.prompt_token_id_logprobs, expected, atol=1e-2 + ragged_output.prompt_token_id_logprobs, expected, atol=ragged_atol ) # The row count is checked against the prompt at admission.