XPU CI Health Check Skill
This skill automates XPU CI health checks with the following workflow:
- Collect failure evidence automatically by running the bundled script.
- Analyze the root cause of each case yourself (AI), using the traceback
evidence plus the suspect commit/PR — never copy the raw exception as the
conclusion.
- Render the result generate a list with one row per failing case.
Root cause analysis is YOUR job, not the script's. The script only gathers evidence
(case id, traceback excerpt, commit sha, disable link). You must reason about
why it failed and which change likely caused it.
Prerequisites
- GitHub token: Optional. The script uses the
gh CLI if --token is not provided; ensure gh auth login is configured.
Step 1 — Collect evidence (always run this first)
Run the bundled collection script from the PyTorch repository root. The script
is located at <path/to/skills>/xpu-ci-health-check/scripts/collect_failures.py
(included in this skill).
# Run from PyTorch repository root
cd /path/to/pytorch # or your PyTorch clone location
python </path/to/skills>/xpu-ci-health-check/scripts/collect_failures.py --run-limit 1
Flags
--run-limit N — Inspect the last N completed main runs (default: 1).
--token — GitHub API token. If omitted, the script falls back to gh CLI auth.
The script prints a JSON evidence bundle to stdout:
{
"runs": [{ "run_number": 9275, "head_sha": "5ef6fae…", "html_url": "…" }],
"cases": [
{
"case_id": "test/inductor/test_cutlass_backend.py::TestCutlassBackend::test_xxx",
"commit_sha": "5ef6fae…",
"commit_short": "5ef6fae",
"hud_url": "https://hud.pytorch.org/pytorch/pytorch/commit/5ef6fae…",
"commit_url": "https://github.com/pytorch/pytorch/commit/5ef6fae…",
"job_name": "linux-jammy-xpu-… / test (default, …)",
"failure_line": "… FAILED …",
"error_excerpt": "…traceback / exception text…",
"issue_title": "DISABLED test_xxx (__main__.TestCutlassBackend)",
"issue_body": "Platforms: xpu\n\nThis test was disabled because…\n\ncc …",
"issue_labels": ["module: xpu", "triaged"],
"issue_url": "https://github.com/pytorch/pytorch/issues/new?title=DISABLED%20…&body=…&labels=module%3A%20xpu,triaged"
}
]
}
Disable issue template is frozen in the script. The issue_title,
issue_body, issue_labels, and issue_url fields are produced by
build_disable_issue() inside scripts/collect_failures.py, aligned with the
reference issue template https://github.com/pytorch/pytorch/issues/185907
(Platforms line + "recent examples" section + cc mention + labels module: xpu,
triaged). When creating an issue, use these exact fields verbatim — never
rewrite the title, body, or labels.
Step 2 — Analyze the root cause (AI analysis required)
If the number of failed cases > 10, skip this step and let the root cause field be empty.
For each case in cases, use subagent to do:
Fetch latest origin main and git checkout to the commit_sha locally.
Identify the real failure: Read error_excerpt and identify the failing frame
and exception type (e.g., InductorError: NotImplementedError: ), not just the surface FAILED line.
Root cause:
- Determine regression status of the case:
- Newly added or updated case →
No
- Existing old case (appeared before) →
Yes
- Insufficient evidence →
Unknown (explain why)
- Find the code change that cause the case failure and also the guilty commit/PR.
- Analysis the root cause.
- Write root cause in a strict 3-point structure (do not omit any point):
- Introduced by which PR: Identify the most likely PR/commit that introduced the failure. If uncertain, state the top suspect and what evidence is missing.
- Root cause of the failure: Explain the concrete failing mechanism on XPU using evidence from traceback/logs.
- Is this fail only on XPU: try to analysis if cuda will fails, if no evidence is available, state that explicitly.
- Use available history (recent runs, torch-ci failure history, prior reports).
Step 3 — Render output
Produce a list these details, one row per case:
List the details for each case as follows:
- Commit:
`<commit_short>` linked to HUD (e.g., [5ef6fae](https://hud.pytorch.org/...)).
- Case: The
case_id from the evidence bundle.
- Is regression:
Yes / No / Unknown (see Step 2.4; No = newly appeared).
- Root cause: Both required points from Step 2 (introduced PR + why XPU fails mechanism).
- Disable link:
[Create disable issue](<issue_url>).
- IMPORTANT: Use
issue_url exactly as produced by the script — do not truncate.
- The full URL carries prefilled title, body (Platforms + recent examples + cc), and
labels (
module: xpu, triaged).
- A URL with only
?title=... is invalid and will not match the template.
After the list, add a one-line health summary:
- Whether
main is green or red for ciflow/xpu.
- The run number(s) and count of failing cases inspected.
Important Notes
- Zero failures: If the script returns no cases, report that
main is green for
the inspected run(s). Do not fabricate failures.
- No auto-creation: Disable links are drafts only. A human must review and approve
before creating issues.
- Template reference: The frozen template follows
https://github.com/pytorch/pytorch/issues/185907 exactly (Platforms + recent examples +
cc + labels).
1---2name: xpu-ci-health-check3description: Check PyTorch ciflow/xpu (xpu.yml) on the main branch, collect the failing XPU test cases from the most recent completed run(s), analyze the ROOT CAUSE of each failure with AI, and produce a list with a prefilled "disable issue" link per case. USE WHEN the user asks to check XPU CI health, find failing XPU tests, or generate XPU disable-issue drafts.4---56# XPU CI Health Check Skill78This skill automates XPU CI health checks with the following workflow:9101. **Collect** failure evidence automatically by running the bundled script.112. **Analyze** the root cause of each case yourself (AI), using the traceback12 evidence plus the suspect commit/PR — never copy the raw exception as the13 conclusion.143. **Render the result** generate a list with one row per failing case.1516> Root cause analysis is YOUR job, not the script's. The script only gathers evidence17> (case id, traceback excerpt, commit sha, disable link). You must reason about18> *why* it failed and *which change* likely caused it.1920## Prerequisites2122- **GitHub token**: Optional. The script uses the `gh` CLI if `--token` is not provided; ensure `gh auth login` is configured.2324## Step 1 — Collect evidence (always run this first)2526Run the bundled collection script from the PyTorch repository root. The script27is located at `<path/to/skills>/xpu-ci-health-check/scripts/collect_failures.py`28(included in this skill).2930```bash31# Run from PyTorch repository root32cd /path/to/pytorch # or your PyTorch clone location33python </path/to/skills>/xpu-ci-health-check/scripts/collect_failures.py --run-limit 134```353637### Flags3839- `--run-limit N` — Inspect the last N completed `main` runs (default: `1`).40- `--token` — GitHub API token. If omitted, the script falls back to `gh` CLI auth.4142The script prints a JSON evidence bundle to stdout:4344```jsonc45{46 "runs": [{ "run_number": 9275, "head_sha": "5ef6fae…", "html_url": "…" }],47 "cases": [48 {49 "case_id": "test/inductor/test_cutlass_backend.py::TestCutlassBackend::test_xxx",50 "commit_sha": "5ef6fae…",51 "commit_short": "5ef6fae",52 "hud_url": "https://hud.pytorch.org/pytorch/pytorch/commit/5ef6fae…",53 "commit_url": "https://github.com/pytorch/pytorch/commit/5ef6fae…",54 "job_name": "linux-jammy-xpu-… / test (default, …)",55 "failure_line": "… FAILED …",56 "error_excerpt": "…traceback / exception text…",57 "issue_title": "DISABLED test_xxx (__main__.TestCutlassBackend)",58 "issue_body": "Platforms: xpu\n\nThis test was disabled because…\n\ncc …",59 "issue_labels": ["module: xpu", "triaged"],60 "issue_url": "https://github.com/pytorch/pytorch/issues/new?title=DISABLED%20…&body=…&labels=module%3A%20xpu,triaged"61 }62 ]63}64```6566> **Disable issue template is frozen in the script.** The `issue_title`,67> `issue_body`, `issue_labels`, and `issue_url` fields are produced by68> `build_disable_issue()` inside `scripts/collect_failures.py`, aligned with the69> reference issue template https://github.com/pytorch/pytorch/issues/18590770> (Platforms line + "recent examples" section + cc mention + labels `module: xpu`,71> `triaged`). **When creating an issue, use these exact fields verbatim — never72> rewrite the title, body, or labels.**737475## Step 2 — Analyze the root cause (AI analysis required)7677If the number of failed cases > 10, skip this step and let the root cause field be empty.78For each case in `cases`, use subagent to do:79801. Fetch latest origin main and git checkout to the `commit_sha` locally.812. **Identify the real failure**: Read `error_excerpt` and identify the failing frame82 and exception type (e.g., `InductorError: NotImplementedError: `), not just the surface `FAILED` line.83843. Root cause:85 - Determine regression status of the case:86 - **Newly added or updated case** → `No`87 - **Existing old case** (appeared before) → `Yes`88 - **Insufficient evidence** → `Unknown` (explain why)89 - Find the code change that cause the case failure and also the guilty commit/PR.90 - Analysis the root cause.91 - **Write root cause** in a strict 3-point structure (do not omit any point):92 - **Introduced by which PR**: Identify the most likely PR/commit that introduced the failure. If uncertain, state the top suspect and what evidence is missing.93 - **Root cause of the failure**: Explain the concrete failing mechanism on XPU using evidence from traceback/logs.94 - **Is this fail only on XPU**: try to analysis if cuda will fails, if no evidence is available, state that explicitly.95 - Use available history (recent runs, torch-ci failure history, prior reports).9697## Step 3 — Render output9899Produce a list these details, one row per case:100101### List the details for each case as follows:102103- **Commit**: `` `<commit_short>` `` linked to HUD (e.g., `[5ef6fae](https://hud.pytorch.org/...)`).104- **Case**: The `case_id` from the evidence bundle.105- **Is regression**: `Yes` / `No` / `Unknown` (see Step 2.4; `No` = newly appeared).106- **Root cause**: Both required points from Step 2 (introduced PR + why XPU fails mechanism).107- **Disable link**: `[Create disable issue](<issue_url>)`.108 - **IMPORTANT**: Use `issue_url` **exactly as produced by the script** — do not truncate.109 - The full URL carries prefilled title, body (Platforms + recent examples + cc), and110 labels (`module: xpu`, `triaged`).111 - A URL with only `?title=...` is **invalid** and will not match the template.112113After the list, add a one-line health summary:114- Whether `main` is green or red for `ciflow/xpu`.115- The run number(s) and count of failing cases inspected.116117118119## Important Notes120121- **Zero failures**: If the script returns no cases, report that `main` is **green** for122 the inspected run(s). Do not fabricate failures.123- **No auto-creation**: Disable links are drafts only. A human must review and approve124 before creating issues.125- **Template reference**: The frozen template follows126 https://github.com/pytorch/pytorch/issues/185907 exactly (Platforms + recent examples +127 cc + labels).