pytorch-dynamo

Debug and extend PyTorch Dynamo compilation across symbolic execution and FX graph generation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps PyTorch contributors understand, debug, and extend the Dynamo compiler without bypassing its symbolic execution, guard, or graph-generation architecture.

Core Features & Use Cases

  • Dynamo Architecture Guidance: Explains frame interception, bytecode translation, VariableTrackers, FX graph assembly, backends, and the C++ runtime.
  • Implementation Support: Provides patterns for adding opcode handlers, creating VariableTracker types, integrating pytrees, installing guards, handling side effects, and writing polyfills.
  • Debugging Workflows: Diagnoses bytecode capture, object-to-variable conversion, reconstruction, graph breaks, guard failures, dynamic-shape issues, and compilation errors.
  • Use Case: When a new Python type causes a torch.compile failure, use the Skill to identify the relevant VariableTracker, add builder support, implement reconstruction and method handling, create a regression test, and verify the fix.

Quick Start

Use the pytorch-dynamo skill to diagnose a torch.compile implementation failure and recommend the relevant code changes and tests.

Frequently Asked Questions about pytorch-dynamo

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

FAQPage Schema
How do I debug a torch.compile failure caused by an unsupported Python type?

To debug a torch.compile failure, identify the relevant VariableTracker, add builder support for the new type, implement reconstruction and method handling, and verify the fix with focused Dynamo regression tests.

Why does PyTorch Dynamo trigger a graph break during symbolic execution?

PyTorch Dynamo triggers a graph break when it encounters unsupported bytecode operations or side effects during symbolic execution, requiring you to implement opcode handlers or polyfills to preserve the FX graph.

How do I handle dynamic shapes in PyTorch Dynamo compilation?

Handle dynamic shapes in PyTorch Dynamo by applying symbolic shape APIs during frame interception and guard generation, ensuring guard semantics are preserved to prevent unexpected recompilation.

What is the best way to extend PyTorch Dynamo with a new VariableTracker type?

The best way to extend PyTorch Dynamo is to create a new VariableTracker type, add builder support for object-to-variable conversion, implement reconstruction, and install guards to maintain correct execution.

Can I integrate pytrees into the PyTorch compiler without breaking guard semantics?

Yes, you can integrate pytrees into the PyTorch compiler by following established Dynamo extension points, ensuring that guard installation and symbolic execution correctly track the nested structures.

Does torch.compile work with custom C++ ATen operations?

torch.compile works with custom C++ ATen operations by routing them through the Dynamo backend, though you must diagnose any compilation errors or guard failures that arise during FX graph generation.