Agent skill · research science · pytorch
aoti-debug
Debug AOTInductor (AOTI) errors and crashes. Use when encountering AOTI segfaults, device mismatch errors, constant loading failures, or runtime errors from aot_compile, aot_load, aoti_compile_and_package, or aoti_load_package.
Why this skill is useful
Provides specific debugging patterns and commands for diagnosing AOTInductor errors that the AI wouldn't reliably generate on its own.
What it needs
About 4k tokens when loaded. Last updated 2026-08-07. 102,253 stars on the source repository.
What this skill does
AOTI Debugging Guide This skill helps diagnose and fix common AOTInductor issues. Error Pattern Routing Check the error message and route to the appropriate sub-guide: Triton Index Out of Bounds If the error matches this pattern: → Follow the guide in triton-index-out-of-bounds.md All Other Errors Continue with the sections below. --- First Step: Always Check Device and Shape Matching For ANY AOTI error (segfault, exception, crash, wrong output), ALWAYS check these first: 1. Compile device == Load device: The model must be loaded on the same device type it was compiled on 2. Input devices match: Runtime inputs must be on the same device as the compiled model 3. Input shapes match: Runtime input shapes must match the shapes used during compilation (or satisfy dynamic shape constraints) If any of these don't match, you will get errors ranging from segfaults to exceptions to wrong outputs. Key Constraint: Device Type Matching AOTI requires compile and load to use the same device type. If you compile on CUDA, you must load on CUDA (device index can differ) If you compile on CPU, you must load on CPU Cross-device loading (e.g., compile on GPU, load on CPU) is NOT supported Common Error Patterns 1. Device Mismatch Segfault Symptom: Segfault, exception, or crash during aotload() or model execution. Example error messages: The specified pointer resides on host memory and is not registered with any CUDA device Crash during constant loading in AOTInductorModelBase Expected out tensor to have device cuda:0, but got cpu instead Cause: Compile and load device types don't match (see "First Step" above). Solution: Ensure compile and load use the same device type. If compiled on CPU, load on CPU. If compiled on CUDA, load on CUDA. 2. Input Device Mismatch at Runtime Symptom: RuntimeError during model execution. Cause: Input device doesn't match compile device (see "First Step" above). Better Debugging: Run with AOTIRUNTIMECHECKINPUTS=1 for clearer errors. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills pytorch/aoti-debug