RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Frameworks & tools / MPS (Metal Performance Shaders)
Frameworks & tools

MPS (Metal Performance Shaders)

MPS is Apple's high-level Metal-based compute library, exposed in PyTorch as the mps device backend. Calling model.to("mps") runs on the Apple Silicon GPU through MPS kernels.

MPS is workable for inference of small models but historically incomplete: many ops fall back to CPU, FP16 is supported but BF16 is not on older silicon, and large allocations sometimes hit RuntimeError: MPS backend out of memory even with available unified memory due to the 80% allocation limit.

For local LLM inference, llama.cpp's native Metal kernels and MLX-LM both outperform PyTorch MPS by 1.5–3×. Use MPS for quick PyTorch experiments; use llama.cpp or MLX for production.

Practical example

A developer prototyping a fine-tuned Llama 3.1 8B classifier on an M2 MacBook Pro loads it with model.to("mps") in PyTorch and gets fast enough iteration for a Jupyter notebook — a few tokens per second is fine when you're debugging prompts, not benchmarking throughput. But when they move to serving it for a small team, they hit intermittent MPS backend out of memory errors on a 16 GB machine even though Activity Monitor shows 6 GB free, because MPS won't allocate past roughly 80% of unified memory regardless of what's actually available. Switching the same GGUF-converted weights to llama.cpp's Metal backend not only fixes the OOM ceiling but also roughly doubles tokens/sec, because llama.cpp's hand-written Metal kernels avoid the CPU-fallback ops that silently tax PyTorch's MPS path for anything outside standard matmuls.

Related terms

MLX (Apple)Metal (Apple)

See also

hardware: apple-m4-maxtool: llama-cpptool: mlx-lm

Reviewed by Eruo Fredoline. See our editorial policy.

Buyer guides
  • Best Mac for local AI →
  • Best budget Mac →
When it doesn't work
  • MLX out of memory →
  • MPS fallback to CPU →
  • llama.cpp Metal crash →
Compare hardware
  • M4 Max vs RTX 4090 →
  • Mac Studio vs Windows AI PC →
Hardware
  • Apple M4 Max →