AI Agent Debugging Guide for AIPerf on Kubernetes
This guide is written for AI coding agents (Claude, Copilot, Cursor, etc.) that need to diagnose and fix AIPerf Kubernetes benchmark issues. Every command produces machine-parseable output. Every decision point has explicit criteria. No ambiguity.
How to Use This Guide
- Start at Triage to classify the problem
- Follow the decision tree for your problem class
- Each section gives you the exact command, the JSON schema of the output, and the decision logic
- Prefer structured output where it exists —
aiperf kube preflightandaiperf kube validatetake--output json. Others do not:aiperf kube debugemits human-readable text only, and--outputonaiperf kube resultsis a destination directory, not a format.
Triage
Run this command first. It gives you everything you need to classify the problem:
Decision Tree
Branch on status.phase from the CR, then on what aiperf kube debug reports.
(The health / error_rate rollups came from the removed live-watch command;
derive the equivalent from pod state and metrics as shown below.)
Problem: Failed Job
Gather Information
Common Failure Patterns
Problem: Stuck in Pending
Pods cannot be scheduled. Get the reason:
Decision Logic
Problem: Kueue Issues
If the workload is not admitted, the queue is full. Wait for other workloads to complete, or adjust priority with spec.scheduling.priorityClass.
Problem: Stuck Initializing
Workers are starting but not all are ready yet.
Problem: Crash Loop
A pod is restarting repeatedly (>3 restarts).
Problem: OOM Kills
A pod was killed because it exceeded its memory limit.
Fixes (in priority order)
-
Reduce connections per worker — Lower
spec.connectionsPerWorker(default: 100). Each connection holds request/response buffers in memory. The field is immutable after creation, so this means recreating the AIPerfJob. -
Increase workers, reduce per-pod — Use more pods with fewer workers each. Lower
spec.benchmark.runtime.workersPerPodin the CR (the cluster-wide worker total stays--total-workers; this knob only controls how that total is fanned across pods). -
Raise the worker-pod memory budget —
AIPERF_K8S_WORKER_POD_MEMORY(default6Gi) is read by the process that renders the JobSet, so it must be set on the operator container. Putting it inspec.podTemplate.envhas no effect on container resources: -
Drop the cgroup ceiling —
spec.resourceMode: burstable(the default) sets requests without limits, so a container is not cgroup-OOM-killed for exceeding its request. Onlyguaranteedmode appliesrequests == limits. This field is also immutable after creation.
Problem: Stalled Benchmark
Running phase but no progress (0 throughput, 0 requests completed).
Problem: High Error Rate
More than 5% of requests are failing.
Collect Results
request_count counts successful requests only and error_request_count
counts failures, so the grand total is their sum. error_request_count is
omitted entirely on a clean run.
Preflight JSON Schema
Output from aiperf kube preflight -o json:
Check Statuses
Agent Decision Logic
Validate JSON Schema
Output from aiperf kube validate -o json benchmark.yaml:
Add --strict to promote those warnings to errors. The command exits 1 when
any file fails.
Quick Command Reference
Related Documentation
- Getting Started — First benchmark walkthrough
- Monitoring and Troubleshooting — Human-readable monitoring guide
- Kubernetes Configuration — All CRD fields and deployment options