What problem does it solve?
Debugging failures in the PyTorch 2 compiler stack (Dynamo, Inductor, AOTAutograd, FX graphs) is complex because errors span trace-time vs runtime, multiple compilation modes, and various backend stages. This Skill provides a structured workflow to reproduce, minimize, classify, and fix these bugs.
Core Features & Use Cases
- Error Triage: Classifies failures into categories (graph breaks, BackendCompilerFailed, recompilation, accuracy, InternalTorchDynamoError, runtime crashes, Triton failures) and routes to the right diagnostic approach.
- Diagnostic Tools: Uses TORCH_LOGS, TORCH_COMPILE_DEBUG, TORCHDYNAMO_REPRO_AFTER, and the minifier to isolate minimal reproductions.
- Test-First Workflow: Adds a failing unit test before root-cause investigation, validates it fails on main, then applies and verifies the fix.
- Use Case: When a user hits a
BackendCompilerFailed exception from torch.compile, this Skill walks through reproducing the failure, running the AOT minifier, inspecting FX graphs, identifying the offending op, and writing a regression test.
Quick Start
Use the pt2-bug-basher skill to debug the torch.compile BackendCompilerFailed error in my script and add a regression test.