Skip to content
Skillpedia
Deploy & cloud (DevOps)22k · #10269

gke-ai-troubleshooting-tpu-mxla-hang

What it does

This skill helps an AI agent diagnose training hangs in Cloud TPU multi-slice jobs on GKE. It is for ML engineers whose training runs stop moving without a clear error.

When to use it

  • ✓When a multi-slice TPU training job stops making progress and the logs show HANG_DETECTED.
  • ✓When ML Diagnostics shows a hang monitored event for a GKE TPU job.
  • ✓When you need to tell whether a freeze comes from compiler launch differences or slow data input.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/gke-ai-troubleshooting-tpu-mxla-hang/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“My TPU training job across several slices has stopped moving and the logs mention a hang. What is wrong?”

5 new skills a week. 1 minute to read.

How it works

The agent reads the hang logs and the Hang Analyzer report, then compares them with 1-minute multi-slice latency metrics and node labels to narrow down the cause.

Technical content (original SKILL.md)

Original text by the author, straight from 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:
FAQ

What is a multi-slice job?

It is a training job that runs across more than one TPU slice.

Does it need special tools installed?

Yes. It needs the Google Cloud SDK with the alpha component, kubectl, and billing and API access set up for the project.

Does it fix the hang for me?

The skill focuses on diagnosis. It points to the likely cause so you can decide what to do next.

Details

Original description by the author

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

Popularity

GitHub stars
22k
Ranking position
#10269
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills