Skip to content

Guide · Agent skill

How to use the GKE TPU Performance Troubleshooter agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains the GKE TPU Performance Troubleshooter, an agent skill (a folder of instructions and scripts that an AI agent such as Claude loads when a task matches it) for diagnosing Cloud TPU training jobs on Google Kubernetes Engine that have slowed down without the pods crashing. It is aimed at ML engineers running JAX training jobs on GKE TPU slices and at platform operators who triage slow multi-slice runs. By the end you will know how to install the skill, how to ask for it in plain language, what it needs from your Google Cloud project, and how to read what it reports.

GKE TPU Performance Troubleshootergoogle/skills · Apache-2.0

Quick start

  1. 1Check your Google Cloud setup. Confirm billing is linked, sign in, and set the target project using the gcloud commands listed in the prerequisites.
  2. 2Install the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  3. 3Ask in plain language. Describe the slowdown, for example a TPU duty cycle drop with no pod crashes, and mention that it is a JAX training job on GKE.
  4. 4Let the agent read the events and metrics. The agent reads ML Diagnostics monitored events and one-minute Cloud Monitoring metrics, then decides which category the cause falls into.
  5. 5Follow the matching path. For workload bottlenecks, follow the workload changes and profiling steps. For infrastructure throttling, map the flagged instances to GKE nodes with kubectl get nodes.
  6. 6Apply fixes yourself. The skill is read-only, so review each suggested fix against the linked documentation section and apply it with your own change process.

What does the skill make the agent do?

When a TPU training job drops in speed, for example when TPU duty cycle falls by 15% or more, the skill tells the agent to investigate why. It reads ML Diagnostics monitored events and one-minute Cloud Monitoring metrics, then sorts the cause into one of two groups. The first is a workload bottleneck: memory, host memory or host CPU. The second is hardware and network throttling. The agent then suggests fixes and links to the relevant documentation sections.

The skill is designed to be read-only. The agent runs diagnostic commands, and any change to the cluster is left for you to apply.

  • Workload bottlenecks: HBM capacity, host memory utilization, host CPU utilization
  • Infrastructure throttling: interconnect, thermal or power throttling, memory bandwidth, and Top-of-Rack (ToR) network faults on specific instances
  • Cases it hands off: full execution stalls with HANG_DETECTED logs, and pod eviction or restart problems

How do you install the GKE TPU troubleshooter skill?

You can install the skill in either of two ways. For Claude Code, download the skill's ZIP from this page and unzip it into ~/.claude/skills/ to make it available in all your projects, or into a project's .claude/skills/ folder to limit it to that project. In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.

After installing, the skill's folder should contain SKILL.md and a references folder with attribution.md, path-a-workload-bottlenecks.md, path-b-infrastructure-throttling.md, path-c-no-detected-analyzer.md and path-d-healthy-telemetry.md. The agent reads SKILL.md first and opens the reference files as needed.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into the project's .claude/skills/
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

What do you need before you start?

The skill runs real Google Cloud commands, so the environment has to be ready first. You need the Google Cloud SDK (gcloud) with the alpha component, which provides the gcloud alpha mldiagnostics commands, plus kubectl. Your project needs billing enabled and the container.googleapis.com, monitoring.googleapis.com and hypercomputecluster.googleapis.com APIs turned on.

For IAM, the skill names three roles: Cluster Director Editor, Monitoring Viewer and Kubernetes Engine Viewer. Kubernetes Engine Cluster Admin is only needed for the high-risk remediation steps. On the cluster side, Workload Monitoring is enabled by default for the jobset and job GKE job types, but it needs a GKE version that supports ML Diagnostics, as stated in the 'Configure GKE for ML Diagnostics' documentation. The skill only works with JAX on TPUs; PyTorch and other frameworks will not show ML runs or monitored events.

  • Google Cloud SDK (gcloud) with the alpha component, and kubectl
  • Billing enabled on the project, with GKE, Cloud Monitoring and Cluster Director APIs enabled
  • Roles: Cluster Director Editor, Monitoring Viewer, Kubernetes Engine Viewer
  • Kubernetes Engine Cluster Admin only for high-risk remediation
  • A GKE version that supports ML Diagnostics, and JAX workloads on TPUs
gcloud billing projects describe {project_id} gcloud auth login gcloud config set project {project_id}

How do you trigger the skill with a natural request?

You do not need to type a command name. Describe the symptom in plain words and mention TPUs, training speed or GKE. The skill's description lists the situations it matches: TPU training throughput or duty cycle dropping without crashing pods, PERFORMANCE_DEGRADATION monitored events firing, and slow multi-slice training steps.

If your problem is a full stall with HANG_DETECTED logs, or pods being evicted and restarted, the skill says to use other skills instead, named gke-ai-troubleshooting-tpu-mxla-hang and gke-ai-troubleshooting-jobset-interruption. Say so in your request so the agent picks the right one.

  • 'My JAX training on our GKE TPU slice got about 20% slower after the last restart. Find out why.'
  • 'Check the ML Diagnostics PERFORMANCE_DEGRADATION events for my multi-slice run.'
  • 'TPU duty cycle dropped and the pods are still running. Is it memory or the network?'

How does the agent work through a diagnosis?

The skill sorts findings into three routes. Category A covers workload resource bottlenecks, where the firing analyzer points to HBM capacity, host memory or host CPU. The agent follows Path A, which is about optimizing the workload and profiling it. Path A says never to cordon, drain or replace TPU nodes for these causes, because the documented actions are workload changes. If on-demand profiling is set up, the agent can list profiler targets and capture a profile using gcloud alpha mldiagnostics commands.

Category B covers infrastructure and network fabric throttling on specific instances. Path B asks the agent to map the reported Compute Engine instance IDs to GKE node names with kubectl get nodes, and to review the analyzer's recommended actions. Node repair goes through GKE rather than Compute Engine, and the skill points to Google Cloud Support for escalation. Category C covers a PERFORMANCE_DEGRADATION event where no analyzer reports a detection, and the reference files cover that case and a healthy-telemetry path.

kubectl get nodes

What are the safety notes for scripts and network access?

The skill runs scripts and uses the network. It calls Google Cloud through gcloud and kubectl, and it reads monitored events and Cloud Monitoring metrics. Its written rule is read-only: run diagnostic commands only, never drain, delete or re-create nodes, and never run any command that changes the cluster. Fixes are given to you to apply yourself.

The skill also asks the agent to tag every gcloud command it runs in the terminal with an attribution variable that names only the skill and its version. The tag is set inline on each command, not through gcloud config set, so it does not persist. Review commands before you approve them, and use an account whose roles match what you intend to allow.

  • Read-only by rule; remediation is yours to apply
  • High-risk steps need Kubernetes Engine Cluster Admin
  • Commands are tagged inline for usage attribution, per references/attribution.md
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-performance-degradation)" \ gcloud <command> [flags]

What people use it for

  • Finding out why a JAX training job on a GKE TPU slice runs slower after a change, without the pods crashing.
  • Triaging PERFORMANCE_DEGRADATION events from ML Diagnostics for a multi-slice training run.
  • Deciding whether a duty-cycle drop comes from host memory or CPU pressure in the workload, or from a faulty node or network path.
  • Collecting the read-only evidence an operator needs before contacting Google Cloud Support.

Frequently asked questions

How do I install the GKE TPU Performance Troubleshooter skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for one project. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

What do I need to run this skill?

You need the Google Cloud SDK with the alpha component, kubectl, a project with billing enabled, and the GKE, Cloud Monitoring and Cluster Director APIs enabled. You also need the Cluster Director Editor, Monitoring Viewer and Kubernetes Engine Viewer roles, plus a GKE version that supports ML Diagnostics.

Is the skill free to use?

The source material does not state pricing or licence terms for the skill beyond its licence, which is Apache-2.0. Google Cloud resources used by the commands, such as TPUs and monitoring, are billed under your own project.

Does it work with PyTorch?

No. ML Diagnostics supports only JAX on TPUs, so it will not list ML runs or monitored events for PyTorch or other frameworks.

Will the skill change my cluster or restart my nodes?

No, by its written rule it runs read-only diagnostic commands and never drains, deletes or re-creates nodes. It gives you the fixes to apply yourself.

What should I use if my job is stalled or pods keep restarting?

The skill says not to use it for full XLA execution stalls with HANG_DETECTED logs or for pod eviction and restart problems. Use the gke-ai-troubleshooting-tpu-mxla-hang skill for stalls and gke-ai-troubleshooting-jobset-interruption for restarts.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits ML engineers running JAX training on GKE TPU slices who see step times regress, and operators triaging slow multi-slice runs with ML Diagnostics enabled. It is a poor fit for PyTorch workloads, full execution stalls, or clusters without ML Diagnostics, where it will not produce data and you should use the skills it names instead.

Download the skill