at-dispatch-v2

Community

Upgrade PyTorch dispatch macros to v2, effortlessly.

Authorlinjunhui
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill automates the tedious and error-prone conversion of legacy PyTorch AT_DISPATCH macros to the modern AT_DISPATCH_V2 format, saving developers significant time during code modernization efforts.

Core Features & Use Cases

  • Automated Macro Conversion: Transforms old AT_DISPATCH_ALL_TYPES_AND* and AT_DISPATCH_FLOATING_TYPES* macros to the AT_DISPATCH_V2 API.
  • Argument Reordering & Wrapping: Correctly reorders arguments and wraps lambda functions with AT_WRAP() to prevent parsing issues.
  • Type Group Expansion: Ensures proper use of AT_EXPAND() for type groups, making dispatch definitions clearer and more extensible.
  • Use Case: You are maintaining a large PyTorch codebase and need to update numerous ATen kernel files to use the latest AT_DISPATCH_V2 API. Instead of manually refactoring each macro, you use this Skill to automatically perform the conversion, ensuring consistency and reducing the risk of introducing bugs.

Quick Start

Convert all AT_DISPATCH macros in my_pytorch_kernel.cpp to the AT_DISPATCH_V2 format.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: at-dispatch-v2
Download link: https://github.com/linjunhui/cuda-learning/archive/main.zip#at-dispatch-v2

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository