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
Cleanup code after Python 3.10 upgrade (#26520)
Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
Lukas Geiger committed
Oct 16, 2025 at 11:38 UTC
ed344f41164f6f3b6c33fcbfda61f94b1a8ac790
2 files changed
+2
-8
benchmarks/benchmark_serving_structured_output.py
+2
-7
@@ -31,6 +31,7 @@ import time
31
import uuid
32
import warnings
33
from collections.abc import AsyncGenerator
34
+from contextlib import nullcontext
35
from dataclasses import dataclass
36
37
import datasets
@@ -501,15 +502,9 @@ async def benchmark(
502
503
pbar = None if disable_tqdm else tqdm(total=len(input_requests))
504
504
- # This can be used once the minimum Python version is 3.10 or higher,
505
- # and it will simplify the code in limited_request_func.
506
- # semaphore = (asyncio.Semaphore(max_concurrency)
507
- # if max_concurrency else contextlib.nullcontext())
508
- semaphore = asyncio.Semaphore(max_concurrency) if max_concurrency else None
505
+ semaphore = asyncio.Semaphore(max_concurrency) if max_concurrency else nullcontext()
506
507
async def limited_request_func(request_func_input, pbar):
511
- if semaphore is None:
512
- return await request_func(request_func_input=request_func_input, pbar=pbar)
508
async with semaphore:
509
return await request_func(request_func_input=request_func_input, pbar=pbar)
510
requirements/common.txt
-1
@@ -31,7 +31,6 @@ partial-json-parser # used for parsing partial JSON outputs
31
pyzmq >= 25.0.0
32
msgspec
33
gguf >= 0.13.0
34
-importlib_metadata; python_version < '3.10'
34
mistral_common[image,audio] >= 1.8.5
35
opencv-python-headless >= 4.11.0 # required for video IO
36
pyyaml