Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions vllm/distributed/ec_transfer/ec_connector/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ def build_connector_worker_meta(self) -> ECConnectorWorkerMetadata | None:
return None

def get_ec_connector_stats(self) -> "ECConnectorStats | None":
"""
Get the EC connector stats collected during the last interval.
"""Get the EC connector stats collected during the last interval.

Callable on either a worker-side or scheduler-side connector
instance: the worker-side instance reports stats gathered during
Expand Down Expand Up @@ -358,8 +357,7 @@ def has_pending_push_work(self) -> bool:
def build_ec_connector_stats(
cls, data: dict[str, Any] | None = None
) -> "ECConnectorStats | None":
"""
ECConnectorStats resolution method. This method allows dynamically
"""ECConnectorStats resolution method. This method allows dynamically
registered connectors to return their own ECConnectorStats object,
which can implement custom aggregation logic on the data dict.
"""
Expand All @@ -373,8 +371,7 @@ def build_prom_metrics(
labelnames: list[str],
per_engine_labelvalues: dict[int, list[object]],
) -> "ECConnectorPromMetrics | None":
"""
Create an ECConnectorPromMetrics subclass which should register
"""Create an ECConnectorPromMetrics subclass which should register
per-connector Prometheus metrics and implement observe() to
expose connector transfer stats via Prometheus.
"""
Expand Down
19 changes: 6 additions & 13 deletions vllm/distributed/ec_transfer/ec_connector/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

@dataclass
class ECConnectorStats:
"""
Base class for EC Connector Stats, a container for transfer performance
"""Base class for EC Connector Stats, a container for transfer performance
metrics or otherwise important telemetry from the connector.
All sub-classes need to be serializable as stats are sent from worker to
logger process.
Expand All @@ -31,14 +30,11 @@ def reset(self):
raise NotImplementedError

def aggregate(self, other: "ECConnectorStats") -> "ECConnectorStats":
"""
Aggregate stats with another `ECConnectorStats` object.
"""
"""Aggregate stats with another `ECConnectorStats` object."""
raise NotImplementedError

def reduce(self) -> dict[str, int | float]:
"""
Reduce the observations collected during a time interval to one or
"""Reduce the observations collected during a time interval to one or
more representative values (eg avg/median/sum of the series).
This is meant to be called by the logger to produce a summary of the
stats for the last time interval.
Expand Down Expand Up @@ -107,8 +103,7 @@ def log(self, log_fn=logger.info):


class ECConnectorPromMetrics:
"""
A base class for per-connector Prometheus metric registration
"""A base class for per-connector Prometheus metric registration
and recording.
"""

Expand All @@ -127,8 +122,7 @@ def __init__(
self.per_engine_labelvalues = per_engine_labelvalues

def observe(self, transfer_stats_data: dict[str, Any], engine_idx: int = 0):
"""
Record the supplied transfer statistics to Prometheus metrics. These
"""Record the supplied transfer statistics to Prometheus metrics. These
statistics are engine-specific, and should be recorded to a metric
with the appropriate 'engine' label. These metric instances can be
created using the create_metric_per_engine() helper method.
Expand All @@ -137,8 +131,7 @@ def observe(self, transfer_stats_data: dict[str, Any], engine_idx: int = 0):


class ECConnectorProm:
"""
Support for registering per-connector Prometheus metrics, and
"""Support for registering per-connector Prometheus metrics, and
recording transfer statistics to those metrics. Uses
ECConnectorBase.build_prom_metrics().
"""
Expand Down
Loading