gke-ai-troubleshooting-tpu-partition-overlap
Diagnose and resolve GKE TPU slice creation failures (SliceCreationFailed) caused by partition overlap conflicts where requested TPU partitions or their nodes are already used by another slice or JobSet. Use when diagnosing GKE TPU slice creation failures with SliceCreationFailed partition or node c
- 01GitHub stars
- 21.3K
- 02Installs
- New
- 03Files scanned
- 1
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 6e7c1188e18933e6… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Troubleshoot TPU slice creation failures caused by partition overlap
A dynamic slice fails to form with the status reason SliceCreationFailed when,
among other documented causes, any of its nodes are already used by another
slice. This skill confirms the failure, rules out the other documented causes,
finds the slice that uses the same nodes, and routes the fix through GKE.
Prerequisites
- Tools:
- For installing and initializing
gcloud(which covers authentication and project selection), follow Before you begin. - For installing
kubectland required plugins, follow Install kubectl and Install required plugins.
- For installing and initializing
- Cloud Billing & Project Configuration: Ensure the project has an active
Cloud Billing account. Follow
Before you begin
to initialize
gcloudand enable the Google Kubernetes Engine API (container.googleapis.com), ensure the Cloud Monitoring API (monitoring.googleapis.com) is enabled, and follow Store cluster information for kubectl to configurekubectlcluster credentials. - Required IAM Roles:
- Kubernetes Engine Viewer (
roles/container.viewer) - Monitoring Viewer (
roles/monitoring.viewer)
- Kubernetes Engine Viewer (
- Documentation:
- Use dynamic slicing with a custom scheduler (Sections: "Before you begin", "Target your node pool to belong to a block or a sub-block", "Verify the status of the nodes and the partitions", "Create a Slice custom resource", "Monitor the status of the Slice custom resource", "Delete the slice")
- Configure cluster access for kubectl (Sections: "Install kubectl", "Install required plugins", "Store cluster information for kubectl")
- Slice (Sections: "Slice status", "Slice specification")
- Schedule dynamic slices with Kueue and TAS (Sections: "Target your node pool to belong to a block or a sub-block", "Create a dynamic slice with Kueue and TAS", "Define the partition health selection", "Optimize workload scheduling with slice reuse", "Enable Slice reuse", "Enforce slice deletion per workload", "Monitor the status of the slice", "Monitor the metrics of the slice", "Clean up")
- GKE system metrics (Sections: "Kubernetes metrics")
- Monitored resource types (Sections: "k8s_node_pool")
- About GKE dynamic slicing (Sections: "Dynamic slicing configurations")
- Get support (Sections: "Before you contact support", "Recommendations for efficient 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.
Diagnostic workflow
Step 0: Collect context [Low Risk]
Collect the target parameters:
{project_id}: Google Cloud project ID{cluster_name}: GKE cluster name{location}: Cluster region or zone{slice_name}: Name of the Slice custom resource that failed to form{node_pool_name}: Name of the TPU node pool (or node pools) backing the partitions in{slice_name}, if known. If the user doesn't know{node_pool_name}, after Step 1 run the Cloud Monitoring query in Step 3 for the partition IDs in{partition_ids}and read thenode_pool_namelabel on the k8s_node_pool monitored resource.{issue_time}: Incident timestamp in RFC3339 UTC, if known. If the user doesn't know{issue_time}, use theLast Transition Time(lastTransitionTime, "A timestamp of the most recent status change" in Slice status) of theReadycondition from Step 1. By default, query Cloud Monitoring over a 60-minute window around{issue_time}.
Step 1: Confirm the SliceCreationFailed status [Low Risk]
To describe {slice_name}, follow the instructions in the section
Monitor the status of the Slice custom resource.
- In
Status>Conditions, check that theReasonof theReadycondition isSliceCreationFailed, and record itsLast Transition Time(to use as{issue_time}if needed). - Record the IDs in
Spec>Partition Idsas{partition_ids}, theTopology, and anyLabelsandAnnotationson{slice_name}. - If the
Readyreason isn'tSliceCreationFailed, this skill doesn't apply. See Slice status for what each reason means, and hand off togke-ai-troubleshooting-tpu-dynamic-slices-monitoring.
Step 2: Rule out the other documented causes [Low Risk]
Per
Create a Slice custom resource,
slice creation also fails with SliceCreationFailed when:
- The selected nodes don't exist.
- The topology doesn't match the number of partitions. A dynamic sub-slice lists
exactly one partition ID. A dynamic super-slice lists
(A × B × C) / 64partition IDs.
If either of those causes applies, hand off to
gke-ai-troubleshooting-tpu-dynamic-slices-monitoring.
Otherwise, follow
Verify the status of the nodes and the partitions
on {node_pool_name}:
- Verify that the nodes exist and carry each ID in
{partition_ids}. - On the nodes that carry
{partition_ids}, record every partition ID of every shape (4x4x4,2x4x4,2x2x4,2x2x2, and2x2x1) from thecloud.google.com/gke-tpu-partition-.*-idlabels. Per Dynamic slicing configurations, dynamic sub-slicing partitions a4x4x4sub-block into smaller topologies on the same physical node pool, so partitions of different shapes share the same nodes. - Read each partition's
cloud.google.com/gke-tpu-partition-.*-statelabel. Per Verify the status of the nodes and the partitions and Define the partition health selection, countHEALTHYpartitions andDEGRADED4x4x4partitions ("still usable for dynamic slice formation"; "Smaller topologies don't have a degraded state") as available. Partitions inUNHEALTHY("can't be used to form a slice"),UNSET, orINCOMPLETEaren't available. If a requested partition is inUNHEALTHY,UNSET, orINCOMPLETE, suggest an available partition whose nodes no other slice uses (Step 4, item 2), hand off togke-ai-troubleshooting-tpu-dynamic-slices-monitoring, or escalate to Cloud Customer Care (Step 4, item 4).
Step 3: Find the slice that uses the same nodes [Low Risk]
Per
Create a Slice custom resource,
slice creation fails with SliceCreationFailed when any nodes on the custom
resource are used by another slice. Because partitions of different shapes on
the same sub-block share nodes (see
Dynamic slicing configurations),
another slice conflicts with {slice_name} if it lists any of the partition
IDs (of any shape) recorded on {slice_name}'s nodes in Step 2.
- List the
Slicecustom resources in the cluster (as shown in Delete the slice) and describe each one following Monitor the status of the Slice custom resource to readSpec>Partition Ids,Metadata>Labels, andStatus>Conditions(Readyreason):- Treat any slice other than
{slice_name}whoseSpec>Partition Idsincludes any partition ID recorded on{slice_name}'s nodes in Step 2 (whether the exact ID in{partition_ids}or another shape's partition ID on the same nodes) as conflicting. Record its name, itsReadyreason (such asACTIVE), and whether Kueue manages it (Step 4, item 1).
- Treat any slice other than
- To check partition-to-slice associations in Cloud Monitoring (including
around
{issue_time}), query thekubernetes.io/accelerator/partition/statemetric listed in Monitor the metrics of the slice. Per Kubernetes metrics, this metric "is 1 if the partition state is detected, 0 otherwise", and its labels includepartition_id,slice_id("ID of the associated slice"), andstate("Health of the partition (e.g., HEALTHY, UNHEALTHY)"). Run the query for each{partition_id}recorded on{slice_name}'s nodes in Step 2:
kubernetes_io:accelerator_partition_state{
monitored_resource="k8s_node_pool",
cluster_name="{cluster_name}",
partition_id="{partition_id}"
}
- Read only time series whose value is
1(wherestate="HEALTHY"means the partition is healthy and functional, per Verify the status of the nodes and the partitions). - Because
Kubernetes metrics
defines
slice_idonly as "ID of the associated slice", always confirm the conflicting slice from theSlicecustom resources in the cluster rather than fromslice_idalone: list theSlicecustom resources as shown in Delete the slice, describe each one following Monitor the status of the Slice custom resource, and check which slice'sSpec>Partition Idsincludes the partition ID (or any other partition ID of any shape on the same nodes from Step 2).
- Next steps based on Step 3 results:
- Another slice uses the nodes now: Proceed to Step 4.
- No other slice uses the nodes now, but the metric (value
1) showed an associatedslice_idaround{issue_time}: The conflict may already be over. Proceed to Step 4, item 1 (to re-create or retry{slice_name}) and then Step 4, item 4. - Neither the current
Slicecustom resources nor the metric around{issue_time}shows another slice: Node overlap isn't confirmed. Hand off togke-ai-troubleshooting-tpu-dynamic-slices-monitoringor escalate to Cloud Customer Care (Step 4, item 4).
Step 4: Resolution [High Risk]
Guardrails:
- Never delete or change the other slice, or stop its workload, to free the nodes. Deleting a
Slicecustom resource starts dismantling that slice (DEACTIVATING, see Monitor the status of the Slice custom resource). The owner of that slice decides when to release it.- Never manually modify or delete
Slicecustom resources created by Kueue. Per Target your node pool to belong to a block or a sub-block, "Avoid manually modifying Slice custom resources created by Kueue."- Never change GKE-managed instance groups or VMs directly through Compute Engine, and never delete node pools to free a partition. Manage node pools and slices through GKE.
First, check whether Kueue manages {slice_name} or the conflicting slice:
- Per
Monitor the status of the slice,
when a slice is created or actively used by a workload, the slice controller
attaches the
kueue.gke.io/tpu-slice-used-by-namespaceandkueue.gke.io/tpu-slice-used-by-workloadlabels. - Per
Optimize workload scheduling with slice reuse
and
Enable Slice reuse,
when slice reuse is enabled, "Kueue marks the slice as idle at the end of a
job instead of deleting it", and "Reusable slices are named dynamically with
an
s-<topology>prefix, decoupling them from specific workload names."
Then apply the matching option:
- Wait for the conflicting slice to release the nodes and retry:
- If Kueue manages the conflicting slice (it has the
kueue.gke.io/...labels or ans-<topology>name prefix): Do not suggest deleting theSlicecustom resource directly. Point the workload owner to Clean up (deleting theJobSettriggers Kueue to delete the associatedSlicecustom resources) and, if slice reuse keeps an idles-<topology>slice allocated after a job ends, to Enforce slice deletion per workload (kueue.gke.io/tpu-enforce-slice-deletion: "true"). - If a custom scheduler or user created the conflicting slice directly: Its owner can delete it when finished, as described in Delete the slice.
- How
{slice_name}retries: Check whether{slice_name}already hasslice.gke.io/retry-on-failure: "true"inMetadata>Annotations. Per Create a Slice custom resource, when aSlicecustom resource is created with this annotation, "If the slice isn't created because of theSliceCreationFailedstatus reason, the controller will retry until the slice is successfully formed." Because the documentation only shows configuringslice.gke.io/retry-on-failure: "true"in theSlicemanifest when creating aSlicecustom resource (and doesn't state that adding the annotation to an existing slice already inSliceCreationFailedstarts a retry), if{slice_name}wasn't created by Kueue and lacks the annotation, tell the user to delete{slice_name}following Delete the slice and re-create it withslice.gke.io/retry-on-failure: "true"in its manifest following Create a Slice custom resource.
- If Kueue manages the conflicting slice (it has the
- Use available partitions whose nodes no other slice uses: If the user
manages
Slicecustom resources directly (not through Kueue) and can't wait, direct them to Verify the status of the nodes and the partitions and Create a Slice custom resource so they can pick available partitions (HEALTHYpartitions, orDEGRADED4x4x4partitions) whose nodes aren't used by any other slice (across all partition shapes on those nodes) and create theSlicecustom resource with them. - Schedule dynamic slices with Kueue and TAS instead of creating
Slicecustom resources directly: Per Target your node pool to belong to a block or a sub-block and Create a dynamic slice with Kueue and TAS, instead of creatingSlicecustom resources directly, teams can schedule GKE workloads with Kueue and Topology Aware Scheduling (TAS), where "Kueue automatically handles the creation and deletion of Slice custom resources" and admits a workload after its slice becomes active. - Verify or escalate: Repeat Step 1 following
Monitor the status of the Slice custom resource:
ACTIVE: The slice is fully formed, healthy, and ready to execute workloads.ACTIVE_DEGRADED: The slice is formed, and workloads can run, but performance might be impacted.- Still
SliceCreationFailedafter no other slice uses the nodes, orFAILED: Hand off togke-ai-troubleshooting-tpu-dynamic-slices-monitoring, or advise the user to contact Cloud Customer Care following Before you contact support and Recommendations for efficient support.
Files
1- SKILL.md
ebee0d8c6d19.0 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from google/skills8
Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model
Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run
Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be
Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate c
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry
Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.
Related ai-ml skillsscan passed
Grade or filter workflow HDF5 episodes with an OpenAI-compatible vision model. Use for visual success labels; do not use for replay, policy evaluation, or recordings without frames.
Configure LoRA and QLoRA supervised fine-tuning with current best-practice hyperparameters. Use when writing or reviewing a LoRA/QLoRA training configuration, choosing rank/alpha/target modules, or deciding between LoRA, QLoRA, and full fine-tuning.