[Bugfix] test_batch_inference_correctness now uses batch invariance (#48040)
Co-authored-by: Tyler Michael Smith <tlrmchlsmth@gmail.com>
This commit is contained in:
co-authored by
Tyler Michael Smith
parent
fbb17e780b
commit
1183f04b74
@@ -8,6 +8,7 @@ This script contains:
|
|||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
import vllm.envs as envs
|
||||||
from vllm import SamplingParams
|
from vllm import SamplingParams
|
||||||
from vllm.config import CompilationConfig
|
from vllm.config import CompilationConfig
|
||||||
from vllm.lora.request import LoRARequest
|
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)
|
model_setup: (method, model_name, spec_model_name, lora_path, tp_size)
|
||||||
"""
|
"""
|
||||||
with monkeypatch.context() as m:
|
with monkeypatch.context() as m:
|
||||||
# Disable randomness
|
m.setenv("VLLM_BATCH_INVARIANT", "1")
|
||||||
if current_platform.is_cuda():
|
m.setattr(envs, "VLLM_BATCH_INVARIANT", True)
|
||||||
m.setenv("CUBLAS_WORKSPACE_CONFIG", ":4096:8")
|
|
||||||
set_random_seed(SEED)
|
set_random_seed(SEED)
|
||||||
m.setattr(torch.backends.cudnn, "benchmark", False)
|
m.setattr(torch.backends.cudnn, "benchmark", False)
|
||||||
m.setattr(torch.backends.cudnn, "deterministic", True)
|
m.setattr(torch.backends.cudnn, "deterministic", True)
|
||||||
|
|||||||
Reference in New Issue
Block a user