[Bugfix] test_batch_inference_correctness now uses batch invariance (#48040)

Co-authored-by: Tyler Michael Smith <tlrmchlsmth@gmail.com>
This commit is contained in:
Morrison Turnansky
2026-08-21 09:06:59 -07:00
committed by GitHub
co-authored by Tyler Michael Smith
parent fbb17e780b
commit 1183f04b74
@@ -8,6 +8,7 @@ This script contains:
import pytest
import torch
import vllm.envs as envs
from vllm import SamplingParams
from vllm.config import CompilationConfig
from vllm.lora.request import LoRARequest
@@ -64,9 +65,8 @@ def test_batch_inference_correctness(
model_setup: (method, model_name, spec_model_name, lora_path, tp_size)
"""
with monkeypatch.context() as m:
# Disable randomness
if current_platform.is_cuda():
m.setenv("CUBLAS_WORKSPACE_CONFIG", ":4096:8")
m.setenv("VLLM_BATCH_INVARIANT", "1")
m.setattr(envs, "VLLM_BATCH_INVARIANT", True)
set_random_seed(SEED)
m.setattr(torch.backends.cudnn, "benchmark", False)
m.setattr(torch.backends.cudnn, "deterministic", True)