Skip to content

vllm_omni.config.composable_parallel.strategy_loader

Load per-role parallel strategies from a strategy file.

The strategy file is a small, optional companion to the deploy config. It maps a logical role (model_stage, e.g. thinker) to a list of axis declarations, each of which becomes one :class:StrategySpec. YAML is the only format wired up today, but the module/symbol names stay format-agnostic so a different source can be added without renaming the public surface::

strategies:
  thinker:
    - axis: tp
      size: 2
  talker:
    - axis: stage_replica
      size: 2
      routing: round_robin   # random | round_robin | least_queue
  code2wav:
    - axis: stage_replica
      size: 2
      routing: round_robin

Per-axis fields:

  • axis (required): mesh-axis kind (tp, dp, pp, ep, stage_replica are translatable today).
  • size (required): axis degree (> 0).
  • routing (optional): stateless policy for dp / stage_replica axes (random / round_robin / least_queue). Ignored for axes whose routing is fixed (tp broadcast, pp microbatch).
  • l1_owner (optional): engine or delegated; overrides the default owner for the axis (recorded in shard_extension).
  • name (optional): a label for the spec; defaults to the axis kind.

Routing/aggregation patterns are filled in from sensible per-kind defaults so the file stays compact; the translator validates the combination.

StrategyLoadError

Bases: ValueError

Raised when a strategy file is malformed.

load_strategy_specs

load_strategy_specs(
    path: str,
) -> dict[str, list[StrategySpec]]

Load and parse a strategy file into per-role spec stacks.

parse_strategy_specs

parse_strategy_specs(
    data: Mapping[str, Any],
) -> dict[str, list[StrategySpec]]

Parse an already-loaded strategy mapping into per-role spec stacks.