<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Metal Performance Shaders Graph"
    ],
    "preciseIdentifier" : "MetalPerformanceShadersGraph"
  },
  "title" : "Metal Performance Shaders Graph"
}
-->

# Metal Performance Shaders Graph

Build, compile, and execute compute graphs utilizing all the different compute devices on the platform, including GPU, CPU, and Neural Engine.

## Overview

Metal Performance Shaders Graph provides high-performance, energy-efficient computation on Apple platforms by leveraging different hardware compute blocks. You can use this framework to generate a symbolic compute graph of operations, where each operation can output a set of tensors used as edges of the graph. The tensors represent multidimensional data that objects like <doc://com.apple.documentation/documentation/Metal/MTLBuffer> or <doc://com.apple.documentation/documentation/Metal/MTLTexture> can back. After you construct the graph, you can compile it into an executable to optimize for performance and subsequently run the executable on your input data. This framework also provides the ability to serialize the executables and load executables from a serialized `.mpsgraphpackage`.

## Topics

### Essentials

[Adding custom functions to a shader graph](/documentation/MetalPerformanceShadersGraph/adding-custom-functions-to-a-shader-graph)

Run your own graph functions on the GPU by building the function programmatically.

[Training a neural network using MPSGraph](/documentation/MetalPerformanceShadersGraph/training-a-neural-network-using-mps-graph)

Train a simple neural network digit classifier.

[Filtering images with MPSGraph FFT operations](/documentation/MetalPerformanceShadersGraph/filtering-images-with-mpsgraph-fft-operations)

Filter an image with MPSGraph fast Fourier transforms using the convolutional theorem.

### Classes

[`MPSGraph`](/documentation/MetalPerformanceShadersGraph/MPSGraph)

The optimized representation of a compute graph of operations and tensors.

[`MPSGraphCompilationDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphCompilationDescriptor)

A class that consists of all the levers for compiling graphs.

[`MPSGraphConvolution2DOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphConvolution2DOpDescriptor)

A class that describes the properties of a 2D-convolution operator.

[`MPSGraphConvolution3DOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphConvolution3DOpDescriptor)

A class that describes the properties of a 3D-convolution operator.

[`MPSGraphCreateSparseOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphCreateSparseOpDescriptor)

A class that describes the properties of a create sparse operation.

[`MPSGraphDepthwiseConvolution2DOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphDepthwiseConvolution2DOpDescriptor)

A class that defines the parameters for  a 2D-depthwise convolution operation.

[`MPSGraphDepthwiseConvolution3DOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphDepthwiseConvolution3DOpDescriptor)

The class that defines the parameters for a 3D-depthwise convolution operation.

[`MPSGraphDevice`](/documentation/MetalPerformanceShadersGraph/MPSGraphDevice)

A class that describes the compute device.

[`MPSGraphExecutable`](/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable)

The compiled representation of a compute graph executable.

[`MPSGraphExecutableExecutionDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphExecutableExecutionDescriptor)

A class that consists of all the levers  to synchronize and schedule executable execution.

[`MPSGraphExecutableSerializationDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphExecutableSerializationDescriptor)

A class that consists of all the levers  to serialize an executable.

[`MPSGraphExecutionDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphExecutionDescriptor)

A class that consists of all the levers  to synchronize and schedule graph execution.

[`MPSGraphFFTDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphFFTDescriptor)

The class that defines the parameters for a fast Fourier transform (FFT) operation.

[`MPSGraphGRUDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphGRUDescriptor)

The class that defines the parameters for a gated recurrent unit (GRU) operation.

[`MPSGraphImToColOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphImToColOpDescriptor)

The class that defines the parameters for an image to column or column to image operation.

[`MPSGraphLSTMDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphLSTMDescriptor)

The class that defines the parameters for a long short-term memory (LSTM) operation.

[`MPSGraphObject`](/documentation/MetalPerformanceShadersGraph/MPSGraphObject)

The common base class for all Metal Performance Shaders Graph objects.

[`MPSGraphOperation`](/documentation/MetalPerformanceShadersGraph/MPSGraphOperation)

A symbolic representation of a compute operation.

[`MPSGraphPooling2DOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphPooling2DOpDescriptor)

The class that defines the parameters for a 2D pooling operation.

[`MPSGraphPooling4DOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphPooling4DOpDescriptor)

The class that defines the parameters for a 4D pooling operation.

[`MPSGraphRandomOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphRandomOpDescriptor)

A class that describes the random operation.

[`MPSGraphShapedType`](/documentation/MetalPerformanceShadersGraph/MPSGraphShapedType)

The shaped type class for types on tensors with a shape and data type.

[`MPSGraphSingleGateRNNDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphSingleGateRNNDescriptor)

The class that defines the parameters for a single gate RNN operation.

[`MPSGraphStencilOpDescriptor`](/documentation/MetalPerformanceShadersGraph/MPSGraphStencilOpDescriptor)

The class that defines the parameters for a stencil operation.

[`MPSGraphTensor`](/documentation/MetalPerformanceShadersGraph/MPSGraphTensor)

The symbolic representation of a compute data type.

[`MPSGraphTensorData`](/documentation/MetalPerformanceShadersGraph/MPSGraphTensorData)

The representation of a compute data type.

[`MPSGraphType`](/documentation/MetalPerformanceShadersGraph/MPSGraphType)

The base type class for types on tensors.

[`MPSGraphVariableOp`](/documentation/MetalPerformanceShadersGraph/MPSGraphVariableOp)

The class that defines the parameters for a variable.

### Reference

  <doc:metalperformanceshadersgraph_enumerations>

  <doc:metalperformanceshadersgraph_data_types>



---

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)
