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 3, 21:30 UTC
[UT][XPU] fix test_parallel_sampling due to global random state (#42388)
Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
liuzhenwei committed
May 12, 2026 at 18:03 UTC
07a40ede19e0ce578222d220f5fd161eaf612eb6
1 file changed
+2
-1
tests/v1/engine/test_llm_engine.py
+2
-1
@@ -79,10 +79,11 @@ def _get_test_sampling_params(
79
structured_outputs: bool = False,
80
) -> tuple[list[SamplingParams], list[int]]:
81
"""Generate random sampling params for a batch."""
82
+ rng = random.Random(seed)
83
84
def get_mostly_n_gt1() -> int:
85
r"""Mostly n \in [2,20], ~1/3 n=1"""
85
- x = random.randint(0, 28)
86
+ x = rng.randint(0, 28)
87
if x < 10:
88
return 1
89
else: