---
title: Metal Performance Shaders Graph
framework: metalperformanceshadersgraph
role: collection
role_heading: Framework
path: metalperformanceshadersgraph
---

# 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

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 MTLBuffer or 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](metalperformanceshadersgraph/adding-custom-functions-to-a-shader-graph.md)
- [Training a neural network using MPSGraph](metalperformanceshadersgraph/training-a-neural-network-using-mps-graph.md)
- [Filtering images with MPSGraph FFT operations](metalperformanceshadersgraph/filtering-images-with-mpsgraph-fft-operations.md)

### Classes

- [MPSGraph](metalperformanceshadersgraph/mpsgraph.md)
- [MPSGraphCompilationDescriptor](metalperformanceshadersgraph/mpsgraphcompilationdescriptor.md)
- [MPSGraphConvolution2DOpDescriptor](metalperformanceshadersgraph/mpsgraphconvolution2dopdescriptor.md)
- [MPSGraphConvolution3DOpDescriptor](metalperformanceshadersgraph/mpsgraphconvolution3dopdescriptor.md)
- [MPSGraphCreateSparseOpDescriptor](metalperformanceshadersgraph/mpsgraphcreatesparseopdescriptor.md)
- [MPSGraphDepthwiseConvolution2DOpDescriptor](metalperformanceshadersgraph/mpsgraphdepthwiseconvolution2dopdescriptor.md)
- [MPSGraphDepthwiseConvolution3DOpDescriptor](metalperformanceshadersgraph/mpsgraphdepthwiseconvolution3dopdescriptor.md)
- [MPSGraphDevice](metalperformanceshadersgraph/mpsgraphdevice.md)
- [MPSGraphExecutable](metalperformanceshadersgraph/mpsgraphexecutable.md)
- [MPSGraphExecutableExecutionDescriptor](metalperformanceshadersgraph/mpsgraphexecutableexecutiondescriptor.md)
- [MPSGraphExecutableSerializationDescriptor](metalperformanceshadersgraph/mpsgraphexecutableserializationdescriptor.md)
- [MPSGraphExecutionDescriptor](metalperformanceshadersgraph/mpsgraphexecutiondescriptor.md)
- [MPSGraphFFTDescriptor](metalperformanceshadersgraph/mpsgraphfftdescriptor.md)
- [MPSGraphGRUDescriptor](metalperformanceshadersgraph/mpsgraphgrudescriptor.md)
- [MPSGraphImToColOpDescriptor](metalperformanceshadersgraph/mpsgraphimtocolopdescriptor.md)
- [MPSGraphLSTMDescriptor](metalperformanceshadersgraph/mpsgraphlstmdescriptor.md)
- [MPSGraphObject](metalperformanceshadersgraph/mpsgraphobject.md)
- [MPSGraphOperation](metalperformanceshadersgraph/mpsgraphoperation.md)
- [MPSGraphPooling2DOpDescriptor](metalperformanceshadersgraph/mpsgraphpooling2dopdescriptor.md)
- [MPSGraphPooling4DOpDescriptor](metalperformanceshadersgraph/mpsgraphpooling4dopdescriptor.md)
- [MPSGraphRandomOpDescriptor](metalperformanceshadersgraph/mpsgraphrandomopdescriptor.md)
- [MPSGraphShapedType](metalperformanceshadersgraph/mpsgraphshapedtype.md)
- [MPSGraphSingleGateRNNDescriptor](metalperformanceshadersgraph/mpsgraphsinglegaternndescriptor.md)
- [MPSGraphStencilOpDescriptor](metalperformanceshadersgraph/mpsgraphstencilopdescriptor.md)
- [MPSGraphTensor](metalperformanceshadersgraph/mpsgraphtensor.md)
- [MPSGraphTensorData](metalperformanceshadersgraph/mpsgraphtensordata.md)
- [MPSGraphType](metalperformanceshadersgraph/mpsgraphtype.md)
- [MPSGraphVariableOp](metalperformanceshadersgraph/mpsgraphvariableop.md)
- [MPSGraphSDPADescriptor](metalperformanceshadersgraph/mpsgraphsdpadescriptor.md)

### Structures

- [MPSGraphReducedPrecisionFastMath](metalperformanceshadersgraph/mpsgraphreducedprecisionfastmath.md)

### Type Aliases

- [MPSGraphCompilationCompletionHandler](metalperformanceshadersgraph/mpsgraphcompilationcompletionhandler.md)
- [MPSGraphCompletionHandler](metalperformanceshadersgraph/mpsgraphcompletionhandler.md)
- [MPSGraphControlFlowDependencyBlock](metalperformanceshadersgraph/mpsgraphcontrolflowdependencyblock.md)
- [MPSGraphExecutableCompletionHandler](metalperformanceshadersgraph/mpsgraphexecutablecompletionhandler.md)
- [MPSGraphExecutableScheduledHandler](metalperformanceshadersgraph/mpsgraphexecutablescheduledhandler.md)
- [MPSGraphForLoopBodyBlock](metalperformanceshadersgraph/mpsgraphforloopbodyblock.md)
- [MPSGraphIfThenElseBlock](metalperformanceshadersgraph/mpsgraphifthenelseblock.md)
- [MPSGraphScheduledHandler](metalperformanceshadersgraph/mpsgraphscheduledhandler.md)
- [MPSGraphWhileAfterBlock](metalperformanceshadersgraph/mpsgraphwhileafterblock.md)
- [MPSGraphWhileBeforeBlock](metalperformanceshadersgraph/mpsgraphwhilebeforeblock.md)

### Enumerations

- [MPSGraphDeploymentPlatform](metalperformanceshadersgraph/mpsgraphdeploymentplatform.md)
- [MPSGraphDeviceType](metalperformanceshadersgraph/mpsgraphdevicetype.md)
- [MPSGraphExecutionStage](metalperformanceshadersgraph/mpsgraphexecutionstage.md)
- [MPSGraphFFTScalingMode](metalperformanceshadersgraph/mpsgraphfftscalingmode.md)
- [MPSGraphLossReductionType](metalperformanceshadersgraph/mpsgraphlossreductiontype.md)
- [MPSGraphNonMaximumSuppressionCoordinateMode](metalperformanceshadersgraph/mpsgraphnonmaximumsuppressioncoordinatemode.md)
- [MPSGraphOptimization](metalperformanceshadersgraph/mpsgraphoptimization.md)
- [MPSGraphOptimizationProfile](metalperformanceshadersgraph/mpsgraphoptimizationprofile.md)
- [MPSGraphOptions](metalperformanceshadersgraph/mpsgraphoptions.md)
- [MPSGraphPaddingMode](metalperformanceshadersgraph/mpsgraphpaddingmode.md)
- [MPSGraphPaddingStyle](metalperformanceshadersgraph/mpsgraphpaddingstyle.md)
- [MPSGraphPoolingReturnIndicesMode](metalperformanceshadersgraph/mpsgraphpoolingreturnindicesmode.md)
- [MPSGraphRNNActivation](metalperformanceshadersgraph/mpsgraphrnnactivation.md)
- [MPSGraphRandomDistribution](metalperformanceshadersgraph/mpsgraphrandomdistribution.md)
- [MPSGraphRandomNormalSamplingMethod](metalperformanceshadersgraph/mpsgraphrandomnormalsamplingmethod.md)
- [MPSGraphReductionMode](metalperformanceshadersgraph/mpsgraphreductionmode.md)
- [MPSGraphResizeMode](metalperformanceshadersgraph/mpsgraphresizemode.md)
- [MPSGraphResizeNearestRoundingMode](metalperformanceshadersgraph/mpsgraphresizenearestroundingmode.md)
- [MPSGraphScatterMode](metalperformanceshadersgraph/mpsgraphscattermode.md)
- [MPSGraphSparseStorageType](metalperformanceshadersgraph/mpsgraphsparsestoragetype.md)
- [MPSGraphTensorNamedDataLayout](metalperformanceshadersgraph/mpsgraphtensornameddatalayout.md)
