[Model] Integrate AURA into Full-Duplex Runtime (#7633)
This commit is contained in:
1 parent
d397a2f547
commit
62b15142bd
77 files changed
+7695
-457
No files matched your search
@@ -95,7 +95,12 @@ from vllm_omni.engine.stage_init_utils import set_death_signal
|
||||
from vllm_omni.engine.stage_runtime import OmniClientConfig
|
||||
from vllm_omni.entrypoints.async_omni import ABORT_TIMEOUT_S, AsyncOmni
|
||||
from vllm_omni.entrypoints.duplex.serving import OmniDuplexSessionHandler
|
||||
from vllm_omni.entrypoints.duplex.warmup import _warmup_duplex_realtime
|
||||
from vllm_omni.entrypoints.duplex.warmup import (
|
||||
DUPLEX_WARMUP_CLIENT_WAIT_S,
|
||||
_warmup_duplex_realtime,
|
||||
lookup_duplex_plugin,
|
||||
startup_warmup_kind,
|
||||
)
|
||||
from vllm_omni.entrypoints.duplex_omni import DuplexOmni
|
||||
from vllm_omni.entrypoints.openai import app_state as openai_app_state
|
||||
from vllm_omni.entrypoints.openai.app_state import (
|
||||
@@ -407,16 +412,19 @@ async def omni_run_server_worker(
|
||||
|
||||
await self._inner(scope, receive, send)
|
||||
|
||||
# Startup duplex warmup (duplex_session.warmup_frames in the deploy
|
||||
# yaml): real /v1/realtime connections wait on this event so the
|
||||
# first client never pays cold-start costs.
|
||||
# Startup duplex warmup: real /v1/realtime connections wait on this
|
||||
# event. Video-required models (AURA) do this by default — one short
|
||||
# audio chunk plus one frame — even when warmup_frames is 0. That is
|
||||
# not another call to the empty 0.01 s JIT-kernel registry.
|
||||
duplex_warmup_frames = 0
|
||||
warmup_kind = None
|
||||
if getattr(app.state, "openai_serving_duplex", None) is not None:
|
||||
duplex_cfg = getattr(engine_client, "duplex_session_config", None)
|
||||
duplex_warmup_frames = int(getattr(duplex_cfg, "warmup_frames", 0) or 0)
|
||||
app.state.duplex_warmup_done = asyncio.Event() if duplex_warmup_frames > 0 else None
|
||||
warmup_kind = startup_warmup_kind(lookup_duplex_plugin(engine_client), duplex_warmup_frames)
|
||||
app.state.duplex_warmup_done = asyncio.Event() if warmup_kind is not None else None
|
||||
warmup_task: asyncio.Task | None = None
|
||||
if duplex_warmup_frames > 0:
|
||||
if warmup_kind is not None:
|
||||
# Scheduled before serve_http (which may not return until
|
||||
# shutdown); the coroutine retries its self-connect until the
|
||||
# server socket is accepting.
|
||||
@@ -1760,9 +1768,12 @@ async def _wait_for_duplex_warmup(websocket: WebSocket) -> None:
|
||||
warmup_done = getattr(websocket.app.state, "duplex_warmup_done", None)
|
||||
if warmup_done is not None and not warmup_done.is_set() and websocket.query_params.get("vllm_omni_warmup") != "1":
|
||||
try:
|
||||
await asyncio.wait_for(warmup_done.wait(), timeout=120)
|
||||
await asyncio.wait_for(warmup_done.wait(), timeout=DUPLEX_WARMUP_CLIENT_WAIT_S)
|
||||
except (TimeoutError, asyncio.TimeoutError):
|
||||
logger.warning("Duplex warmup still running after 120 s; admitting the client anyway.")
|
||||
logger.warning(
|
||||
"Duplex warmup still running after %d s; admitting the client anyway.",
|
||||
DUPLEX_WARMUP_CLIENT_WAIT_S,
|
||||
)
|
||||
|
||||
|
||||
@router.websocket("/v1/duplex")
|
||||
|
||||
Reference in new issue
Block a user