[Rebase] Rebase to vllm 0.27.0 (#5976)

Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zhou TaichangandClaude Opus 5 authored and GitHub committed 2026-08-11 15:23:46 +00:00
1 parent 584d78c673
commit 2ce15ab7a0
55 files changed
+1335 -93

No files matched your search

+14 -2
View File
@@ -152,6 +152,7 @@ from vllm_omni.entrypoints.openai.video_api_utils import (
decode_input_reference,
)
from vllm_omni.entrypoints.openpi.serving import ServingRealtimeRobotOpenPI
from vllm_omni.entrypoints.utils import PureDiffusionLauncherAdapter
from vllm_omni.errors import OmniClientError
from vllm_omni.inputs.data import OmniDiffusionSamplingParams, OmniTextPrompt
from vllm_omni.utils.forced_aligner import build_forced_aligner_config
@@ -549,6 +550,16 @@ async def omni_run_server_worker(listen_address, sock, args, client_config=None,
"Starting vLLM API server (pure diffusion mode) on %s",
listen_address,
)
# The vLLM 0.27 launcher's shutdown path reads
# engine_client.vllm_config.shutdown_timeout; AsyncOmni.vllm_config
# is None for pure diffusion (no comprehension stage), which would
# crash handle_shutdown and hang teardown. Wrap app.state.engine_client
# with a shim that only overrides vllm_config and forwards everything
# else (get_vllm_config still returns None for pure-diffusion detection).
app.state.engine_client = PureDiffusionLauncherAdapter(
engine_client,
shutdown_timeout=getattr(args, "shutdown_timeout", 0),
)
else:
logger.info(
"Starting vLLM API server %d on %s",
@@ -985,8 +996,9 @@ async def omni_init_app_state(
)
# Warm up chat template processing to avoid first-request latency
if state.openai_serving_chat is not None:
state.openai_serving_chat.warmup()
# Upstream f5ffc59b6a removed OpenAIServingChat.warmup() and moved the
# warmup onto the renderer (OnlineRenderer.warmup()); mirror upstream.
state.online_renderer.warmup()
state.openai_serving_completion = (
OpenAIServingCompletion(
+1 -1
View File
@@ -83,6 +83,7 @@ from vllm.inputs import PromptType
from vllm.logger import init_logger
from vllm.multimodal.media.connector import MediaConnector
from vllm.outputs import RequestOutput
from vllm.parser.mistral import MistralToolCall
from vllm.reasoning import ReasoningParser
from vllm.renderers import BaseRenderer, merge_kwargs
from vllm.renderers.inputs import TokPrompt
@@ -96,7 +97,6 @@ from vllm.tokenizers.mistral import (
validate_request_params,
)
from vllm.tool_parsers import ToolParser
from vllm.tool_parsers.mistral_tool_parser import MistralToolCall
from vllm.tool_parsers.streaming import extract_required_tool_call_streaming
from vllm.utils.collection_utils import as_list
from vllm.v1.engine.exceptions import EngineDeadError
+28
View File
@@ -905,3 +905,31 @@ def maybe_coerce_to_message_type(params: SamplingParams, is_streaming: bool):
params.skip_clone = True
params.output_kind = target_type
return params
class PureDiffusionLauncherAdapter:
"""vLLM launcher compatibility shim for pure-diffusion mode.
The upstream launcher's shutdown path reads
``app.state.engine_client.vllm_config.shutdown_timeout``
(vllm/entrypoints/launcher.py), but ``AsyncOmni.vllm_config`` returns
``None`` when the pipeline has no comprehension stage (pure diffusion),
which crashes ``handle_shutdown`` with AttributeError and hangs server
teardown (workers force-killed, spurious resource_tracker noise).
This adapter only overrides the ``vllm_config`` property with a minimal
fallback carrying ``shutdown_timeout`` and forwards every other attribute
to the wrapped engine client, so the pure-diffusion detection
(``get_vllm_config()`` still returns ``None``) is unaffected.
"""
def __init__(self, engine_client: Any, shutdown_timeout: float) -> None:
object.__setattr__(self, "_wrapped", engine_client)
object.__setattr__(self, "_shutdown_timeout", float(shutdown_timeout))
def __getattr__(self, name: str) -> Any:
return getattr(self._wrapped, name)
@property
def vllm_config(self) -> Any:
return types.SimpleNamespace(shutdown_timeout=self._shutdown_timeout)