[CI/Build] Widen the ragged prefill scoring tolerance, drop batch invariance (#60192)

Signed-off-by: Stefan Koncarevic <Stefan.Koncarevic@amd.com>
This commit is contained in:
stefankoncarevic
2026-10-07 16:21:47 +08:00
committed by GitHub
parent 7436a7f119
commit 90f4936d9e
+5 -6
View File
@@ -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.