From 69f064062ba78a0ac44962f55a46a9d79cfb9ce0 Mon Sep 17 00:00:00 2001 From: usberkeley <150880684+usberkeley@users.noreply.github.com> Date: Tue, 28 Oct 2025 01:50:22 +0800 Subject: [PATCH] Code quality improvements: version update, type annotation enhancement, and enum usage simplification (#27581) Signed-off-by: Bradley --- docs/deployment/docker.md | 4 ++-- vllm/multimodal/profiling.py | 2 +- vllm/v1/core/sched/scheduler.py | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/deployment/docker.md b/docs/deployment/docker.md index d07358b85a5e4..1c639f3533d47 100644 --- a/docs/deployment/docker.md +++ b/docs/deployment/docker.md @@ -41,11 +41,11 @@ You can add any other [engine-args](../configuration/engine_args.md) you need af create a custom Dockerfile on top of the base image with an extra layer that installs them: ```Dockerfile - FROM vllm/vllm-openai:v0.9.0 + FROM vllm/vllm-openai:v0.11.0 # e.g. install the `audio` optional dependencies # NOTE: Make sure the version of vLLM matches the base image! - RUN uv pip install --system vllm[audio]==0.9.0 + RUN uv pip install --system vllm[audio]==0.11.0 ``` !!! tip diff --git a/vllm/multimodal/profiling.py b/vllm/multimodal/profiling.py index f55bad569e166..b864c52dfbc8b 100644 --- a/vllm/multimodal/profiling.py +++ b/vllm/multimodal/profiling.py @@ -368,7 +368,7 @@ class MultiModalProfiler(Generic[_I]): self, seq_len: int, mm_counts: Mapping[str, int] | None = None, - ): + ) -> Mapping[str, int]: """ Returns the maximum length of the multimodal (image placeholders+text) tokens, including any break/text tokens in-between image embeddings. diff --git a/vllm/v1/core/sched/scheduler.py b/vllm/v1/core/sched/scheduler.py index 7afee15a2da6b..14bdf295317d7 100644 --- a/vllm/v1/core/sched/scheduler.py +++ b/vllm/v1/core/sched/scheduler.py @@ -113,14 +113,12 @@ class Scheduler(SchedulerInterface): # req_id -> Request self.requests: dict[str, Request] = {} # Scheduling policy - if self.scheduler_config.policy == "priority": - self.policy = SchedulingPolicy.PRIORITY - elif self.scheduler_config.policy == "fcfs": - self.policy = SchedulingPolicy.FCFS - else: + try: + self.policy = SchedulingPolicy(self.scheduler_config.policy) + except ValueError as e: raise ValueError( f"Unknown scheduling policy: {self.scheduler_config.policy}" - ) + ) from e # Priority queues for requests. self.waiting = create_request_queue(self.policy) self.running: list[Request] = []