llm-d

本文說明 Google Kubernetes Engine 部署作業如何使用 Google Cloud Managed Service for Prometheus,從 llm-d 收集指標。llm-d 包含 llm-d 路由器 (端點挑選器,以獨立模式或閘道模式搭配 GKE Gateway 部署) 和模型伺服器 (例如 vLLM)。

如要瞭解如何從 llm-d Router 和 vLLM 收集指標,請參閱下列資源:

  • llm-d 路由器 (EPP):使用 llm-d Helm 圖表部署路由器時,請加入 monitoring-gke.values.yaml 方案 (router.monitoring.provider.name=gmp 和 router.monitoring.prometheus.enabled=true),在工作負載命名空間中自動建立 PodMonitoring 資源和指標讀取器 Secret。如要瞭解獨立 GKE Inference Gateway 部署作業,或 llm-d 0.8.0 以下版本,請參閱「 GKE Inference Gateway」。
  • vLLM:啟用 自動應用程式監控,或使用本文所述的 PodMonitoring 設定,對應預填/解碼 (P/D) 分解的 llm-d.ai/role Pod 標籤。

只有在搭配 Managed Service for Prometheus 使用 代管收集時,才適用這些文件中的操作說明。如果您使用自行部署的收集功能,請參閱 llm-d 說明文件。

設定 llm-d Router 和 vLLM 後,您可以在 Cloud Monitoring 中存取預先定義的資訊主頁,查看指標。

必要條件

如要使用 Managed Service for Prometheus 和代管收集功能,從 llm-d 收集指標,部署作業必須符合下列規定:

  • 叢集必須執行 Google Kubernetes Engine 1.28.15-gke.2475000 以上版本。
  • 您必須執行 Managed Service for Prometheus,並啟用代管收集功能。詳情請參閱「 開始使用代管集合」一文。

如要依 llm-d.ai/role Pod 標籤 (例如預填/解碼分解中的 prefill 和 decode) 分組 vLLM 指標,請在工作負載命名空間中套用下列 PodMonitoring 資源:

apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
  name: llm-d-metrics
spec:
  selector:
    matchLabels:
      llm-d.ai/InferenceServing: "true"
  endpoints:
  - port: 8000
    interval: 15s
    path: /metrics
  targetLabels:
    fromPod:
    - from: llm-d.ai/role
      to: role
    metadata:
    - pod
    - container
    - node
    - top_level_controller_name
    - top_level_controller_type

查看資訊主頁

Cloud Monitoring 整合功能包含下列統合資訊主頁,適用於獨立模式和閘道模式 (如果 llm-d Proxy 使用 GKE Inference Gateway,系統會填入「Application Load Balancer」部分):

  • llm-d 總覽:適用於 llm-d v0.8.0 以上版本 (查詢 llm_d_epp_* EPP 指標,以及應用程式負載平衡器、GPU 網路和 vLLM 指標)。
  • llm-d 總覽 (< v0.8.0):適用於 v0.8.0 以下版本的 llm-d (查詢 inference_objective_* 指標)。

設定整合作業後,系統會自動安裝資訊主頁。您也可以查看資訊主頁的靜態預覽畫面,不必安裝整合項目。

如要查看已安裝的資訊主頁,請按照下列步驟操作:

  1. 在 Google Cloud 控制台中,前往「Dashboards」(資訊主頁) 頁面:

    前往「Dashboards」(資訊主頁)

    如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果。

  2. 選取「Dashboard List」(資訊主頁清單) 分頁標籤。
  3. 選擇「整合」類別。
  4. 按一下要查看的資訊主頁名稱。

如要查看資訊主頁的靜態預覽畫面,請按照下列步驟操作:

  1. 在 Google Cloud 控制台中,前往「Integrations」(整合) 頁面:

    前往「Integrations」

    如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果。

  2. 按一下「Kubernetes Engine」部署平台篩選器。
  3. 找出 llm-d 整合項目,然後按一下「查看詳細資料」。
  4. 選取「資訊主頁」分頁標籤。