Token导航 LogoToken导航

Agent Skill · 研究检索

pt2-bug-basher(pt2 错误打击者)

pt2-bug-basher 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

pt2-bug-basher 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 38,652。

总安装 1,529周安装 65GitHub Stars 99,491下载 536核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pt2-bug-basher(pt2 错误打击者)
来源仓库:https://github.com/pytorch/pytorch
仓库路径:skills/pt2-bug-basher
安装命令:
npx skills add https://github.com/pytorch/pytorch --skill pt2-bug-basher
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pytorch/pytorch --skill pt2-bug-basher

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

pt2-bug-basher 用于查找、检索和筛选相关信息,适合基于关键词或任务场景的信息定位。适用于需要快速获取候选结果并支持后续筛选的任务场景。通过 npx skills add 命令从 GitHub 仓库安装并使用。使用前需确认权限范围、维护状态及是否触发联网或系统操作。

建议参考原始 README 了解具体功能边界与使用限制。

来源仓库内路径:skills/pt2-bug-basher

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/pytorch/pytorch --skill pt2-bug-basher;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

pt2-bug-basher 怎么安装?

在终端执行 npx skills add https://github.com/pytorch/pytorch --skill pt2-bug-basher。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pt2-bug-basher 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pt2-bug-basher 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/pytorch/pytorch --skill pt2-bug-basher 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

pt2-bug-basher 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pt2-bug-basher 用的人多吗?

公开数据是累计安装 1,529 次,近一周安装 65 次,下载 536 次,GitHub 99,491 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pt2-bug-basher 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 99,491 星,维护活跃度相对可查。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
pt2-bug-basher

pt2 错误打击者 · 本页

1,52999,491执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

PT2 Bug Basher

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

Workflow Summary

  1. Environment check -- Ask the user which conda environment to use. Verify it is active by checking $CONDA_DEFAULT_ENV. Then run python -c "import torch; print(torch.__version__)" to confirm torch is importable and report the version. If the environment is not active or torch cannot be imported, stop and ask the user to activate the correct environment before proceeding.
  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 isolate the specific op or pattern that triggers the bug.
  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 the bug. Place it in a specific, topic-appropriate test file (e.g., test/dynamo/test_repros.py, test/inductor/test_torchinductor.py, test/export/test_export.py). Avoid test/dynamo/test_misc.py — it is already oversized; find a more specific test file that matches the area of the bug. Use torch.testing._internal.common_utils.TestCase and run_tests. The test must fail before the fix and pass after. Having the test first keeps you grounded — you know exactly what "fixed" looks like before you start exploring the codebase.
  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 there to confirm it fails on main. If the test passes on main, stop — the test may not be capturing the right bug, or the bug may already be fixed. Exit the worktree with ExitWorktree (action: remove) and return to the working branch before continuing.
  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 test_is_exporting export test). Use pytest -k to quickly run related tests by name. The task is not complete until all pass.
  12. Self-review -- Use the /pr-review skill to review your own changes before presenting them. Fix any issues it flags.
  13. Celebrate -- Summarize the changes: explain the root cause, what was changed and why, and which tests were added/verified. Then tell the user the bug is squashed. Include a fun, varied motivational message or easter egg to keep spirits high (e.g., a pun, a quote, an ASCII art bug getting squashed). Keep it short and different each time.

Investigation Strategy

Prefer direct tools over meta_codesearch

Use Grep, Glob, and Read directly for code exploration. Do not spawn meta_codesearch agents — they are slow and expensive. The Architectural Knowledge and Key Source Files sections below should give you enough context to know where to look. A targeted Grep for a function name is always faster.

Know which compilation mode you're in

Before reading implementation code, determine the compilation mode. These share code but diverge in important ways:

  • torch.compile -- Dynamo + Inductor. tx.export=False, no _compiling_state_context().
  • torch.export (strict) -- tx.export=True, _compiling_state_context() active.
  • torch.export (non-strict, the default) -- Uses Dynamo via fullgraph_capture but tx.export may differ from strict. _compiling_state_context() active. Check torch._export.config.use_new_tracer_experimental — it changes which code path is used.

Distinguish trace-time vs runtime

Many PT2 bugs come from confusing these two:

  • Trace-time: Inside Dynamo's symbolic interpreter. Dynamo intercepts function calls and may constant-fold them (e.g., is_exporting() → ConstantVariable(True)).
  • Runtime: Real tensors, real Python calls, module-level flags like torch.compiler._is_exporting_flag.

When debugging, add temporary print() statements directly in the source file rather than monkey-patching from outside — dispatch chains make monkey-patching unreliable.

Gathering Information

Pick the right diagnostic tool based on the error category:

  • Quick overview: TORCH_LOGS="+dynamo,graph_breaks,recompiles" python your_script.py
  • Full debug artifacts: TORCH_COMPILE_DEBUG=1 python your_script.py — creates torch_compile_debug/ with FX graphs, Inductor IR, and generated code
  • Generated code only: TORCH_LOGS="output_code" python your_script.py
  • Structured tracing: TORCH_TRACE=/path/to/trace python your_script.py then tlparse /path/to/trace
  • Single-threaded (for pdb): TORCHINDUCTOR_COMPILE_THREADS=1 python your_script.py

Error Triage

Classify the failure using the error message and traceback:

Error PatternCategoryJump To
Unsupported:... or graph break in logsGraph breakGraph Breaks
BackendCompilerFailedInductor/backend crashBackend Failures
RecompileError or cache_size_limitRecompilationRecompilation
Accuracy mismatch / wrong numerical outputAccuracyAccuracy
InternalTorchDynamoErrorDynamo bugInternal Errors
Segfault or CUDA IMARuntime crashRuntime Crashes
Triton assertion / index out of boundsTriton kernel bugTriton Failures

Debugging by Category

Graph Breaks

Graph breaks split the compiled graph into smaller subgraphs, often causing performance regressions or unexpected behavior.

Diagnosis:

TORCH_LOGS="graph_breaks" python your_script.py

Key files:

  • torch/_dynamo/exc.py -- Unsupported exception class
  • torch/_dynamo/variables/ -- where most graph break decisions happen

Common causes:

  • Unsupported Python constructs (data-dependent control flow, unsupported builtins)
  • Tensor operations that can't be traced (in-place ops on inputs, unsupported dtypes)
  • Calls to non-traceable functions

Fix approach:

  1. Read the graph break message to identify the unsupported operation
  2. Check if there's a decomposition or supported alternative
  3. If the operation genuinely can't be traced, consider torch._dynamo.allow_in_graph or restructuring user code

Backend Compiler Failures

BackendCompilerFailed means Inductor (or another backend) crashed during compilation.

Diagnosis:

TORCHDYNAMO_REPRO_AFTER=aot TORCHDYNAMO_REPRO_LEVEL=2 python your_script.py

This generates minifier_launcher.py that isolates the minimal failing graph.

Key files:

  • torch/_dynamo/repro/after_aot.py -- repro/minifier for post-AOT failures
  • torch/_inductor/ -- the backend itself

Fix approach:

  1. Run the minifier to get a minimal reproduction
  2. Inspect the FX graph (TORCH_COMPILE_DEBUG=1) to understand what ops are involved
  3. Check if it's a lowering issue (torch/_inductor/lowering.py), scheduling issue, or codegen issue
  4. Look at the generated output code if the error is in codegen

Recompilation Issues

Excessive recompilation happens when guards are too specific, causing cache misses.

Diagnosis:

TORCH_LOGS="recompiles,recompiles_verbose,guards" python your_script.py

Key config:

  • torch._dynamo.config.recompile_limit (default: 8)
  • torch._dynamo.config.fail_on_recompile_limit_hit -- set to True to get a hard error

Common causes:

  • Changing tensor shapes without marking them dynamic
  • Python scalar values that change between calls
  • Global state mutations between calls

Fix approach:

  1. Read the recompilation reason from logs
  2. Identify the failing guard
  3. Either mark the relevant dimension as dynamic with torch._dynamo.mark_dynamic() or fix the source of guard instability

Accuracy Issues

The compiled model produces different numerical results than eager mode.

Diagnosis:

TORCHDYNAMO_REPRO_AFTER=aot TORCHDYNAMO_REPRO_LEVEL=4 python your_script.py

This compares compiled vs. eager with an fp64 reference and dumps a repro if accuracy fails.

Key utilities:

  • torch/_dynamo/debug_utils.py -- same_two_models(), backend_accuracy_fails(), cast_to_fp64()
  • torch._dynamo.config.repro_tolerance (default: 1e-3)

Fix approach:

  1. Get the minimal failing graph from the minifier
  2. Compare eager vs. compiled output at fp64 precision
  3. Binary search through ops to find the diverging operation
  4. Check for known numerical issues (reduction order, fused kernels, dtype promotions)

Internal Dynamo Errors

InternalTorchDynamoError indicates a bug in Dynamo itself.

Diagnosis:

TORCHDYNAMO_VERBOSE=1 python your_script.py
# or equivalently:
TORCH_LOGS="+dynamo" python your_script.py

Key files:

  • torch/_dynamo/symbolic_convert.py -- bytecode interpreter
  • torch/_dynamo/variables/ -- variable tracking system
  • torch/_dynamo/guards.py -- guard generation

Fix approach:

  1. Get the full stack trace with TORCHDYNAMO_VERBOSE=1
  2. Identify which bytecode instruction or variable type caused the crash
  3. Create a minimal repro (the error message often includes a minifier path)
  4. Debug with TORCHINDUCTOR_COMPILE_THREADS=1 and pdb if needed

Runtime Crashes

Segfaults and CUDA illegal memory access errors during execution of compiled code.

Diagnosis (make crash deterministic):

PYTORCH_NO_CUDA_MEMORY_CACHING=1 CUDA_LAUNCH_BLOCKING=1 python your_script.py

For CUDA IMA, add NaN checks:

TORCHINDUCTOR_NAN_ASSERTS=1 python your_script.py

For Inductor-level sync debugging:

torch._inductor.config.triton.debug_sync_kernel = True  # sync after every kernel
torch._inductor.config.triton.debug_sync_graph = True   # sync before/after graph

Fix approach:

  1. Make the crash deterministic with PYTORCH_NO_CUDA_MEMORY_CACHING=1 CUDA_LAUNCH_BLOCKING=1
  2. Check if it's an input mismatch (shapes, devices, dtypes)
  3. Inspect the generated kernel code with TORCH_LOGS="output_code"
  4. Use TORCHINDUCTOR_NAN_ASSERTS=1 to find the first kernel producing bad values
  5. Check for dynamic shapes issues (historically a common source of IMA)

Triton Kernel Failures

Triton assertion failures or index-out-of-bounds in generated kernels.

Diagnosis:

TORCH_LOGS="output_code,schedule" python your_script.py

Key files:

  • torch/_inductor/codegen/triton.py -- Triton codegen
  • torch/_inductor/scheduler.py -- kernel fusion decisions

Fix approach:

  1. Get the generated Triton kernel from output_code logs
  2. Check index computations for off-by-one or wrong stride calculations
  3. Look at the IR (TORCH_COMPILE_DEBUG=1) to trace back to the FX op
  4. Check if fusion decisions created invalid index combinations

Key Source Files

FilePurpose
torch/_dynamo/exc.pyException hierarchy and error formatting
torch/_dynamo/debug_utils.pyMinifier support, accuracy checking, input serialization
torch/_dynamo/repro/after_dynamo.pyRepro/minifier for Dynamo-stage failures
torch/_dynamo/repro/after_aot.pyRepro/minifier for post-AOTAutograd failures
torch/_dynamo/repro/aoti.pyRepro/minifier for AOTI failures
torch/_dynamo/config.pyDynamo config (repro levels, recompile limits)
torch/_dynamo/variables/torch.pyTorch function handling, tracing state functions
torch/_dynamo/variables/higher_order_ops.pyHOP tracing (cond, map, etc.)
torch/_dynamo/symbolic_convert.pyBytecode interpreter, InstructionTranslator
torch/_dynamo/convert_frame.pyFrame compilation, fullgraph_capture entry point
torch/_dynamo/functional_export.pyNew export tracer (_dynamo_graph_capture_for_export)
torch/_dynamo/eval_frame.pytorch._dynamo.export, optimize_assert
torch/_export/_trace.pyExport pipeline (_export, _strict_export, _non_strict_export, _export_to_aten_ir)
torch/_export/utils.py_compiling_state_context()
torch/compiler/__init__.pyis_compiling(), is_exporting(), runtime flags
torch/_higher_order_ops/cond.pytorch.cond implementation and proxy tracing
torch/_higher_order_ops/utils.pyreenter_make_fx for HOP branch tracing
torch/_inductor/config.pyInductor config (debug flags, trace settings)
torch/_inductor/debug.pyDebugContext, graph visualization, IR logging
torch/_logging/_registrations.pyAll registered log aliases and artifacts

Using the Minifier

The minifier reduces a failing graph to the smallest reproduction:

# Step 1: Generate the minifier launcher
TORCHDYNAMO_REPRO_AFTER=aot TORCHDYNAMO_REPRO_LEVEL=2 python your_script.py

# Step 2: Run the minifier
python minifier_launcher.py minify

# Step 3: Run the minimized repro
python minifier_launcher.py run

For accuracy issues, use level 4:

TORCHDYNAMO_REPRO_AFTER=aot TORCHDYNAMO_REPRO_LEVEL=4 python your_script.py

平台分布

Codex

40.73%
按下载量换算218

Claude

28.9%
按下载量换算155

Cursor

17.33%
按下载量换算93

Gemini CLI

9.03%
按下载量换算48

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/pytorch/pytorch --skill pt2-bug-basher 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills