Write Metal/MPS kernels for PyTorch operators. Use when adding MPS device support to operators, implementing Metal shaders, or porting CUDA kernels to Apple…
Metal Kernel Writing Guide This skill guides you through implementing Metal kernels for PyTorch operators on Apple Silicon. Important: The goal of this skill is to use native Metal capabilities via the c10/metal/ infrastructure, NOT MPSGraph. Native Metal kernels provide better control, performance, and maintainability. Overview There are two workflows covered by this skill: Adding new MPS support - Implementing a new operator from scratch Migrating from MPSGraph - Converting existing MPSGraph-based operators to native Metal Both workflows involve: Update dispatch in aten/src/ATen/native/native_functions.yaml Write Metal kernel in aten/src/ATen/native/mps/kernels/ Implement host-side stub in aten/src/ATen/native/mps/operations/ Step 1: Update native_functions.yaml
don't have the plugin yet? install it then click "run inline in claude" again.
by @freshtechbro