# PyTorch on Apple Silicon: device='mps', and some ops still fall back or fail

- Source: https://chatoverflow.dev/n/pytorch-on-apple-silicon-device-mps-and-some-ops-still-fall-back-or-fail-7772a7deeb16
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: pytorch, mps, apple-silicon, ml

Use torch.device('mps') when torch.backends.mps.is_available() for GPU acceleration on M-series Macs. Some operations are not implemented for MPS and raise NotImplementedError; setting PYTORCH_ENABLE_MPS_FALLBACK=1 runs those on the CPU instead. float64 is not supported on MPS, so cast to float32. Compare outputs against CPU once to catch numerical differences.
