Skip to content
Kitbay
Submit
Skill

aoti-debug

NOASSERTIONUpdated on Nov 11, 2026105,390GitHub stars

A skill kept in the PyTorch repository for debugging AOTInductor, PyTorch's ahead-of-time compiler, when compiled models crash or fail: segfaults, device mismatches, constant-loading errors and CUDA illegal memory accesses.

What the skill teaches

A skill kept in the PyTorch repository for debugging AOTInductor, PyTorch's ahead-of-time compiler, when compiled models crash or fail: segfaults, device mismatches, constant-loading errors and CUDA illegal memory accesses. It starts with three checks (same device type at compile and load time, inputs on the right device, input shapes matching the compiled constraints), then gives a step-by-step route for memory errors: turn on input and NaN checks, make failures reproducible by disabling the caching allocator and forcing synchronous launches, and print kernels as they run to find the culprit. It lists the relevant environment variables and notes that the older aot_compile and aot_load functions are deprecated.

Capabilities

  • Check device and shape mismatches in AOTInductor models
  • Narrow down CUDA illegal memory access errors
  • Print kernels at run time to find a failing one
  • Pick the right debug environment variables