Agent skill

Pt2 Bug Basher

by pytorch in pytorch/pytorch

Debug PyTorch 2 compiler stack failures including Dynamo graph breaks, Inductor codegen errors, AOTAutograd crashes, and accuracy mismatches.

Custom licenceAuto-check passedAI & LLM Engineering

Install Pt2 Bug Basher

skills CLI
$ npx skills add pytorch/pytorch --skill pt2-bug-basher -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pytorch/pytorch pt2-bug-basher --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pytorch/pytorch.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/pt2-bug-basher .claude/skills/pt2-bug-basher && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pt2-bug-basher
GitHub stars
104k
Token cost
~3.5k tokens
SKILL.md length
1,427 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
Custom licence

At a glance

Debug PyTorch 2 compiler stack failures including Dynamo graph breaks, Inductor codegen errors, AOTAutograd crashes, and accuracy mismatches.

  • Works in 12 steps: Environment check -- Ask the user which… → Reproduce -- Get a consistent… → Minimize -- Reduce the repro to the… → …
  • Encountering torch.compile errors
  • SKILL.md covers Workflow Summary, Investigation Strategy, Gathering Information and Error Triage, plus 3 more sections
  • Calls python and pytest

What it does

Pt2 Bug Basher is an agent skill from pytorch/pytorch. Debug PyTorch 2 compiler stack failures including Dynamo graph breaks, Inductor codegen errors, AOTAutograd crashes, and accuracy mismatches. Use when encountering torch.compile errors, BackendCompilerFailed exceptions, recompilation issues, Triton kernel failures, FX graph problems, or when the user mentions debugging PT2, Dynamo, Inductor, or compiled model issues.

Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Deep learning, GPU and accelerator computing and Project scaffolding. It works with PyTorch. The repository describes itself as: Tensors and Dynamic neural networks in Python with strong GPU acceleration.

When your agent uses it

  • Encountering torch.compile errors
  • BackendCompilerFailed exceptions
  • Recompilation issues
  • Triton kernel failures

Example prompts

  • “/pt2-bug-basher”

Requirements

  • Python 3

Workflow steps

12 steps, taken from the first numbered list in SKILL.md.

  1. Environment check -- Ask the user which conda environment to use. Verify it is active by checking $CONDA_DEFAULT_ENV. Then run python -c…
  2. Reproduce -- Get a consistent reproduction of the failure
  3. Minimize -- Reduce the repro to the smallest possible standalone case. Strip away unrelated model logic, use minimal tensor shapes, and…
  4. Add a unit test -- Do this BEFORE diving into code search or root cause investigation. Add a failing test to the codebase that captures…
  5. Validate on main -- Use EnterWorktree to create a worktree checked out at main. Copy the new test file into the worktree and run the test…
  6. Gather logs -- Run with appropriate TORCH_LOGS settings
  7. Classify -- Use the Error Triage table to identify the category
  8. Inspect artifacts -- Check FX graphs, IR, and generated code via TORCH_COMPILE_DEBUG=1
  9. Identify root cause -- Trace from the error back through the compilation pipeline
  10. Fix -- Apply the fix
  11. Verify -- Run the new unit test AND nearby related existing tests (e.g., if you changed how is_exporting works, also run the existing…
  12. Self-review -- Use the /pr-review skill to review your own changes before presenting them. Fix any issues it flags.

What it can do on your machine

Read from SKILL.md and the folder at commit 84af535. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pytest

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pt2 Bug Basher loads about 3.5k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 1,427 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 1,427 words (~3,507 tokens).

“Debug test failures and runtime errors in the PyTorch 2 compiler stack (Dynamo, Inductor, AOTAutograd, FX graphs).”

— opening of SKILL.md by pytorch, Custom licence
name
pt2-bug-basher
disable-model-invocation
true

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .agents/skills/pt2-bug-basher of pytorch/pytorch.

Open the folder on GitHubat commit 84af535

Compare with similar skills

Pt2 Bug Basher next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pt2 Bug Basher compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pt2 Bug Basher this skillpytorch/pytorch104k—~3.5kAutomated safety check: PassCustom licence
Cuda Cpp Kernelvipshop/cache-dit1.3k—~2.3kAutomated safety check: PassApache-2.0
Qualcomm QNN Backend Developmentpytorch/executorch5.1k—~1.8kAutomated safety check: PassCustom licence
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
Liger Kernel Devlinkedin/Liger-Kernel6.6k—~799Automated safety check: PassBSD-2-Clause
Graphsignalgraphsignal/graphsignal257—~6.2kAutomated safety check: PassApache-2.0

Similar skills

  • Cuda Cpp Kernel

    vipshop/cache-dit

    A skill your agent uses when writing, debugging, porting, reviewing, or optimizing CUDA C++ or PTX kernels; investigating CUDA Runtime or Driver API behavior; profiling kernels with Nsight Systems…

    1.3k GitHub stars~2.3k tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed
  • Helps build, test and extend the Qualcomm AI Engine Direct (QNN) backend in ExecuTorch, with routes for new ops, model export, Buck-vs-CMake parity fixes and per-layer accuracy debugging.

    5.1k GitHub stars~1.8k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Liger Kernel Dev

    linkedin/Liger-Kernel

    Develops production-ready Triton kernels for Liger Kernel. An agent skill from linkedin/Liger-Kernel.

    6.6k GitHub stars~799 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Graphsignal

    graphsignal/graphsignal

    Profile AI inference workloads (vLLM, SGLang, TensorRT-LLM, PyTorch, any GPU application) with the Graphsignal profiler and read the results from its local /signals JSON endpoint.

    257 GitHub stars~6.2k tokensUpdated 9 days ago
    AI & LLM EngineeringAuto-check passed
  • ExecuTorch Knowledge Base

    pytorch/executorch

    Answers ExecuTorch questions from a local wiki on backends, export pitfalls, quantization recipes, runtime errors and SoC compatibility.

    5.1k GitHub stars~1.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from pytorch/pytorch

All 16 skills in this repo
  • Add Uint Support

    pytorch/pytorch

    Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.

    104k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Docstring

    pytorch/pytorch

    Write docstrings for PyTorch functions and methods following PyTorch conventions.

    104k GitHub starsUsed in 2 repos~2.6k tokens
    Auto-check passed
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • CI Metrics

    pytorch/pytorch

    Query PyTorch CI, GitHub Actions, HUD, Grafana, and infrastructure metrics.

    104k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Cuda Index Width

    pytorch/pytorch

    Choose 32-bit vs 64-bit index math in PyTorch CUDA kernels. An agent skill from pytorch/pytorch.

    104k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Document Public APIs

    pytorch/pytorch

    Document undocumented public APIs in PyTorch by removing functions from coverageignorefunctions and coverageignoreclasses in docs/source/conf.py, running Sphinx coverage, and adding the appropriate…

    104k GitHub stars~4.2k tokensUpdated today
    Auto-check passed

Works with

Questions about Pt2 Bug Basher

What does Pt2 Bug Basher do?

Debug PyTorch 2 compiler stack failures including Dynamo graph breaks, Inductor codegen errors, AOTAutograd crashes, and accuracy mismatches. Pt2 Bug Basher is an agent skill from pytorch/pytorch. Debug PyTorch 2 compiler stack failures including Dynamo graph breaks, Inductor codegen errors, AOTAutograd crashes, and accuracy mismatches.

When should I use Pt2 Bug Basher?

Pt2 Bug Basher fits situations like: encountering torch.compile errors; backendCompilerFailed exceptions; recompilation issues; triton kernel failures.

How do I install Pt2 Bug Basher in Claude Code?

Run `npx skills add pytorch/pytorch --skill pt2-bug-basher -a claude-code`. Or copy the skill folder (.agents/skills/pt2-bug-basher in pytorch/pytorch) into .claude/skills/pt2-bug-basher in your project. Claude Code loads it when a task matches its description.

How do I install Pt2 Bug Basher in Codex?

Run `npx skills add pytorch/pytorch --skill pt2-bug-basher -a codex`. Or copy the skill folder (.agents/skills/pt2-bug-basher in pytorch/pytorch) into .agents/skills/pt2-bug-basher in your project. Codex loads it when a task matches its description.

Can I use Pt2 Bug Basher in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pytorch/pytorch --skill pt2-bug-basher -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pt2-bug-basher, .gemini/skills/pt2-bug-basher, .github/skills/pt2-bug-basher and .opencode/skills/pt2-bug-basher in your project.

What does Pt2 Bug Basher need to run?

Going by SKILL.md and its folder, Pt2 Bug Basher needs the command-line tools its instructions call (python and pytest). Our summary lists: Python 3.

Does Pt2 Bug Basher access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Pt2 Bug Basher safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pt2 Bug Basher use?

Pt2 Bug Basher has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Pt2 Bug Basher use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pt2 Bug Basher?

Skills that share tags, products or a category with Pt2 Bug Basher: Cuda Cpp Kernel (vipshop/cache-dit, 1.3k stars), Qualcomm QNN Backend Development (pytorch/executorch, 5.1k stars), The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars) and Liger Kernel Dev (linkedin/Liger-Kernel, 6.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pt2 Bug Basher?

pytorch (a GitHub organization) maintains it in pytorch/pytorch, which has 103,819 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 7, 2026.

Source: pytorch/pytorch on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.