<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "MetalPerformanceShaders"
  },
  "title" : "Metal Performance Shaders"
}
-->

# Metal Performance Shaders

Optimize graphics and compute performance with kernels that are fine-tuned for the unique characteristics of each Metal GPU family.

## Overview

The Metal Performance Shaders framework contains a collection of highly optimized compute and graphics shaders that are designed to integrate easily and efficiently into your Metal app. These data-parallel primitives are specially tuned to take advantage of the unique hardware characteristics of each GPU family to ensure optimal performance.

Apps adopting the Metal Performance Shaders framework achieve great performance without needing to create and maintain hand-written shaders for each GPU family. Metal Performance Shaders can be used along with your app’s existing Metal resources (such as the <doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer>, <doc://com.apple.documentation/documentation/Metal/MTLTexture>, and <doc://com.apple.documentation/documentation/Metal/MTLBuffer> objects) and shaders.

The Metal Performance Shaders framework supports the following functionality:

- Apply high-performance filters to, and extract statistical and histogram data from images.
- Implement and run neural networks for machine learning training and inference.
- Solve systems of equations, factorize matrices and multiply matrices and vectors.
- Accelerate ray tracing with high-performance ray-geometry intersection testing.

## Topics

### Fundamentals

[The MPSKernel Class](/documentation/MetalPerformanceShaders/the-mpskernel-class)

[Tuning Hints](/documentation/MetalPerformanceShaders/tuning-hints)

### Device Support

[`MPSSupportsMTLDevice(_:)`](/documentation/MetalPerformanceShaders/MPSSupportsMTLDevice(_:))

Determines whether the Metal Performance Shaders framework supports a Metal device.

### Image Filters

[Image Filters](/documentation/MetalPerformanceShaders/image-filters)

Apply high-performance filters to, and extract statistical and histogram data from images.

### Neural Networks

Implement and run deep learning using previously obtained training data.

[Training a Neural Network with Metal Performance Shaders](/documentation/MetalPerformanceShaders/training-a-neural-network-with-metal-performance-shaders)

Use an MPS neural network graph to train a simple neural network digit classifier.

[`MPSImage`](/documentation/MetalPerformanceShaders/MPSImage)

A texture that may have more than four channels for use in convolutional neural networks.

[`MPSTemporaryImage`](/documentation/MetalPerformanceShaders/MPSTemporaryImage)

A texture for use in convolutional neural networks that stores transient data to be used and discarded promptly.

[Objects that Simplify the Creation of Neural Networks](/documentation/MetalPerformanceShaders/objects-that-simplify-the-creation-of-neural-networks)

Simplify the creation of neural networks using networks of filter, image, and state nodes.

[Convolutional Neural Network Kernels](/documentation/MetalPerformanceShaders/convolutional-neural-network-kernels)

Build neural networks with layers.

[Recurrent Neural Networks](/documentation/MetalPerformanceShaders/recurrent-neural-networks)

Create recurrent neural networks.

### Matrices and Vectors

[Matrices and Vectors](/documentation/MetalPerformanceShaders/matrices-and-vectors)

Solve systems of equations, factorize matrices and multiply matrices and vectors.

### Kernel Base Classes

[`MPSKernel`](/documentation/MetalPerformanceShaders/MPSKernel)

A standard interface for Metal Performance Shaders kernels.

### Keyed Archivers

  <doc://com.apple.documentation/documentation/Foundation/NSKeyedArchiver>

[`MPSKeyedUnarchiver`](/documentation/MetalPerformanceShaders/MPSKeyedUnarchiver)

A keyed archiver that supports Metal Performance Shaders kernel decoding.

[`MPSDeviceProvider`](/documentation/MetalPerformanceShaders/MPSDeviceProvider)

An interface that enables the setting of a Metal device for unarchived objects.

### Ray Tracing

  <doc://com.apple.documentation/documentation/Metal/accelerating-ray-tracing-and-motion-blur-using-metal>

[`MPSRayIntersector`](/documentation/MetalPerformanceShaders/MPSRayIntersector)

A kernel that performs intersection tests between rays and geometry.

[`MPSAccelerationStructureGroup`](/documentation/MetalPerformanceShaders/MPSAccelerationStructureGroup)

A group of acceleration structures.

[`MPSInstanceAccelerationStructure`](/documentation/MetalPerformanceShaders/MPSInstanceAccelerationStructure)

An acceleration structure built over instances of other acceleration structures.

[`MPSTriangleAccelerationStructure`](/documentation/MetalPerformanceShaders/MPSTriangleAccelerationStructure)

An acceleration structure built over triangles.

[`MPSAccelerationStructure`](/documentation/MetalPerformanceShaders/MPSAccelerationStructure)

The base class for data structures that are built over geometry and used to accelerate ray tracing.

## See Also

  <doc://com.apple.documentation/documentation/Metal>

  [Metal Programming Guide](https://developer.apple.com/library/archive/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40014221)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)