Zum Inhalt springen
Kitbay
Einreichen
Skill

metal-kernel

NOASSERTIONAktualisiert am 11. Nov. 2026105.390GitHub-Sterne

A maintainer skill in the PyTorch repository for writing native Metal kernels that run PyTorch operators on Apple Silicon GPUs, preferred over MPSGraph for control and speed.

Was der Skill vermittelt

A maintainer skill in the PyTorch repository for writing native Metal kernels that run PyTorch operators on Apple Silicon GPUs, preferred over MPSGraph for control and speed. The agent adds the MPS entry to the operator's dispatch definitions, writes the kernel as a templated functor registered with the project's unary or binary macros, adds a host-side stub that runs it and removes any old MPSGraph implementation, then builds with ninja. It covers complex and boolean arguments, very large tensors and error reporting from inside kernels, how to take the operator off the MPS skip and expected-failure lists so its tests run, and testing single shaders with the compile_shader helper.

Funktionen

  • Add MPS dispatch for a PyTorch operator
  • Write and register a native Metal kernel
  • Migrate an operator off MPSGraph
  • Enable and run the operator's MPS tests