Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)22k · #10268

gke-ai-troubleshooting-tpu-metrics-monitoring

Skill này làm gì

Skill này giúp agent AI theo dõi và khắc phục sự cố các khối lượng công việc TPU, node và node pool trên Google Kubernetes Engine (GKE). Skill dành cho các nhóm chạy huấn luyện AI trên chip TPU của Google.

Khi nào nên dùng

  • ✓Khi một tác vụ huấn luyện trên GKE TPU chạy chậm hoặc dừng, và bạn muốn biết hạ tầng có phải nguyên nhân không.
  • ✓Khi bạn cần kiểm tra mức dùng bộ nhớ TPU, thời gian bận của chip, hoặc node TPU đã sẵn sàng hay chưa.
  • ✓Khi bạn muốn đo thời gian các node pool TPU phục hồi sau bảo trì hoặc bị thu hồi.

Liên kết skill

https://github.com/google/skills/blob/main/skills/cloud/gke-ai-troubleshooting-tpu-metrics-monitoring/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/google/skills/blob/main/skills/cloud/gke-ai-troubleshooting-tpu-metrics-monitoring/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Vì sao tác vụ huấn luyện TPU của tôi trên GKE hôm nay chạy chậm hơn? Bạn có thể kiểm tra các chỉ số không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc các chỉ số hệ thống của Google Cloud bằng truy vấn chỉ số chuẩn, rồi so sánh tình trạng TPU theo thời gian để tìm chỗ vấn đề bắt đầu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

GKE TPU Metrics Monitoring Guide

This skill enables the agent to monitor GKE TPU workloads, nodes, and node pools using GKE system metrics. It helps diagnose if workload interruptions or performance issues are caused by underlying infrastructure.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-metrics-monitoring)" and append agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-metrics-monitoring) to User-Agent headers.

Step 0: Mandatory Context

Independently gather required context (such as cluster details or node pool names) using available GKE and Cloud tools, or use the provided {variable} placeholders:

  • {project_id}: The GCP Project ID.
  • {cluster_name}: The GKE Cluster Name.
  • {location}: The GKE Cluster Location (region or zone).
  • {node_name}: (Optional) The name of the specific GKE node.
  • {node_pool_name}: (Optional) The name of the GKE node pool.

Diagnostic Steps

Step 1: Verify TPU Runtime Metrics Configuration [Low Risk] [Auto]

Before analyzing runtime metrics, verify that the workload is configured to export them. This ensures the cluster and container environment are set up for automated metric scraping and visibility into accelerator health.

  • Action: Verify that the Pod specification and cluster meet the following prerequisites:
    • containerPort: 8431 exposed on the TPU container (required for Prometheus metric scraping).
    • JAX version 0.4.14 or later if using JAX (earlier versions do not export runtime metrics).
    • GKE version is 1.27.4-gke.900 or later (required for TPU runtime metric support).
    • GKE System Metrics are enabled on the cluster (required for Cloud Monitoring ingestion).

Step 2: Monitor TPU Runtime Metrics [Low Risk] [Auto]

If configured correctly, the following metrics are available in Cloud Monitoring (monitored resources k8s_node and k8s_container):

  • Container Metrics:
    • kubernetes.io/container/accelerator/duty_cycle: Percentage of time over the past sampling period (60 seconds) during which the TensorCores were actively processing on a TPU chip.
    • kubernetes.io/container/accelerator/memory_used: Amount of accelerator memory allocated in bytes.
    • kubernetes.io/container/accelerator/memory_total: Total accelerator memory in bytes.
  • Node Metrics:
    • kubernetes.io/node/accelerator/duty_cycle
    • kubernetes.io/node/accelerator/memory_used
    • kubernetes.io/node/accelerator/memory_total

Step 3: Check Node Status Condition [Low Risk] [Auto]

Query the status condition of GKE nodes (GKE version 1.32.1-gke.1357001 or later).

  • PromQL Query (Check if a specific node is Ready):
    kubernetes_io:node_status_condition{monitored_resource="k8s_node", cluster_name="{cluster_name}", node_name="{node_name}", condition="Ready", status="True"}
    
  • PromQL Query (List nodes with non-Ready conditions that are True):
    kubernetes_io:node_status_condition{monitored_resource="k8s_node", cluster_name="{cluster_name}", condition!="Ready", status="True"}
    
  • PromQL Query (List nodes that are NOT Ready):
    kubernetes_io:node_status_condition{monitored_resource="k8s_node", cluster_name="{cluster_name}", condition="Ready", status="False"}
    
  • PromQL Query (Fleet-wide node status):
    avg by (condition,status)(avg_over_time(kubernetes_io:node_status_condition{monitored_resource="k8s_node"}[5m]))
    

Step 4: Check Node Pool Status [Low Risk] [Auto]

Query the status of multi-host TPU node pools.

  • PromQL Query (Verify if a specific node pool is Running):
    kubernetes_io:node_pool_status{monitored_resource="k8s_node_pool", cluster_name="{cluster_name}", node_pool_name="{node_pool_name}", status="Running"}
    
  • PromQL Query (Monitor node pools grouped by status):
    count by (status)(count_over_time(kubernetes_io:node_pool_status{monitored_resource="k8s_node_pool"}[5m]))
    
    Possible statuses: Provisioning, Running, Error, Reconciling, Stopping.

Step 5: Check Node Pool Availability [Low Risk] [Auto]

Query if all nodes in a multi-host TPU node pool are available.

  • **Pro
Câu hỏi thường gặp

Skill này có dùng được cho GPU hoặc khối lượng GKE thông thường không?

Không. Nó dành cho khối lượng công việc TPU và nói không dùng để giám sát GKE không phải TPU.

Nó xem những chỉ số nào?

Nó xem chu kỳ hoạt động của TPU, bộ nhớ TPU, tình trạng sẵn sàng của node và tính khả dụng của node pool.

Agent cần gì để bắt đầu?

Nó cần ID dự án, tên cụm và vị trí, và có thể dùng tên node hoặc node pool nếu bạn có.

Chi tiết

Mô tả gốc của tác giả

Monitors and troubleshoots GKE TPU workloads, nodes, and node pools using GKE system metrics and PromQL. Use when monitoring TensorCore duty cycle, TPU memory, node readiness, multi-host TPU node pool availability, host maintenance or preemption interruptions, and calculating MTTR or MTBI metrics for GKE TPUs. Don't use for general non-TPU GKE workload monitoring or non-metric TPU debugging.

repo: google/skills

Độ phổ biến

Sao GitHub
22k
Vị trí xếp hạng
#10268
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự