compile-trace-aot

Trace PyTorch AOT Autograd FX graphs to debug compiled training workflows.

6|8|Updated May 7, 2026
One-click install
npx skills add https://github.com/TorchedHat/ai-marketplace --skill compile-trace-aot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compile-trace-aot
Source: https://github.com/TorchedHat/ai-marketplace/tree/main/torch-compile/skills/compile-trace-aot
Command: npx skills add https://github.com/TorchedHat/ai-marketplace --skill compile-trace-aot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps diagnose failures and performance issues in PyTorch's AOT Autograd stage by making functionalization, joint graph creation, partitioning, recomputation, and post-gradient transformations visible.

Core Features & Use Cases

  • AOT Stage Tracing: Inspect functionalized, joint, forward, backward, and post-gradient FX graphs using PyTorch logging.
  • Graph and Gradient Debugging: Verify mutation handling, saved activations, gradient flow, partitioning correctness, and recomputation behavior.
  • Use Case: When a compiled training model produces incorrect gradients or excessive memory usage, use this Skill to compare eager and compiled behavior and identify issues in the joint or partitioned graphs.

Quick Start

Use the compile-trace-aot skill to trace a compiled training script and explain its functionalization, joint graph, partitioning, and post-gradient graphs.

Frequently Asked Questions about compile-trace-aot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug incorrect gradients in PyTorch torch.compile training?

To debug incorrect gradients in torch.compile training, inspect the AOT Autograd joint and partitioned FX graphs. This Skill traces functionalization and forward-backward graph generation to validate mutation handling and gradient flow against eager execution.

What is AOT Autograd functionalization and when do I need to trace it?

AOT Autograd functionalization transforms mutation operations into functional forms for joint graph generation. You need to trace it when compiled training produces incorrect gradients or unexpected memory usage, requiring visibility into saved activations and partitioning correctness.

How do I inspect PyTorch FX graphs to diagnose excessive memory usage during compiled training?

Inspect PyTorch FX graphs by tracing AOT Autograd logging outputs to verify saved activations and recomputation behavior. This Skill makes post-gradient optimization passes visible, helping you compare eager and compiled memory usage to identify partitioning issues.

Can I trace graph partitioning and recomputation behavior in PyTorch AOT Autograd?

Yes, you can trace graph partitioning and recomputation behavior in PyTorch AOT Autograd. This Skill interprets PyTorch logging to validate how joint forward and backward graphs are split and how recomputation affects gradient correctness and memory usage.

Why does torch.compile produce different gradient behavior than eager execution?

torch.compile produces different gradient behavior when AOT Autograd transformations alter mutation handling or saved activations during functionalization. This Skill helps compare eager and compiled FX graphs to pinpoint discrepancies in joint forward and backward graph partitioning.

What are the limitations of tracing PyTorch AOT Autograd transformations?

Tracing PyTorch AOT Autograd transformations requires interpreting detailed FX graph outputs and PyTorch logging. It is limited to validating functionalization, partitioning, and post-gradient optimization, meaning it focuses on graph-level debugging rather than underlying tensor operations.