[Rebase] Align vLLM-Omni with vLLM v0.31.0 (#8459)
Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
1f47fa2f29
commit
0b0d2d7009
141 files changed
+2885
-721
No files matched your search
@@ -123,6 +123,8 @@ class OmniEngineCoreRequest(EngineCoreRequest):
|
||||
trace_headers=request.trace_headers,
|
||||
resumable=request.resumable,
|
||||
external_req_id=request.external_req_id,
|
||||
session_id=request.session_id,
|
||||
kv_hints=request.kv_hints,
|
||||
reasoning_ended=request.reasoning_ended,
|
||||
reasoning_parser_kwargs=request.reasoning_parser_kwargs,
|
||||
abort_immediately=request.abort_immediately,
|
||||
|
||||
@@ -270,6 +270,10 @@ class OmniEngineArgs(EngineArgs):
|
||||
)
|
||||
validate_worker_omni_connector(self.worker_cls, needs_connector)
|
||||
super().__post_init__()
|
||||
# The NPU runner implements the auxiliary connector on its legacy
|
||||
# execution path; CUDA/ROCm Omni stages use the V2 implementation.
|
||||
if self.aux_output_config.enabled and not self.use_v2_model_runner and not current_omni_platform.is_npu():
|
||||
raise ValueError("Auxiliary outputs require use_v2_model_runner=True for this Omni stage.")
|
||||
|
||||
def _ensure_omni_models_registered(self):
|
||||
if hasattr(self, "_omni_models_registered"):
|
||||
|
||||
@@ -14,6 +14,7 @@ from typing import Any, Literal, cast
|
||||
from vllm.inputs import PromptType
|
||||
from vllm.logger import init_logger
|
||||
from vllm.v1.engine import EngineCoreRequest
|
||||
from vllm.v1.kv_hints import KvHintsEnvelope
|
||||
|
||||
from vllm_omni.data_entry_keys import REQUEST_ARTIFACT_DIRS_KEY, TRANSFORM_OWNED_META_KEYS
|
||||
from vllm_omni.engine import OmniEngineCoreRequest
|
||||
@@ -259,6 +260,7 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
data_parallel_rank: int | None = None,
|
||||
reasoning_ended: bool | None = None,
|
||||
*,
|
||||
kv_hints: KvHintsEnvelope | None = None,
|
||||
resumable: bool = False,
|
||||
message_type: Literal["add_request", "streaming_update"] = "add_request",
|
||||
) -> StageSubmissionMessage:
|
||||
@@ -289,6 +291,8 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
request_artifact_dirs: list[str] = []
|
||||
|
||||
stage_type = self.stage_metadata[0].stage_type
|
||||
if stage_type == "diffusion" and kv_hints is not None:
|
||||
raise ValueError("kv_hints require an AR/LLM stage with a KV cache")
|
||||
output_prompt_text: Any = None
|
||||
_preprocess_ms = 0.0
|
||||
if stage_type != "diffusion" and not isinstance(prompt, EngineCoreRequest):
|
||||
@@ -343,6 +347,7 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
priority=priority,
|
||||
data_parallel_rank=data_parallel_rank,
|
||||
resumable=resumable,
|
||||
**({"kv_hints": kv_hints} if kv_hints is not None else {}),
|
||||
)
|
||||
except Exception:
|
||||
if preselected_stage0_replica is not None and self.stage_pools:
|
||||
@@ -518,6 +523,7 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
data_parallel_rank: int | None = None,
|
||||
reasoning_ended: bool | None = None,
|
||||
*,
|
||||
kv_hints: KvHintsEnvelope | None = None,
|
||||
resumable: bool = False,
|
||||
) -> None:
|
||||
"""Process stage-0 input locally, then send to the Orchestrator.
|
||||
@@ -543,6 +549,7 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
data_parallel_rank=data_parallel_rank,
|
||||
reasoning_ended=reasoning_ended,
|
||||
resumable=resumable,
|
||||
**({"kv_hints": kv_hints} if kv_hints is not None else {}),
|
||||
)
|
||||
except BaseException:
|
||||
if isinstance(prompt, dict):
|
||||
@@ -599,6 +606,7 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
data_parallel_rank: int | None = None,
|
||||
reasoning_ended: bool | None = None,
|
||||
*,
|
||||
kv_hints: KvHintsEnvelope | None = None,
|
||||
resumable: bool = False,
|
||||
) -> None:
|
||||
"""Async add_request API."""
|
||||
@@ -617,6 +625,7 @@ class AsyncOmniEngine(OmniEngineBase):
|
||||
data_parallel_rank=data_parallel_rank,
|
||||
reasoning_ended=reasoning_ended,
|
||||
resumable=resumable,
|
||||
**({"kv_hints": kv_hints} if kv_hints is not None else {}),
|
||||
)
|
||||
|
||||
def add_streaming_update(
|
||||
|
||||
@@ -751,7 +751,7 @@ class OrchestratorBase:
|
||||
stage_ids: list[int] = []
|
||||
for pool in target_pools:
|
||||
clear_sender = pool.stage_type != "diffusion" and (
|
||||
method in ("reset_mm_cache", "sleep")
|
||||
method in ("reset_mm_cache", "sleep", "release_kv_cache_memory")
|
||||
or (method == "pause_scheduler" and kwargs.get("clear_cache", args[1] if len(args) > 1 else True))
|
||||
)
|
||||
for replica_id in pool.live_replica_ids():
|
||||
|
||||
@@ -34,6 +34,7 @@ from vllm_omni.engine.stage_client import StageClientBase
|
||||
from vllm_omni.engine.stage_init_utils import StageMetadata
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from vllm.renderers import BaseRenderer
|
||||
from vllm.v1.engine import EngineCoreOutput
|
||||
|
||||
from vllm_omni.inputs.data import OmniTokensPrompt
|
||||
@@ -90,6 +91,7 @@ class StageEngineCoreClientBase(StageClientBase):
|
||||
coordinator: Any = None,
|
||||
client_count: int = 1,
|
||||
client_index: int = 0,
|
||||
renderer: BaseRenderer | None = None,
|
||||
) -> StageEngineCoreClient | DPLBStageEngineCoreClient:
|
||||
"""Create the appropriate stage async client for the DP mode."""
|
||||
parallel_config = vllm_config.parallel_config
|
||||
@@ -103,6 +105,7 @@ class StageEngineCoreClientBase(StageClientBase):
|
||||
coordinator=coordinator,
|
||||
client_count=client_count,
|
||||
client_index=client_index,
|
||||
renderer=renderer,
|
||||
)
|
||||
|
||||
if parallel_config.data_parallel_size > 1 and not parallel_config.data_parallel_external_lb:
|
||||
@@ -118,6 +121,7 @@ class StageEngineCoreClientBase(StageClientBase):
|
||||
client_addresses: dict[str, str] | None = None,
|
||||
client_count: int = 1,
|
||||
client_index: int = 0,
|
||||
renderer: BaseRenderer | None = None,
|
||||
*,
|
||||
metadata: StageMetadata | None = None,
|
||||
engine_manager: Any = None,
|
||||
@@ -183,13 +187,16 @@ class StageEngineCoreClientBase(StageClientBase):
|
||||
)
|
||||
|
||||
try:
|
||||
super().__init__(
|
||||
# Concrete clients place AsyncMPClient next in the cooperative MRO;
|
||||
# the mixin's declared base exposes only object.__init__ to mypy.
|
||||
super().__init__( # type: ignore[call-arg]
|
||||
vllm_config,
|
||||
executor_class,
|
||||
log_stats=log_stats,
|
||||
client_addresses=client_addresses,
|
||||
client_count=client_count,
|
||||
client_index=client_index,
|
||||
renderer=renderer,
|
||||
)
|
||||
if engine_manager is not None:
|
||||
self.resources.engine_manager = engine_manager
|
||||
|
||||
@@ -16,7 +16,8 @@ import signal
|
||||
from typing import Any
|
||||
|
||||
import vllm.v1.engine.core as _vllm_engine_core_module
|
||||
from vllm.logger import init_logger
|
||||
from vllm.config import VllmConfig
|
||||
from vllm.logger import configure_logging, init_logger
|
||||
from vllm.transformers_utils.config import (
|
||||
maybe_register_config_serialize_by_value,
|
||||
)
|
||||
@@ -195,6 +196,10 @@ class StageEngineCoreProc(EngineCoreProc):
|
||||
logging / metrics only.
|
||||
"""
|
||||
signal_callback: SignalCallback | None = None
|
||||
vllm_config: VllmConfig = kwargs["vllm_config"]
|
||||
if logging_config := getattr(vllm_config, "logging_config", None):
|
||||
configure_logging(logging_config)
|
||||
|
||||
maybe_register_config_serialize_by_value()
|
||||
|
||||
# Register vllm-omni reasoning parsers (e.g. step_audio) in this
|
||||
|
||||
@@ -109,6 +109,7 @@ class StagePool:
|
||||
"pause_scheduler",
|
||||
"resume_scheduler",
|
||||
"sleep",
|
||||
"release_kv_cache_memory",
|
||||
"wake_up",
|
||||
"reset_prefix_cache",
|
||||
"reset_encoder_cache",
|
||||
@@ -1361,7 +1362,7 @@ class StagePool:
|
||||
if timeout is not None:
|
||||
return await asyncio.wait_for(result, timeout=timeout)
|
||||
return await result
|
||||
if method in self._CACHE_RESET_METHODS:
|
||||
if method in self._CACHE_RESET_METHODS or method == "release_kv_cache_memory":
|
||||
return {"supported": False, "error": f"EngineCore helper {method}_async is unavailable"}
|
||||
|
||||
return await client.collective_rpc_async(
|
||||
|
||||
Reference in new issue
Block a user