Skip to main content

gke-ai-troubleshooting-tpu-performance-degradation

Diagnose GKE Cloud TPU training throughput drops and step-time regressions (15%+ TPU duty-cycle drop) using ML Diagnostics Workload Monitoring (`gcloud alpha mldiagnostics monitored-events` / `hypercomputecluster.googleapis.com/v1alpha`) and 1-minute Cloud Monitoring system metrics (`kubernetes.io/node/accelerator/*`). Distinguishes hardware and network fabric throttling from workload resource bottlenecks (HBM capacity, host memory, or host CPU saturation). Use when TPU training throughput or duty cycle drops without crashing pods, when `PERFORMANCE_DEGRADATION` monitored events fire, or when triaging slow multi-slice training steps. Don't use for complete multi-slice XLA execution stalls with `HANG_DETECTED` logs (use gke-ai-troubleshooting-tpu-mxla-hang) or pod eviction/interruption restarts (use gke-ai-troubleshooting-jobset-interruption).

v1.0.1New

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install google-cloud-skills-gke-ai-troubleshooting-tpu-performance-degradation
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/google-cloud-skills-gke-ai-troubleshooting-tpu-performance-degradation/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiCryptographically signed by the skills-hub.ai distributor key at publish time.
Signed
0Save

Instructions

Troubleshoot GKE TPU performance degradation with ML Diagnostics Workload Monitoring

Diagnose and mitigate Cloud TPU training throughput drops and step-time
regressions (15%+ drop in TPU duty cycle) on Google Kubernetes Engine (GKE) by
correlating ML Diagnostics Workload Monitoring MonitoredEvent analyzer
reports with 1-minute Cloud Monitoring system metrics 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-performance-degradation)"
and append agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-performance-degradation) 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,
    monitoring.googleapis.com, and hypercomputecluster.googleapis.com are
    enabled.
  • Supported workloads and GKE 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,
    as stated in
    Configure GKE for ML Diagnostics.
    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. On-demand profiling (Step 4 Path A) additionally requires the
    cluster setup described in that document.
  • 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
    • 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:
    • ML Diagnostics platform
      (Sections: "IAM permissions")
    • Configure GKE for ML Diagnostics
      (Sections: "Set up with gcloud CLI, Google Cloud console, or Terraform",
      "Manual installation", "Connection-operator")
    • Workload monitoring with ML Diagnostics
      (Sections: "Workload Monitoring and analyzers", "HBM Capacity Analyzer",
      "Host Memory Utilization Analyzer", "CPU Utilization Analyzer", "Access
      Workload Monitoring information through the API", "List all monitored
      events", "System Metrics")
    • Get started with the ML Diagnostics CLI
      (Sections: "List machine learning runs", "Monitored-events commands", "List
      profiler targets", "Capture on-demand profiler sessions")
    • Scale container resource requests and limits
      (Sections: "Identify workloads without resource requests or limits")
    • Auto-repair nodes
      (Sections: "Repair criteria", "Verify node auto-repair is enabled for a
      Standard node pool", "Enable auto-repair for an existing Standard node
      pool", "Node auto repair in TPU slice nodes")
    • Deploy TPU workloads in GKE Standard
      (Sections: "Configure auto repair for TPU slice nodes")
    • Get support
      (Sections: "Before you contact support")

Read-only rule: Run read-only diagnostic commands only. Never drain,
delete, or re-create nodes, or run any other command that changes the cluster.
Give the user any fix to apply themselves.

When you recommend a fix, link the doc section that describes it.


Analyzer routing overview

By default, Workload Monitoring treats a 15% drop in TPU duty cycle as a
performance degradation, raises a MonitoredEvent (type: PERFORMANCE_DEGRADATION), and runs its analyzers. Consult the
Workload Monitoring and analyzers
section in the official Cloud TPU documentation for the complete analyzer
definitions, detection criteria, and subsections, and route remediation by
category:

  • Category A: workload resource bottlenecks (never cordon or replace nodes):
    • When the firing analyzer (detectionState: "DETECTED") indicates a workload
      memory or host CPU capacity bottleneck (see the "HBM Capacity Analyzer",
      "Host Memory Utilization Analyzer", and "CPU Utilization Analyzer" sections
      of
      Workload monitoring with ML Diagnostics),
      route to
      Path A: Workload resource bottlenecks
      (workload optimization and profiling).
  • Category B: infrastructure and network fabric throttling (culprit nodes):
    • When the firing analyzer (detectionState: "DETECTED") indicates an
      interconnect, thermal/power throttling, memory bandwidth, or Top-of-Rack
      (ToR) network fault on specific instances (see
      Workload Monitoring and analyzers),
      route to
      Path B: Infrastructure or network fabric throttling
      (map the culprit Compute Engine instance IDs to GKE nodes, handle node
      repair through GKE, and escalate to Google Cloud Support).
  • Category C: PERFORMANCE_DEGRADATION event fired, but no analyzer reports
    detectionState: "DETECTED"
    :
    • When a PERFORMANCE_DEGRADATION event exists (as in the sample output in
      List all monitored events,
      where analyzerReports entries have detectionState: "NOT_DETECTED"),
      route to
      Path C: Event fired with no DETECTED analyzer.

Diagnostic workflow

Step 0: Collect context and set the investigation window [Low Risk]

Collect the target parameters. By default, query a 60-minute window `[T - 30m, T

  • 30m]around{issue_time}`:
  • {project_id}: Google Cloud project ID
  • {location}: Google Cloud region where the ML run and GKE cluster reside (for
    example, us-central1)
  • {cluster_name}: GKE cluster name
  • {workload_name} / {ml_run_id}: JobSet / workload name or ML Diagnostics
    run ID
  • {issue_time}: Timestamp when throughput degradation was observed (T,
    ISO-8601 UTC)
  • {start_time}: T - 30m
  • {end_time}: T + 30m

Step 1: Query ML runs and monitoredEvents [Low Risk]

  1. List active or recent ML runs: Give the user gcloud alpha mldiagnostics machine-learning-run list with a link to
    List machine learning runs
    in the ML Diagnostics CLI reference, and locate {ml_run_id} matching
    {workload_name}.
  2. List performance degradation events: Give the user gcloud alpha mldiagnostics monitored-events list with a link to
    Monitored-events commands,
    or the hypercomputecluster.googleapis.com/v1alpha API with a link to
    Access Workload Monitoring information through the API,
    to check for PERFORMANCE_DEGRADATION events during [{start_time}, {end_time}].
  3. Describe the MonitoredEvent: Give the user gcloud alpha mldiagnostics monitored-events describe with a link to the same
    Monitored-events commands
    section, and inspect the analyzerReports array (analyzer,
    detectionState, details, and recommendedActions).
    • If a PERFORMANCE_DEGRADATION event fired, run Step 2 to corroborate with
      the 1-minute system metrics; if none of its analyzerReports entries has
      detectionState: "DETECTED", follow
      Path C: Event fired with no DETECTED analyzer.
    • If no PERFORMANCE_DEGRADATION event exists and duty cycle is steady in
      Step 2, rule out TPU performance degradation by following
      Path D: Healthy telemetry.

Step 2: Correlate with 1-minute Cloud Monitoring system metrics [Low Risk]

Consult the
System Metrics
section in the Workload Monitoring documentation for the 1-minute Cloud
Monitoring metrics exported for TPU and host devices, and run read-only PromQL
queries over [{start_time}, {end_time}] to corroborate the analyzer report:

# 1. Node TPU duty cycle (look for the drop on the affected nodes)
kubernetes_io:node_accelerator_duty_cycle{
  monitored_resource="k8s_node",
  project_id="{project_id}",
  cluster_name="{cluster_name}"
}

# 2. HBM utilization ratio by node (around 0.90 is approaching the limit)
sum by (node_name) (
  kubernetes_io:node_accelerator_memory_used{
    monitored_resource="k8s_node",
    project_id="{project_id}",
    cluster_name="{cluster_name}"
  }
)
/
sum by (node_name) (
  kubernetes_io:node_accelerator_memory_total{
    monitored_resource="k8s_node",
    project_id="{project_id}",
    cluster_name="{cluster_name}"
  }
)

# 3. Host memory and CPU allocatable utilization
kubernetes_io:node_memory_allocatable_utilization{
  monitored_resource="k8s_node",
  project_id="{project_id}",
  cluster_name="{cluster_name}"
}

kubernetes_io:node_cpu_allocatable_utilization{
  monitored_resource="k8s_node",
  project_id="{project_id}",
  cluster_name="{cluster_name}"
}

Step 3: Map culprit instance IDs to GKE nodes and topology [Low Risk]

When an infrastructure analyzer reports culprit numeric Compute Engine instance
IDs in details or recommendedActions, map those numeric instance IDs to GKE
Node names and physical topology blocks using this read-only kubectl query
inspecting container.googleapis.com/instance_id:

kubectl get nodes -l cloud.google.com/gke-tpu-accelerator \
  -o jsonpath='{range .items[*]}{.metadata.name}{"\tinstance_id="}{.metadata.annotations.container\.googleapis\.com/instance_id}{"\tblock="}{.metadata.labels.cloud\.google\.com/gce-topology-block}{"\tsubblock="}{.metadata.labels.cloud\.google\.com/gce-topology-subblock}{"\thost="}{.metadata.labels.cloud\.google\.com/gce-topology-host}{"\n"}{end}'

Step 4: Remediation by analyzer category

Load and follow only the reference file that matches the analyzer category from
Step 1:

  • Path A (workload resource bottlenecks — HBM, host memory, or host CPU
    utilization)
    : Read
    Path A: Workload resource bottlenecks.
  • Path B (infrastructure, thermal, ICI, memory bandwidth, or network fabric
    throttling)
    : Read
    Path B: Infrastructure or network fabric throttling.
  • Path C (PERFORMANCE_DEGRADATION event fired with all analyzers
    NOT_DETECTED)
    : Read
    Path C: Event fired with no DETECTED analyzer.
  • Path D (no PERFORMANCE_DEGRADATION events and steady telemetry): Read
    Path D: Healthy telemetry.

Guardrails

  1. Never change GKE-managed instance groups or VMs through Compute Engine:
    Don't run gcloud compute instance-groups managed commands, such as
    delete, on a node pool's managed instance group. Handle nodes through GKE,
    as described in
    Path B: Infrastructure or network fabric throttling.
  2. Never cordon nodes for workload resource saturation: If only the HBM
    capacity, host memory, or host CPU utilization analyzers detected an issue,
    don't cordon or replace nodes.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
google-analytics-admin-api-basicsManages Google Analytics account and property settings, enables the Analytics Admin API via the Cloud CLI, lists accounts and properties, and manages data streams, custom dimensions, conversion events, and integrations. Use when you need to programmatically configure Google Analytics accounts, provision properties, manage data retention, configure Measurement Protocol secrets, or manage Firebase and Google Ads links.1 installsgke-cost-analysisAnswer natural language questions and perform analysis on GKE cluster and workload costs using BigQuery billing exports, cost allocation data, and live cluster monitoring metrics. Use when querying GKE costs across projects, namespaces, or workloads, analyzing billing reports in BigQuery (`bq`), checking cluster cost budgets (`gcloud billing`), or diagnosing cost drivers like pod requests vs. actual utilization (`kubectl top`). Don't use for applying cost optimization changes, creating rightsizing manifests (VPA/MPA), or selecting ComputeClasses (use gke-cost-optimization instead).1 installsgoogle-cloud-solution-rag-enterprise-search-gke-sqldbDiscovers requirements, and generates architectural, design, and deployment guidance for a retrieval-augmented generation (RAG)-capable enterprise search system in Google Cloud. Use when users need a vector-enabled SQL database as the store and index for the embedding vectors, an open model and open-source inferencing framework, and Kubernetes containers to host all the application components. DON'T use this skill for fully-managed RAG, or SaaS search services, or when a non-SQL vector database is required.1 installsfirebase-basicsProvides foundational Firebase CLI setup, CLI installation, version checks (`firebase-tools@latest --version`), CLI login (including --no-localhost), project creation, project selection (`firebase use`), and app config file downloads (`google-services.json`, `GoogleService-Info.plist`). Use ONLY for CLI login, project creation/switching, or downloading app config files. Don't use for Firebase Hosting deploy, Firestore, Auth, App Hosting, Data Connect, Crashlytics, or Remote Config.1 installsgoogle-cloud-storage-bucket-architectCreates Cloud Storage on Google Cloud (also known colloquially as GCS) buckets. Analyzes the workload (sensitive data, media hosting, ingestion, web hosting, archiving, backup, logging, analytics, AI/ML, or general-purpose), validates project-level security settings, and designs a secure-by-default, cost-effective configuration (location, storage class, uniform bucket-level access, public access prevention, soft delete, lifecycle) before creating it. Use whenever a user wants to create, make, set up, provision, or spin up a bucket, or needs object storage for an app, service, pipeline, or dataset — even a "simple" or "default" bucket, or when bucket creation is one step in a larger workflow. Outputs or executes the creation via gcloud, the JSON/REST API, Terraform, or SDK client libraries (C++, Java, Python, Go). Don't use for anything other than creating new buckets — for uploads, downloads, access changes, or reconfiguring existing buckets, use google-cloud-storage-basics.1 installsgoogle-cloud-waf-cost-optimizationEvaluates Google Cloud workloads for cost efficiency and FinOps alignment using the Google Cloud Well-Architected Framework Cost Optimization pillar. Use when the user asks to analyze Google Cloud spend, reduce cloud bills, rightsize resources (for example, Compute, GKE, Storage, Databases), evaluate discount options (for example, CUDs, SUDs, Spot VMs), or eliminate idle capacity. Do not use for standalone product pricing lookups or non-cost architecture design.1 installs

More from Google Cloud Skills

View source →
google-ads-api-mcp-setupGuides developers through downloading, configuring, and installing the official open-source Google Ads MCP Server. Use this skill when a user wants to connect their AI assistant (such as Gemini, Claude Code, or Cursor) to their Google Ads account to query campaigns or retrieve reporting metrics using natural language.4 installsspanner-basicsAssists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.4 installsgke-workload-securityAudits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).3 installsgke-manifest-generationGenerates and updates secure, production-ready Kubernetes YAML manifests optimized for GKE Autopilot and GKE Standard clusters. Use when creating or modifying GKE deployment manifests, configuring container security contexts, setting CPU/memory resource limits, defining readiness/liveness/startup probes, mounting secrets and volumes, configuring GKE Gateway API routes, targeting Spot VMs, or deploying AI model inference workloads (vLLM, TGI, Gemma). Don't use for live cluster operations, pod troubleshooting (use gke-workload-troubleshooting), or cluster infrastructure provisioning (use gke-cluster-creation).2 installsgke-upgradesPlans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like "we need to upgrade our clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't use for GKE cluster creation, application onboarding, general networking/routing setup, or security policy configurations (use gke-basics or relevant GK2 installsgoogle-cloud-recipe-networking-observabilityInvestigates Google Cloud networking issues by analyzing logs, metrics, and diagnostics. Use when investigating VPC Flow Logs, NAT, firewall, or threat logs, querying latency and throughput metrics, or running Connectivity Tests for path diagnostics.2 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.631 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.532 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.342 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.244 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.172 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions144 installs

Frequently asked questions about gke-ai-troubleshooting-tpu-performance-degradation

What does the gke-ai-troubleshooting-tpu-performance-degradation skill do?

Diagnose GKE Cloud TPU training throughput drops and step-time regressions (15%+ TPU duty-cycle drop) using ML Diagnostics Workload Monitoring (`gcloud alpha mldiagnostics monitored-events` / `hypercomputecluster.googleapis.com/v1alpha`) and 1-minute Cloud Monitoring system metrics (`kubernetes.io/node/accelerator/*`). Distinguishes hardware and network fabric throttling from workload resource bottlenecks (HBM capacity, host memory, or host CPU saturation). Use when TPU training throughput or duty cycle drops without crashing pods, when `PERFORMANCE_DEGRADATION` monitored events fire, or when triaging slow multi-slice training steps. Don't use for complete multi-slice XLA execution stalls with `HANG_DETECTED` logs (use gke-ai-troubleshooting-tpu-mxla-hang) or pod eviction/interruption restarts (use gke-ai-troubleshooting-jobset-interruption). It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the gke-ai-troubleshooting-tpu-performance-degradation skill?

Run `npx @skills-hub-ai/cli install google-cloud-skills-gke-ai-troubleshooting-tpu-performance-degradation` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/google-cloud-skills-gke-ai-troubleshooting-tpu-performance-degradation/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does gke-ai-troubleshooting-tpu-performance-degradation work with?

gke-ai-troubleshooting-tpu-performance-degradation runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the gke-ai-troubleshooting-tpu-performance-degradation skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use gke-ai-troubleshooting-tpu-performance-degradation after installing it?

In Claude Code, type `/google-cloud-skills-gke-ai-troubleshooting-tpu-performance-degradation` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the gke-ai-troubleshooting-tpu-performance-degradation skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.