Member-only story
Running TensorFlow Applications on Apple Silicon Mac
Optimizing Your TensorFlow Application with Metal Performance Shaders (MPS)
In my earlier article, I talked about how to use Apple’s MPS (Metal Performance Shaders) to speed up the inferencing of your Hugging Face models.
MPS, or Metal Performance Shaders, is a framework developed by Apple to provide highly optimized, low-level GPU acceleration for machine learning and graphics tasks on Apple devices, including those with Apple silicon (like the M1, M2, and M3 chips).
What if you are training your own models using TensorFlow? In this short article, I will guide you on how to leverage MPS to accelerate your neural network training. You’ll also discover when using MPS is advantageous and when sticking with the CPU might be the better option.
Creating Virtual Environments
For this article, I will create two virtual environments — one for running TensorFlow on CPU and one for running TensorFlow on MPS.