pytorch-inductor

Diagnose and optimize PyTorch TorchInductor compilation behavior and generated kernels.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps PyTorch developers understand, debug, extend, and optimize the TorchInductor compiler backend behind torch.compile, reducing the complexity of FX lowering, scheduling, fusion, code generation, and performance tuning.

Core Features & Use Cases

  • Compiler Architecture Guidance: Explain the decomposition-to-lowering pipeline, Inductor IR, scheduling, memory planning, and backend code generation.
  • Operator and Kernel Development: Guide custom decompositions, lowerings, Triton templates, FX passes, layout constraints, and custom backend integrations.
  • Debugging and Optimization: Investigate compilation failures, inspect generated kernels, analyze fusion and memory behavior, configure autotuning, and improve CPU or GPU performance.
  • Use Case: When a new operator fails under torch.compile or produces inefficient kernels, use this Skill to determine whether it needs a decomposition or lowering, implement the appropriate integration, inspect generated code, and create validation tests.

Quick Start

Use the PyTorch Inductor skill to diagnose this compilation failure, identify the relevant lowering or code generation path, and recommend a tested fix.

Frequently Asked Questions about pytorch-inductor

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

FAQPage Schema
How do I debug torch.compile compilation failures and inefficient kernels?

Debug torch.compile failures by diagnosing TorchInductor compilation behavior, tracing FX graph lowering paths, inspecting generated Triton or C++ kernels, and analyzing fusion and memory planning to pinpoint missing decompositions or inefficient code generation.

How does the TorchInductor lowering pipeline work?

The TorchInductor lowering pipeline works by applying operator decompositions, translating FX graphs into Inductor IR, executing scheduling and memory planning, and performing backend code generation to produce optimized Triton or C++ kernels.

How do I add a custom operator lowering in PyTorch Inductor?

Add a custom operator lowering in PyTorch Inductor by implementing the appropriate decomposition or lowering, defining layout constraints, integrating Triton templates, inspecting generated code, and creating validation tests for the new code generation path.

Can I use Triton templates for custom backend integrations in torch.compile?

Yes, you can use Triton templates for custom backend integrations in torch.compile by developing custom lowerings, defining template selection logic, and configuring the Inductor IR to generate specialized Triton kernels.

What is the best way to optimize kernel performance in TorchInductor?

The best way to optimize kernel performance in TorchInductor is to analyze fusion behavior, configure autotuning, inspect generated Triton code, and evaluate memory planning to improve CPU or GPU execution efficiency.

Why does my new operator fail under torch.compile and how do I fix it?

Your new operator fails under torch.compile because it likely lacks a required decomposition or lowering within TorchInductor; fix it by implementing the appropriate integration, inspecting the generated code, and creating validation tests.