gke-ai-troubleshooting-tpu-vbar-oom
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTPU Connection Failure and VBAR OOM Troubleshooting
TPU连接失败与VBAR OOM故障排查
Use this skill to systematically diagnose and prevent
segfaults and Out-Of-Memory (OOM) errors on TPU v6e nodes.
vbar_control_agent使用本技能可系统性诊断并预防TPU v6e节点上的段错误和内存不足(OOM)错误。
vbar_control_agent⚠️ Prerequisites
⚠️ 前置条件
- Cloud Logging must be enabled for the project.
- Access to the project and cluster via or equivalent tool.
gcloud
- 项目必须已启用Cloud Logging。
- 可通过或等效工具访问项目及集群。
gcloud
🔍 Diagnostic Workflow
🔍 诊断流程
Step 0: Context Acquisition & Time Window Definition
步骤0:上下文获取与时间窗口定义
Independently gather required context using available GCP/GKE tools or use the
provided placeholders:
{variable}- : The GCP Project ID (e.g.,
{project_id}).customer-ai-project-123 - : The GKE Cluster Name (e.g.,
{cluster_name}).tpu-cluster-prod - : The Node Name or Instance ID (e.g.,
{node_name}).tpu-node-1 - : The Workload Name / JobSet Name (e.g.,
{workload_name}).my-training-job-456 - : The Workload Namespace.
{namespace} - : The timestamp of the issue (e.g.,
{issue_time}).2026-04-14T20:00:00Z
使用可用的GCP/GKE工具独立收集所需上下文,或使用提供的占位符:
{variable}- :GCP项目ID(例如:
{project_id})。customer-ai-project-123 - :GKE集群名称(例如:
{cluster_name})。tpu-cluster-prod - :节点名称或实例ID(例如:
{node_name})。tpu-node-1 - :工作负载名称/JobSet名称(例如:
{workload_name})。my-training-job-456 - :工作负载命名空间。
{namespace} - :问题发生的时间戳(例如:
{issue_time})。2026-04-14T20:00:00Z
Time Handling & Execution Rules
时间处理与执行规则
- Window Calculation: If an issue timestamp is provided, calculate the query time window as
{issue_time}to[{issue_time} - 30m].[{issue_time} + 30m]- Let =
{start_time}{issue_time} - 30m - Let =
{end_time}{issue_time} + 30m
- Let
- Informational vs. Live Execution: If the user request is informational or query-formulation (e.g. "How can I check...", "How do I determine..."), or if live GCP project resources are not actively targetable, directly output the calculated time window, log names, and Cloud Logging filter templates without attempting live log execution commands.
- 窗口计算:若提供了问题时间戳,则将查询时间窗口计算为
{issue_time}至[{issue_time} - 30m]。[{issue_time} + 30m]- 令=
{start_time}{issue_time} - 30m - 令=
{end_time}{issue_time} + 30m
- 令
- 信息查询与实时执行:若用户请求为信息查询或查询公式制定(例如“我如何检查...”, “我如何确定...”),或无法直接访问实时GCP项目资源,则直接输出计算后的时间窗口、日志名称和Cloud Logging过滤模板,无需尝试执行实时日志命令。
Step 1: Check for vbar_control_agent
OOMs
vbar_control_agent步骤1:检查vbar_control_agent
OOM情况
vbar_control_agentLook for specific messages from in serial
console logs ().
out of memoryvbar_control_agentserialconsole.googleapis.com%2fserial_port_1_output- Tool to use: (for live diagnostics)
query_logs - Filter Templates:
Serial Console Logs (OOMs):
sql
logName="projects/{project_id}/logs/serialconsole.googleapis.com%2fserial_port_1_output"
AND labels."compute.googleapis.com/resource_name"="{node_name}"
AND SEARCH(text_payload, "Memory cgroup out of memory: Killed process .* (vbar_control_ag)")
AND timestamp >= "{start_time}"
AND timestamp <= "{end_time}"- Logic: Presence of messages related to
Memory cgroup out of memory. Stack traces pointing tovbar_control_agentare a strong indicator.libtpu::tpunetd::VBARControlHelper::MetricsReadFromVBAR - Automation: Proceed to next step automatically after reporting findings.
- Reference: See for example log patterns.
references/failure_signatures.md
在串行控制台日志()中查找来自的特定“out of memory”消息。
serialconsole.googleapis.com%2fserial_port_1_outputvbar_control_agent- 使用工具:(用于实时诊断)
query_logs - 过滤模板:
串行控制台日志(OOM相关):
sql
logName="projects/{project_id}/logs/serialconsole.googleapis.com%2fserial_port_1_output"
AND labels."compute.googleapis.com/resource_name"="{node_name}"
AND SEARCH(text_payload, "Memory cgroup out of memory: Killed process .* (vbar_control_ag)")
AND timestamp >= "{start_time}"
AND timestamp <= "{end_time}"- 逻辑:存在与相关的“Memory cgroup out of memory”消息。指向
vbar_control_agent的堆栈跟踪是明确的指示信号。libtpu::tpunetd::VBARControlHelper::MetricsReadFromVBAR - 自动化:报告结果后自动进入下一步。
- 参考:请参阅查看示例日志模式。
references/failure_signatures.md
Step 2: Investigate tpu-device-plugin
Metrics Fetch Failures [Low Risk]
tpu-device-plugin步骤2:排查tpu-device-plugin
指标获取失败 [低风险]
tpu-device-pluginCheck if is reporting metric fetch failures.
tpu-device-plugin- Tool to use:
query_logs - Filter Template:
sql
resource.type="k8s_container"
AND resource.labels.project_id="{project_id}"
AND resource.labels.cluster_name="{cluster_name}"
AND resource.labels.container_name="tpu-device-plugin"
AND severity=ERROR
AND textPayload:"metrics fetch failed for .* deviceID and .* device path with error: checksum didn't match with the metrics data. Corrupt data found"
AND timestamp >= "{start_time}"
AND timestamp <= "{end_time}"- Logic: Errors indicating "metrics fetch failed" with "checksum didn't match" suggest vBAR memory corruption.
- Automation: Proceed to next step automatically after reporting findings.
检查是否报告指标获取失败。
tpu-device-plugin- 使用工具:
query_logs - 过滤模板:
sql
resource.type="k8s_container"
AND resource.labels.project_id="{project_id}"
AND resource.labels.cluster_name="{cluster_name}"
AND resource.labels.container_name="tpu-device-plugin"
AND severity=ERROR
AND textPayload:"metrics fetch failed for .* deviceID and .* device path with error: checksum didn't match with the metrics data. Corrupt data found"
AND timestamp >= "{start_time}"
AND timestamp <= "{end_time}"- 逻辑:包含“metrics fetch failed”和“checksum didn't match”的错误表明vBAR内存已损坏。
- 自动化:报告结果后自动进入下一步。
Step 3: Check for Custom Metrics Collection Usage [Low Risk]
步骤3:检查自定义指标采集使用情况 [低风险]
Inspect cluster configurations, workloads, or container specs to determine if
custom TPU metrics collection mechanisms are deployed.
-
Action: Check if custom scripts or agents (e.g., using) are deployed that frequently query
libtpu.sdk.tpumonitoringfromGetHostMetrics.vBAR Control Agent -
Verification Commands:
- Kubectl Search (Inspect workload env/specs):
bashkubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"/"}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'- Log Search Filter ():
query_logs
sqlresource.type="k8s_container" AND resource.labels.project_id="{project_id}" AND resource.labels.cluster_name="{cluster_name}" AND textPayload:"libtpu.sdk.tpumonitoring" AND timestamp >= "{start_time}" AND timestamp <= "{end_time}" -
Logic: Confirmation of custom metrics collection helps confirm the race condition hypothesis.
检查集群配置、工作负载或容器规格,确定是否部署了自定义TPU指标采集机制。
-
操作:检查是否部署了自定义脚本或代理(例如使用)频繁从
libtpu.sdk.tpumonitoring查询vBAR Control Agent。GetHostMetrics -
验证命令:
- Kubectl搜索(检查工作负载环境/规格):
bashkubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"/"}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'- 日志搜索过滤():
query_logs
sqlresource.type="k8s_container" AND resource.labels.project_id="{project_id}" AND resource.labels.cluster_name="{cluster_name}" AND textPayload:"libtpu.sdk.tpumonitoring" AND timestamp >= "{start_time}" AND timestamp <= "{end_time}" -
逻辑:确认存在自定义指标采集有助于验证竞态条件假设。
🛠️ Resolution Workflow
🛠️ 解决流程
Resolution 1: Temporarily Disable Custom Metrics Collection [High Risk]
解决方案1:临时禁用自定义指标采集 [高风险]
If a custom metrics collection agent is identified, recommend disabling it.
- Action: Recommend disabling the custom metrics collector.
- Justification: Prevents reads from vBAR during device resets, stopping crashes and OOMs.
若识别到自定义指标采集代理,建议禁用它。
- 操作:建议禁用自定义指标采集器。
- 理由:避免在设备重置期间读取vBAR,从而阻止崩溃和OOM错误。
Resolution 2: Await vbar_control_agent
Resiliency Update [Low Risk]
vbar_control_agent解决方案2:等待vbar_control_agent
弹性更新 [低风险]
vbar_control_agentAdvise that a permanent fix will be available in a future GKE version.
- Action: Recommend upgrading GKE when the fix is available.
- Justification: The updated agent will be resilient to memory corruption and gracefully handle reads from unbound vBARs.
告知用户永久修复将在未来的GKE版本中提供。
- 操作:建议在修复可用时升级GKE。
- 理由:更新后的代理将能抵御内存损坏,并优雅处理未绑定vBAR的读取操作。
📋 copypaste checklist
📋 复制粘贴检查清单
- Acquire context and compute window.
[{start_time}, {end_time}] - Check for segfaults and OOMs using
vbar_control_agent.query_logs - Investigate failures using
tpu-device-plugin.query_logs - Inspect for custom metrics collection usage.
- Advise disabling custom metrics collection if applicable.
- Advise awaiting resiliency update.
- 获取上下文并计算时间窗口。
[{start_time}, {end_time}] - 使用检查
query_logs段错误和OOM情况。vbar_control_agent - 使用排查
query_logs故障。tpu-device-plugin - 检查自定义指标采集使用情况。
- 若适用,建议禁用自定义指标采集。
- 建议等待弹性更新。