@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ad2d788016
Fork 0

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 14, 05:30 UTC

[Bug][Benchmark] Fix duplicate req in oversampling (#26140)

Signed-off-by: Ekagra Ranjan <3116519+ekagra-ranjan@users.noreply.github.com> Co-authored-by: Roger Wang <hey@rogerw.io>

Ekagra Ranjan committed Oct 2, 2025 at 22:55 UTC ad2d78801642b50b65fe5761c941ed97ed1285fd
1 file changed +11 -5
vllm/benchmarks/datasets.py
+11 -5
@@ -235,16 +235,22 @@ class BenchmarkDataset(ABC):
235
236 if len(requests) < num_requests:
237 random.seed(self.random_seed)
238 - additional = deepcopy(
239 - random.choices(requests, k=num_requests - len(requests))
240 - )
241 - for i in range(len(additional)):
242 - req = additional[i]
238 + needed = num_requests - len(requests)
239 + additional = []
240 + for i in range(needed):
241 + req = deepcopy(random.choice(requests))
242 req.request_id = request_id_prefix + str(len(requests) + i)
243 + additional.append(req)
244 requests.extend(additional)
245 logger.info("Oversampled requests to reach %d total samples.",
246 num_requests)
247
248 + ids = [req.request_id for req in requests]
249 + if len(ids) != len(set(ids)):
250 + raise ValueError("Duplicate request_id found in the sampled "
251 + "requests. Please ensure that each request_id "
252 + "is unique.")
253 +
254
255 # -----------------------------------------------------------------------------
256 # Utility Functions and Global Caches