TechnologiesMachine Learning & AI

MLCompute

iOSmacOStvOSwatchOSvisionOS

MLCompute provides low-level, GPU- and CPU-accelerated primitives for building, training, and running neural networks on iOS, macOS, and tvOS. You assemble a network from layers such as MLCConvolutionLayer, MLCFullyConnectedLayer, MLCBatchNormalizationLayer, MLCLSTMLayer, and MLCMultiheadAttentionLayer, configure them with descriptors like MLCConvolutionDescriptor and MLCLSTMDescriptor, and connect them into an MLCGraph that you execute as an MLCInferenceGraph for inference. For training, you compute loss with MLCLossLayer and update weights using optimizers including MLCAdamOptimizer, MLCAdamWOptimizer, and MLCRMSPropOptimizer, while MLCDevice selects the CPU or GPU on which the work runs.

Essentials 7

Core types for selecting hardware and representing the tensors that flow through a network.

  • Cl
    MLCDevice
    @class MLCDevice
  • Cl
    MLCPlatform
    @class MLCPlatform
  • Cl
    MLCTensor
    @class MLCTensor
  • Cl
    MLCTensorData
    @class MLCTensorData
  • Cl
    MLCTensorDescriptor
    @class MLCTensorDescriptor
  • Cl
    MLCTensorParameter
    @class MLCTensorParameter
  • Cl
    MLCTensorOptimizerDeviceData
    An object that holds per-device optimizer state associated with a tensor.

Graphs and Execution 3

Types for assembling layers into a graph and executing it for inference or training.

  • Cl
    MLCGraph
    @class MLCGraph
  • Cl
    MLCInferenceGraph
    @class MLCInferenceGraph
  • Cl
    MLCTrainingGraph
    @class MLCTrainingGraph

Layer Foundation 1

The base layer class from which all neural network layers derive.

  • Cl
    MLCLayer
    @class MLCLayer

Convolution and Pooling Layers 6

Layers that perform convolution, pooling, and upsampling over spatial tensors.

  • Cl
    MLCConvolutionLayer
    @class MLCConvolutionLayer
  • Cl
    MLCConvolutionDescriptor
    @class MLCConvolutionDescriptor
  • Cl
    MLCPoolingLayer
    @class MLCPoolingLayer
  • Cl
    MLCPoolingDescriptor
    @class MLCPoolingDescriptor
  • Cl
    MLCUpsampleLayer
    @class MLCUpsampleLayer
  • Cl
    MLCPaddingLayer
    @class MLCPaddingLayer

Fully Connected and Attention Layers 9

Layers for dense projections, embeddings, recurrence, and multihead attention.

  • Cl
    MLCFullyConnectedLayer
    @class MLCFullyConnectedLayer
  • Cl
    MLCMatMulLayer
    @class MLCMatMulLayer
  • Cl
    MLCMatMulDescriptor
    @class MLCMatMulDescriptor
  • Cl
    MLCEmbeddingLayer
    @class MLCEmbeddingLayer
  • Cl
    MLCEmbeddingDescriptor
    @class MLCEmbeddingDescriptor
  • Cl
    MLCLSTMLayer
    @class MLCLSTMLayer
  • Cl
    MLCLSTMDescriptor
    @class MLCLSTMDescriptor
  • Cl
    MLCMultiheadAttentionLayer
    @class MLCMultiheadAttentionLayer
  • Cl
    MLCMultiheadAttentionDescriptor
    @class MLCMultiheadAttentionDescriptor

Activation and Normalization Layers 8

Layers that apply nonlinear activations, softmax, dropout, and normalization.

  • Cl
    MLCActivationLayer
    A layer that applies a nonlinear activation function to its input tensor.
  • Cl
    MLCActivationDescriptor
    @class MLCActivationDescriptor
  • Cl
    MLCSoftmaxLayer
    @class MLCSoftmaxLayer
  • Cl
    MLCDropoutLayer
    @class MLCDropoutLayer
  • Cl
    MLCBatchNormalizationLayer
    @class MLCBatchNormalizationLayer
  • Cl
    MLCGroupNormalizationLayer
    @class MLCGroupNormalizationLayer
  • Cl
    MLCInstanceNormalizationLayer
    @class MLCInstanceNormalizationLayer
  • Cl
    MLCLayerNormalizationLayer
    @class MLCLayerNormalizationLayer

Elementwise and Math Layers 4

Layers performing arithmetic, comparison, reduction, and matrix transformations.

  • Cl
    MLCArithmeticLayer
    @class MLCArithmeticLayer
  • Cl
    MLCComparisonLayer
    @abstract Compare layer.
  • Cl
    MLCReductionLayer
    @class MLCReductionLayer
  • Cl
    MLCGramMatrixLayer
    @class MLCGramMatrixLayer

Tensor Shape and Routing Layers 8

Layers that reshape, slice, gather, scatter, concatenate, and select tensor data.

  • Cl
    MLCReshapeLayer
    @class MLCReshapeLayer
  • Cl
    MLCTransposeLayer
    @class MLCTransposeLayer
  • Cl
    MLCSliceLayer
    @abstract Slice layer is used to slice a given source.
  • Cl
    MLCSplitLayer
    @class MLCSplitLayer
  • Cl
    MLCConcatenationLayer
    @class MLCConcatenationLayer
  • Cl
    MLCGatherLayer
    @class MLCGatherLayer
  • Cl
    MLCScatterLayer
    @class MLCScatterLayer
  • Cl
    MLCSelectionLayer
    @abstract Selection layer is used to select elements from two tensors

Loss Layers 4

Layers and descriptors that compute training loss, including YOLO object-detection loss.

  • Cl
    MLCLossLayer
    @class MLCLossLayer
  • Cl
    MLCLossDescriptor
    @class MLCLossDescriptor
  • Cl
    MLCYOLOLossLayer
    @class MLCYOLOLossLayer
  • Cl
    MLCYOLOLossDescriptor
    @class MLCYOLOLossDescriptor

Optimizers 6

Optimizers and their descriptor that update network weights during training.

  • Cl
    MLCOptimizer
    @class MLCOptimizer
  • Cl
    MLCOptimizerDescriptor
    @class MLCOptimizerDescriptor
  • Cl
    MLCSGDOptimizer
    @class MLCSGDOptimizer
  • Cl
    MLCAdamOptimizer
    @class MLCAdamOptimizer
  • Cl
    MLCAdamWOptimizer
    @class MLCAdamWOptimizer
  • Cl
    MLCRMSPropOptimizer
    @class MLCRMSPropOptimizer

Execution Options 2

Option sets that control graph compilation and execution behavior.

  • St
    MLCGraphCompilationOptions
    @enum MLCGraphCompilationOptions
  • St
    MLCExecutionOptions
    @enum MLCExecutionOptions

Devices and Data Types 3

Enumerations identifying device targets, tensor data types, and weight initialization.

  • En
    MLCDeviceType
    @enum MLCDeviceType
  • En
    MLCDataType
    @enum MLCDataType
  • En
    MLCRandomInitializerType
    @enum MLCRandomInitializerType

Operation and Layer Configuration 11

Enumerations that select operations and modes for individual layers.

  • En
    MLCActivationType
    @enum MLCActivationType
  • En
    MLCConvolutionType
    @enum MLCConvolutionType
  • En
    MLCPoolingType
    Constants that specify the kind of pooling performed by a pooling layer.
  • En
    MLCPaddingType
    @enum MLCPaddingType
  • En
    MLCPaddingPolicy
    Constants that specify how a layer computes padding for its input.
  • En
    MLCSampleMode
    @enum MLCSampleMode
  • En
    MLCArithmeticOperation
    @enum MLCArithmeticOperation
  • En
    MLCComparisonOperation
    @enum MLCComparisonOperation
  • En
    MLCReductionType
    @enum MLCReductionType
  • En
    MLCSoftmaxOperation
    @enum MLCSoftmaxOperation
  • En
    MLCLSTMResultMode
    @enum MLCLSTMResultMode

Training Configuration 3

Enumerations that configure loss, regularization, and gradient clipping during training.

  • En
    MLCLossType
    @enum MLCLossType
  • En
    MLCRegularizationType
    @enum MLCRegularizationType
  • En
    MLCGradientClippingType
    @enum MLCGradientClippingType

Type Aliases 1

  • Ty
    MLCGraphCompletionHandler
    @abstract A callback completion handler you execute when a graph finishes execution.
← Machine Learning & AI