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 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 graphTraining a neural network using MPSGraphFiltering images with MPSGraph FFT operations
Classes
MPSGraphMPSGraphCompilationDescriptorMPSGraphConvolution2DOpDescriptorMPSGraphConvolution3DOpDescriptorMPSGraphCreateSparseOpDescriptorMPSGraphDepthwiseConvolution2DOpDescriptorMPSGraphDepthwiseConvolution3DOpDescriptorMPSGraphDeviceMPSGraphExecutableMPSGraphExecutableExecutionDescriptorMPSGraphExecutableSerializationDescriptorMPSGraphExecutionDescriptorMPSGraphFFTDescriptorMPSGraphGRUDescriptorMPSGraphImToColOpDescriptorMPSGraphLSTMDescriptorMPSGraphObjectMPSGraphOperationMPSGraphPooling2DOpDescriptorMPSGraphPooling4DOpDescriptorMPSGraphRandomOpDescriptorMPSGraphShapedTypeMPSGraphSingleGateRNNDescriptorMPSGraphStencilOpDescriptorMPSGraphTensorMPSGraphTensorDataMPSGraphTypeMPSGraphVariableOp
Structures
Type Aliases
MPSGraphCompilationCompletionHandlerMPSGraphCompletionHandlerMPSGraphControlFlowDependencyBlockMPSGraphExecutableCompletionHandlerMPSGraphExecutableScheduledHandlerMPSGraphForLoopBodyBlockMPSGraphIfThenElseBlockMPSGraphScheduledHandlerMPSGraphWhileAfterBlockMPSGraphWhileBeforeBlock
Enumerations
MPSGraphDeploymentPlatformMPSGraphDeviceTypeMPSGraphExecutionStageMPSGraphFFTScalingModeMPSGraphLossReductionTypeMPSGraphNonMaximumSuppressionCoordinateModeMPSGraphOptimizationMPSGraphOptimizationProfileMPSGraphOptionsMPSGraphPaddingModeMPSGraphPaddingStyleMPSGraphPoolingReturnIndicesModeMPSGraphRNNActivationMPSGraphRandomDistributionMPSGraphRandomNormalSamplingMethodMPSGraphReductionModeMPSGraphResizeModeMPSGraphResizeNearestRoundingModeMPSGraphScatterModeMPSGraphSparseStorageTypeMPSGraphTensorNamedDataLayout