跳到正文
Skillpedia
部署与云(DevOps)22k · #10269

gke-ai-troubleshooting-tpu-mxla-hang

它能做什么

这项技能帮助 AI 智能体诊断 GKE 上 Cloud TPU 多切片任务的训练挂起问题。适合训练运行停止进展、却没有明确错误的机器学习工程师。

适用场景

  • ✓当多切片 TPU 训练任务停止进展,且日志显示 HANG_DETECTED 时。
  • ✓当 ML Diagnostics 对某个 GKE TPU 任务显示挂起监控事件时。
  • ✓当你需要判断卡住是来自编译器启动差异,还是数据输入过慢时。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/google/skills/blob/main/skills/cloud/gke-ai-troubleshooting-tpu-mxla-hang/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的多切片 TPU 训练任务已经停止运行,日志中提到了挂起。是哪里出了问题?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会读取挂起日志和 Hang Analyzer 报告,然后将它们与 1 分钟粒度的多切片延迟指标和节点标签进行比较,以缩小原因范围。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Troubleshoot GKE TPU multi-slice hangs with the MXLA Hang Analyzer

Diagnose Cloud TPU multi-slice training hangs on Google Kubernetes Engine (GKE) by correlating Megascale HANG_DETECTED logs and ML Diagnostics Workload Monitoring Megascale XLA (MXLA) Hang Analyzer reports with 1-minute multi-slice latency metrics (kubernetes.io/container/multislice/*) and GKE node topology labels.


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-mxla-hang)" and append agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-mxla-hang) to User-Agent headers.

Prerequisites

  • Tools: Install the Google Cloud SDK (gcloud with alpha component for gcloud alpha mldiagnostics) and kubectl.
  • Cloud Billing & Project Configuration: Verify an active billing account is linked (gcloud billing projects describe {project_id}), authenticate (gcloud auth login), set the target project (gcloud config set project {project_id}), and ensure container.googleapis.com, logging.googleapis.com, monitoring.googleapis.com, and hypercomputecluster.googleapis.com are enabled.
  • Supported workloads and versions: Google Cloud ML Diagnostics only supports JAX on TPUs (see ML Diagnostics platform). Workload Monitoring is enabled by default, supports the jobset and job GKE job types, and is compatible with GKE versions 1.36.0-gke.4681000 and later (Configure GKE for ML Diagnostics, which also covers the cluster setup needed for on-demand profiling in Step 4 Path B). If a workload uses another framework (such as PyTorch) or another custom resource type, gcloud alpha mldiagnostics won't list ML runs or monitored events for it. The Megascale XLA hang analyzer and Megascale XLA metrics require LibTPU 0.40.0 or later (see "Get started" in Workload monitoring with ML Diagnostics).
  • Required IAM Roles:
    • Cluster Director Editor (roles/hypercomputecluster.editor), the role listed in the "IAM permissions" section of ML Diagnostics platform, for the ML Diagnostics CLI and API calls in this skill (ML runs, monitored events, and on-demand profiler sessions)
    • Monitoring Viewer (roles/monitoring.viewer) for the PromQL queries in Step 2
    • Logs Viewer (roles/logging.viewer) for the Cloud Logging query in Step 1
    • Kubernetes Engine Viewer (roles/container.viewer) for the kubectl get nodes query in Step 3
    • For remediation ([High Risk] steps): Kubernetes Engine Cluster Admin (roles/container.clusterAdmin)
  • Reference Documentation:
常见问题

什么是多切片任务?

它是一种跨多个 TPU 切片运行的训练任务。

它需要安装特殊工具吗?

需要。它需要带有 alpha 组件的 Google Cloud SDK、kubectl,以及为项目设置好的计费和 API 访问。

它会替我修复挂起吗?

这项技能侧重于诊断。它会指出可能的原因,以便你决定下一步怎么做。

详情

作者的原始描述

Diagnose GKE Cloud TPU multi-slice training hangs (Megascale `HANG_DETECTED` logs and hang monitored events) using the ML Diagnostics `Megascale XLA (MXLA) Hang Analyzer` (`gcloud alpha mldiagnostics monitored-events`) and 1-minute Cloud Monitoring multi-slice latency metrics (`kubernetes.io/container/multislice/*`). Distinguishes XLA compiler/HLO launch divergence and host data-input stalls from TPU chip, SparseCore, ICI, or network fabric faults. Use when multi-slice TPU training jobs freeze without progressing steps, emit `HANG_DETECTED`, or stall in collective operations. Don't use for gra

repo: google/skills

热度

GitHub 星标
22k
排名
#10269
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能