From f496efbef14f1ef9344c8deefc383a295ce95004 Mon Sep 17 00:00:00 2001 From: sumingZero <469434916@qq.com> Date: Mon, 1 Dec 2025 00:49:23 -0800 Subject: [PATCH] [bugfix] The Metrics module uses a non-existent variable self.rank --- examples/ucm_config_example.yaml | 3 ++- ucm/integration/vllm/ucm_connector.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/ucm_config_example.yaml b/examples/ucm_config_example.yaml index e9189941..32c357e1 100644 --- a/examples/ucm_config_example.yaml +++ b/examples/ucm_config_example.yaml @@ -16,7 +16,8 @@ ucm_connectors: load_only_first_rank: false -metrics_config_path: "/vllm-workspace/metrics_config.yaml" +# Enable UCM metrics so they can be monitored online via Grafana and Prometheus. +# metrics_config_path: "/workspace/unified-cache-management/examples/metrics/metrics_configs.yaml" # Sparse attention configuration # Format 1: Dictionary format (for methods like ESA, KvComp) diff --git a/ucm/integration/vllm/ucm_connector.py b/ucm/integration/vllm/ucm_connector.py index c2515883..b3dc60c4 100644 --- a/ucm/integration/vllm/ucm_connector.py +++ b/ucm/integration/vllm/ucm_connector.py @@ -174,7 +174,7 @@ def __init__(self, vllm_config: "VllmConfig", role: KVConnectorRole): if self.metrics_config: self.stats_logger = UCMStatsLogger( vllm_config.model_config.served_model_name, - self.rank, + self.global_rank, self.metrics_config, ) self.monitor = ucmmonitor.StatsMonitor.get_instance()