PyTorch Introduces GPU-Accelerated Training On Mac

This Article Is Based On The Research Article  'Introducing Accelerated PyTorch Training on Mac'. All Credit For This Research Goes To The Researchers of This Project 👏👏👏

Please Don't Forget To Join Our ML Subreddit

On Mac devices, older versions of PyTorch only used the CPU for training. This has recently changed, thanks to PyTorch’s revolutionary announcement. PyTorch announced support for GPU-accelerated PyTorch training on Mac in partnership with Apple’s Metal engineering team. With the introduction of PyTorch v1.12, developers and researchers can take advantage of Apple silicon GPUs for substantially faster model training, allowing them to do machine learning operations like prototyping and fine-tuning locally right on their Mac. PyTorch employs Apple’s Metal Performance Shaders (MPS) to provide rapid GPU training as the backend. The new gadget uses MPS’ Graph framework and tailored kernels to map machine learning computational graphs and primitives. The MPS backend enhances the PyTorch framework with scripts and capabilities for setting up and running operations on the Mac. MPS also optimizes compute performance using fine-tuned kernels for each Metal GPU family’s specific characteristics.


Because of its unified memory architecture, which gives the GPU direct access to the whole memory store, the Mac appears to be an appreciable platform for machine learning. Because of its architecture, users can efficiently train more extensive networks and batch sizes locally. This significantly lowers the price of cloud-based development and eliminates the need for extra local GPUs. The Unified Memory architecture improves end-to-end performance by lowering the data retrieval latency. There were also a lot of experimental studies to evaluate the performance speedup from accelerated GPU training and assessment to the CPU baseline. Installing the current Preview (Nightly) build on an Apple silicon Mac running macOS 12.3 or later with a native version (arm64) of Python is required to get started. Visit Apple’s Metal page for further information on Metal and MPS.

Source: https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/