> For the complete documentation index, see [llms.txt](https://aisuko.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aisuko.gitbook.io/wiki/ai-techniques/large-language-model/metal.md).

# Metal

## Overview

<mark style="color:red;">**Metal is Apple's own GPU framework**</mark> that allows developers to have <mark style="color:red;">**low-level access to the GPUs**</mark> on iPhones and <mark style="color:red;">**Macs**</mark> for rendering 3D graphics and high-performance computing.

It powers hardware-accelerated graphics on Apple platforms by providing a low-overhead API, and rich shading language, tight integration between graphics and compute, and an unparalleled suite of GPU profiling and debugging tools.

Metal allows the computation to be executed on the GPU for Apple devices.

### Metal Performance Shaders(MPS)

<mark style="color:red;">**It is a framework that exposes Metal machine learning APIs**</mark> and <mark style="color:red;">**can be used to accelerate machine learning tasks**</mark> on Apple devices.

MPS Graphs is a part of the MPS framework that provides a graph-based API for machine learning computations.

MPS Graph can be used to build and execute machine learning graphs on the GPU. It provides a set of operations that can be used to build ML models. such as:

* convolution
* pooling
* activation functions

<mark style="color:red;">**Metal can be used to accelerate PyTorch model training on macOS**</mark>, and the MPS backend extends the PyTorch framework, providing scripts and capabilities to set up and run operations on Mac.

The MPS framework optimizes compute performance with kernels that are fine-tuned for the unique characteristics of each Metal GPU family.

## Reference

{% embed url="<https://developer.apple.com/documentation/metal/performing_calculations_on_a_gpu>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://aisuko.gitbook.io/wiki/ai-techniques/large-language-model/metal.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
