Skip to content

vllm.distributed.ec_transfer.ec_connector.utils

EC connector helper utilities.

Classes:

Functions:

ECOutputAggregator

Merge every worker's EC connector output onto the single ModelRunnerOutput that reaches the scheduler.

Mirrors KVOutputAggregator: only output_rank's output is returned to the scheduler, but the EC connector may have run on any rank.

PlaceholderMetadataResolver

Resolves which processed keys a model needs published per modality.

Reads MultiModalDataParser.embedding_fields, the same declaration the consumer's parser requires, so the two cannot drift. An empty set means the modality cannot be delivered out of band, and the consumer will process the media itself.

Methods:

has_encoder_input(feature)

Whether feature carries something the encoder can run on.

False for an item with only placeholder metadata (e.g. the grid of a metadata-only image_embeds part): its embedding exists only in the EC store, so encoding it locally has nothing to work with.

collect_ec_item_metadata(mm_features, resolver)

Build one ec_transfer_params entry per feature for request_finished().

Keyed by mm_hash, each entry carries a metadata dict with whatever placeholder fields resolver says this model needs published for its modality, so a consumer can skip media preprocessing. item_indices identifies every occurrence in mm_features, including repeated hashes. Audio token counts come from the placeholder; other metadata requires data and falls back to raw media when it is unavailable on cache hits. A connector that also has transfer coordinates to report (e.g. NIXL peer_host/peer_port/size_bytes) merges those in alongside metadata, not into it.