[Core] Composable parallel: Phase 1 strategy overlay (TP/DP/stage-replica) (RFC #4084) (#4281)

Signed-off-by: Kushan A. <kahmadian@nvidia.com>
Signed-off-by: kushanam <kushanam@users.noreply.github.com>
Signed-off-by: Kushan A <kahmadian@nvidia.com>
Signed-off-by: kahmadian <kahmadian@users.noreply.github.com>
Co-authored-by: kushanam <kushanam@users.noreply.github.com>
Co-authored-by: kahmadian <kahmadian@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-07-10 21:29:24 -06:00
1 parent fe478a95ab
commit ff6f0da271
30 files changed
+2722 -51

No files matched your search

+42 -13
View File
@@ -58,7 +58,10 @@ from vllm_omni.engine.stage_runtime import (
create_stage_runtime,
)
from vllm_omni.entrypoints.pd_utils import PDDisaggregationMixin
from vllm_omni.entrypoints.utils import load_and_resolve_stage_configs
from vllm_omni.entrypoints.utils import (
load_and_resolve_stage_configs,
parse_stage_overrides,
)
from vllm_omni.inputs.data import OmniSamplingParams
from vllm_omni.metrics.prometheus import OmniRequestCounter
@@ -1123,11 +1126,41 @@ class AsyncOmniEngine:
return result
def _apply_strategy_lb_policy(self, derived: str | None, kwargs: dict[str, Any]) -> None:
"""Apply a strategy-derived ``omni_lb_policy`` to the engine.
Precedence: an explicit ``--omni-lb-policy`` always wins. ``"random"`` is
the engine default and is treated as "unset" (indistinguishable from no
flag), so a strategy value overrides it. If the user explicitly passed a
non-default policy that conflicts with the strategy-derived one, raise so
the mismatch is not silently ignored.
"""
if not derived:
return
explicit = kwargs.get("omni_lb_policy")
user_set = explicit is not None and str(explicit) != "random"
if user_set:
if str(explicit) != str(derived):
raise ValueError(
f"Conflicting load-balancer policy: --omni-lb-policy={explicit!r} was given "
f"but the composable-parallel strategy derived omni_lb_policy={derived!r}. "
"Drop --omni-lb-policy to use the strategy value, or make them match."
)
return
if self._omni_lb_policy != str(derived):
logger.info(
"[composable_parallel] applying strategy-derived omni_lb_policy=%r (was %r).",
derived,
self._omni_lb_policy,
)
self._omni_lb_policy = str(derived)
def _resolve_stage_configs(self, model: str, kwargs: dict[str, Any]) -> tuple[str, list[Any]]:
"""Resolve stage configs and inject defaults shared by orchestrator/headless."""
stage_configs_path = kwargs.get("stage_configs_path", None)
deploy_config_path = kwargs.pop("deploy_config", None)
strategy_config_path = kwargs.pop("strategy_config", None)
stage_overrides_json = kwargs.pop("stage_overrides", None)
explicit_stage_configs = kwargs.pop("stage_configs", None)
if explicit_stage_configs is not None:
@@ -1142,27 +1175,23 @@ class AsyncOmniEngine:
base_kwargs = kwargs
# Parse --stage-overrides JSON string if provided
stage_overrides = None
if stage_overrides_json:
if isinstance(stage_overrides_json, str):
try:
stage_overrides = json.loads(stage_overrides_json)
except json.JSONDecodeError as exc:
raise ValueError(
f"--stage-overrides is not valid JSON: {exc}. Got: {stage_overrides_json!r}"
) from exc
else:
stage_overrides = stage_overrides_json
stage_overrides = parse_stage_overrides(stage_overrides_json)
config_path, stage_configs = load_and_resolve_stage_configs(
config_path, stage_configs, strategy_lb_policy = load_and_resolve_stage_configs(
model,
stage_configs_path,
base_kwargs,
default_stage_cfg_factory=lambda: self._create_default_diffusion_stage_cfg(kwargs),
deploy_config_path=deploy_config_path,
stage_overrides=stage_overrides,
strategy_config_path=strategy_config_path,
)
# A strategy.yaml may derive a pipeline-wide load-balancer policy. It is
# an orchestrator-level knob (read once at construction), so apply it here
# rather than as a per-stage config field.
self._apply_strategy_lb_policy(strategy_lb_policy, kwargs)
# Inject diffusion LoRA-related knobs from kwargs if not present in the stage config.
for cfg in stage_configs:
try: