·
Last changedVersion:
This version passed the hardening gate. The skill content was retained without changes. Classified findings before hardening: 2. Classified findings closed: 0. Classified findings remaining: 2. Unclassified scanner findings remaining: 0. Review findings closed: 0. Review findings remaining: 9.
2
2
Expand | File | Group | Subtype | Severity | Status |
|---|---|---|---|---|---|
LICENSE | Excessive Agency & Rogue Autonomy | — | Low | Open | |
SKILL.md | Prompt Injection | Third-party content as instructions | Low | Open |
2 findings
This skill helps diagnose and fix common AOTInductor issues.
Check the error message and route to the appropriate sub-guide:
If the error matches this pattern:
→ Follow the guide in triton-index-out-of-bounds.md
Continue with the sections below.
For ANY AOTI error (segfault, exception, crash, wrong output), ALWAYS check these first:
If any of these don't match, you will get errors ranging from segfaults to exceptions to wrong outputs.
AOTI requires compile and load to use the same device type.
Symptom: Segfault, exception, or crash during aot_load() or model execution.
Example error messages:
The specified pointer resides on host memory and is not registered with any CUDA deviceExpected out tensor to have device cuda:0, but got cpu insteadCause: 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.
Symptom: RuntimeError during model execution.
Cause: Input device doesn't match compile device (see "First Step" above).
Better Debugging: Run with AOTI_RUNTIME_CHECK_INPUTS=1 for clearer errors. This flag validates all input properties including device type, dtype, sizes, and strides:
This produces actionable error messages like:
If you encounter CUDA illegal memory access errors, follow this systematic approach:
Before diving deep, try these debugging flags:
These flags take effect at compilation time (at codegen time):
AOTI_RUNTIME_CHECK_INPUTS=1 checks if inputs satisfy the same guards used during compilationTORCHINDUCTOR_NAN_ASSERTS=1 adds codegen before and after each kernel to check for NaNCUDA IMA errors can be non-deterministic. Use these flags to trigger the error deterministically:
These flags take effect at runtime:
PYTORCH_NO_CUDA_MEMORY_CACHING=1 disables PyTorch's Caching Allocator, which allocates bigger buffers than needed immediately. This is usually why CUDA IMA errors are non-deterministic.CUDA_LAUNCH_BLOCKING=1 forces kernels to launch one at a time. Without this, you get "CUDA kernel errors might be asynchronously reported" warnings since kernels launch asynchronously.Use the AOTI Intermediate Value Debugger to pinpoint the problematic kernel:
This prints kernels one by one at runtime. Together with previous flags, this shows which kernel was launched right before the error.
To inspect inputs to a specific kernel:
If inputs to the kernel are unexpected, inspect the kernel that produces the bad input.
TORCH_LOGS="+inductor,output_code" to see more PT2 internal logs1 to see more stack tracesThe new API stores device metadata in the package, so aoti_load_package() automatically uses the correct device type. You can only change the device index (e.g., cuda:0 vs cuda:1), not the device type.
| Variable | When | Purpose |
|---|---|---|
| Compile time | Validate inputs match compilation guards |
| Compile time | Check for NaN before/after kernels |
| Runtime | Make IMA errors deterministic |
| Runtime | Force synchronous kernel launches |
| Compile time | Print kernels at runtime |
| Runtime | See PT2 internal logs |
| Runtime | Show C++ stack traces |
Get started with chainctlchainctl skill install public/pytorch/aoti-debug:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/pytorch/.claude/skills/aoti-debug:latest
BSD-3-Clause
HARDENING.md
LICENSE
SKILL.md
triton-index-out-of-bounds.md