Merge vLLM-Omni v0.29.0rc1 into edge-infer/omni-0.29.0
The pair for vLLM v0.29.0: rc1's docs pin vllm==0.29.0 and a static scan of rc1's vllm.* imports against the v0.29.0 tree finds nothing missing, while our 0.28-based tree needs seven modules v0.29.0 no longer has (vllm.inputs.preprocess, entrypoints.launcher, openai.cli_args, openai.engine.protocol, serve.utils.server_utils, layers.batch_invariant, models.hunyuan_v1). Ten files conflicted. Upstream's structure is the base everywhere; the fork's features are re-attached to it: - deploy_profile / apply_deploy_profile run before rc1's resolve_omni_config pops deploy_config (async_omni_engine, cli/serve); the deploy-profile selector and the resolve_model_config_path chain it needs stay in entrypoints/utils.py; stage_overrides takes rc1's dict type. - config_factory keeps the lazy diffusion output-type import; the diffusion registry import in rc1's new config/resolver.py is made lazy for the same WP6 reason (TTS path must not load diffusion). - requirements: our core/media split kept; rc1's transformers>=5.13 floor and kernels==0.16.1 applied in core.txt / media.txt. - TTS: rc1's split_granularity and bounded seed plus our output_mode= codec_tokens, _SessionInbox cancel handling and codec DELTA accumulation; our private _conditioning_cache_salt is superseded by rc1's public tts_adapters/base.py::conditioning_cache_salt. - stage_runtime: rc1's single ExitStack G2 path (lock released before READY) replaces our two-path block, with the four worker_phase names the init profiler consumes still emitted; _cpu_placed / host admission kept. Not yet run against vLLM 0.29.0: the tests listed in the W6 record. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
commit
33de5d8629
513 files changed
+35146
-10927
No files matched your search
@@ -92,6 +92,16 @@ def add_multi_stage_cli_args(parser: argparse.ArgumentParser) -> None:
|
||||
"and tpop controls both text TPOP and internal stream TPOP."
|
||||
),
|
||||
)
|
||||
group.add_argument(
|
||||
"--omni-request-timeout-s",
|
||||
type=float,
|
||||
default=None,
|
||||
help=(
|
||||
"Total per-request timeout in seconds for benchmark HTTP requests. Timed-out requests are "
|
||||
"recorded as failed instead of stalling the run on a hung server. Defaults to 900 when "
|
||||
"omitted; set <= 0 to restore the legacy 6 h cap."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def add_diffusion_cli_args(parser: argparse.ArgumentParser) -> None:
|
||||
@@ -103,8 +113,8 @@ def add_diffusion_cli_args(parser: argparse.ArgumentParser) -> None:
|
||||
type=str,
|
||||
default="think",
|
||||
help=(
|
||||
"Default bot_task form field for --backend openai-image-edits-omni "
|
||||
"(/v1/images/edits). "
|
||||
"Default bot_task form field for image edits "
|
||||
"(--backend openai-image-edits-omni or --endpoint /v1/images/edits). "
|
||||
'Use --extra-body \'{"bot_task":"..."}\' to override per run.'
|
||||
),
|
||||
)
|
||||
@@ -352,6 +362,12 @@ def preprocess_serve_args(args: argparse.Namespace) -> None:
|
||||
raise ValueError("OmniInteract requires --max-concurrency to be positive")
|
||||
extra_body = dict(getattr(args, "extra_body", None) or {})
|
||||
bot_task = getattr(args, "bot_task", None)
|
||||
if getattr(args, "backend", None) == "openai-image-edits-omni" and bot_task is not None:
|
||||
backend = getattr(args, "backend", None)
|
||||
endpoint = getattr(args, "endpoint", None)
|
||||
# serve.py remaps implicit backend to the endpoint path for image edits;
|
||||
# inject bot_task for both the named backend and /v1/images/edits.
|
||||
if bot_task is not None and (
|
||||
backend in ("openai-image-edits-omni", "/v1/images/edits") or endpoint == "/v1/images/edits"
|
||||
):
|
||||
extra_body.setdefault("bot_task", bot_task)
|
||||
args.extra_body = extra_body
|
||||
@@ -14,15 +14,17 @@ import math
|
||||
import os
|
||||
import signal
|
||||
from types import FrameType
|
||||
from typing import Any, cast
|
||||
|
||||
import uvloop
|
||||
from vllm.entrypoints.cli.types import CLISubcommand
|
||||
from vllm.entrypoints.openai.cli_args import make_arg_parser, validate_parsed_serve_args
|
||||
from vllm.entrypoints.launchers.cli_args import make_arg_parser, validate_parsed_serve_args
|
||||
from vllm.entrypoints.serve.utils.api_utils import VLLM_SUBCMD_PARSER_EPILOG
|
||||
from vllm.logger import init_logger
|
||||
|
||||
from vllm_omni.entrypoints.cli.logo import log_logo
|
||||
from vllm_omni.entrypoints.openai.api_server import omni_run_server
|
||||
from vllm_omni.entrypoints.utils import parse_stage_overrides
|
||||
from vllm_omni.utils.tracking_parser import TrackingArgumentParser, TrackingNamespace
|
||||
|
||||
logger = init_logger(__name__)
|
||||
@@ -47,6 +49,17 @@ Search by using: `--help=<ConfigGroup>` to explore options by section (e.g.,
|
||||
"""
|
||||
|
||||
|
||||
def _parse_stage_overrides(value: str) -> dict[str, dict[str, Any]]:
|
||||
"""Adapt shared stage-override validation to argparse's error type."""
|
||||
try:
|
||||
parsed = parse_stage_overrides(value)
|
||||
except ValueError as exc:
|
||||
raise argparse.ArgumentTypeError(str(exc)) from exc
|
||||
if parsed is None:
|
||||
raise argparse.ArgumentTypeError("--stage-overrides requires a JSON object")
|
||||
return parsed
|
||||
|
||||
|
||||
def _nonneg_finite_float(value: str) -> float:
|
||||
"""Argparse type for finite, non-negative floats (rejects nan/inf)."""
|
||||
try:
|
||||
@@ -293,7 +306,7 @@ class OmniServeCommand(CLISubcommand):
|
||||
)
|
||||
omni_config_group.add_argument(
|
||||
"--stage-overrides",
|
||||
type=str,
|
||||
type=_parse_stage_overrides,
|
||||
default=None,
|
||||
help="Per-stage JSON overrides. Example: "
|
||||
'\'{"0": {"gpu_memory_utilization": 0.8}, "2": {"enforce_eager": true}}\'',
|
||||
@@ -952,6 +965,7 @@ def run_headless(args: TrackingNamespace) -> None:
|
||||
from vllm.v1.executor.multiproc_executor import MultiprocExecutor
|
||||
from vllm.version import __version__ as VLLM_VERSION
|
||||
|
||||
from vllm_omni.config.resolver import resolve_omni_config
|
||||
from vllm_omni.distributed.omni_connectors.utils.initialization import resolve_omni_kv_config_for_stage
|
||||
from vllm_omni.engine.stage_engine_startup import (
|
||||
get_headless_replica_devices,
|
||||
@@ -966,10 +980,6 @@ def run_headless(args: TrackingNamespace) -> None:
|
||||
load_omni_transfer_config_for_model,
|
||||
prepare_engine_environment,
|
||||
)
|
||||
from vllm_omni.entrypoints.utils import (
|
||||
load_and_resolve_stage_configs,
|
||||
parse_stage_overrides,
|
||||
)
|
||||
|
||||
model = args.model
|
||||
stage_id: int | None = args.stage_id
|
||||
@@ -990,6 +1000,22 @@ def run_headless(args: TrackingNamespace) -> None:
|
||||
|
||||
# Filter down to a dict of things explicitly requested by the user
|
||||
args_dict = args.get_explicit_kwargs_dict()
|
||||
# This CLI-only negative alias is consumed below when selecting the
|
||||
# launcher log_stats value; it is not a per-stage config override.
|
||||
args_dict.pop("disable_log_stats", None)
|
||||
|
||||
# ``--deploy-profile`` (edge) translates to a concrete ``deploy_config`` path
|
||||
# and applies the profile's ``orchestrator:`` defaults, exactly like the
|
||||
# standard engine path (AsyncOmniEngine.__init__), so headless and standard
|
||||
# launches resolve to the same per-stage device layout. Must run before
|
||||
# deploy_config is popped below.
|
||||
from vllm_omni.entrypoints.utils import apply_deploy_profile
|
||||
|
||||
apply_deploy_profile(model, args_dict)
|
||||
|
||||
deploy_config_path = args_dict.pop("deploy_config", None)
|
||||
strategy_config_path = args_dict.pop("strategy_config", None)
|
||||
stage_overrides = args_dict.pop("stage_overrides", None)
|
||||
|
||||
# ``--replica-id`` is deprecated and ignored — replica ids are
|
||||
# auto-assigned by ``OmniMasterServer`` so headless processes carry
|
||||
@@ -1003,37 +1029,27 @@ def run_headless(args: TrackingNamespace) -> None:
|
||||
"master server.",
|
||||
args.replica_id,
|
||||
)
|
||||
args_dict.pop("replica_id")
|
||||
|
||||
# Parse --stage-overrides (raw JSON string) exactly like the standard
|
||||
# engine path (AsyncOmniEngine._resolve_stage_configs) so headless and
|
||||
# standard launches resolve to the same per-stage device layout.
|
||||
stage_overrides = parse_stage_overrides(args_dict.get("stage_overrides"))
|
||||
|
||||
from vllm_omni.entrypoints.utils import apply_deploy_profile
|
||||
|
||||
apply_deploy_profile(model, args_dict)
|
||||
|
||||
config_path, stage_configs, _ = load_and_resolve_stage_configs(
|
||||
resolved = resolve_omni_config(
|
||||
model,
|
||||
args_dict,
|
||||
# store_true cannot express an explicit False: absent maps to None
|
||||
# ("not specified") so the deploy yaml's per-stage value applies.
|
||||
trust_remote_code=getattr(args, "trust_remote_code", None) or None,
|
||||
deploy_config_path=args_dict.get("deploy_config"),
|
||||
cli_overrides=args_dict,
|
||||
deploy_config_path=deploy_config_path,
|
||||
stage_overrides=stage_overrides,
|
||||
strategy_config_path=args_dict.get("strategy_config"),
|
||||
strategy_config_path=strategy_config_path,
|
||||
)
|
||||
config_path = resolved.config_path
|
||||
stage_configs = list(resolved.stage_configs)
|
||||
|
||||
# Locate the stage config that matches stage_id.
|
||||
stage_cfg = None
|
||||
for cfg in stage_configs:
|
||||
if cfg.stage_id == stage_id:
|
||||
stage_cfg = cfg
|
||||
break
|
||||
if stage_cfg is None:
|
||||
try:
|
||||
stage_cfg = resolved.stage_by_id(stage_id)
|
||||
except KeyError:
|
||||
raise ValueError(
|
||||
f"No stage config found for stage_id={stage_id}. Available stage ids: {[c.stage_id for c in stage_configs]}"
|
||||
)
|
||||
) from None
|
||||
|
||||
prepare_engine_environment()
|
||||
per_replica_devices = get_headless_replica_devices(stage_cfg, stage_id, omni_dp_size_local)
|
||||
@@ -1048,7 +1064,7 @@ def run_headless(args: TrackingNamespace) -> None:
|
||||
omni_master_port=omni_master_port,
|
||||
omni_dp_size_local=omni_dp_size_local,
|
||||
per_replica_devices=per_replica_devices,
|
||||
config_path=config_path,
|
||||
config_path=cast(str, config_path),
|
||||
replica_bind_address=omni_replica_address,
|
||||
)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user