Getting Started with tensorflow-metal PluggableDevice

Accelerate training of machine learning models with TensorFlow right on your Mac. Install TensorFlow v2.5 and the tensorflow-metal PluggableDevice to accelerate training with Metal on Mac GPUs. You can learn more about TensorFlow PluggableDevices here.

OS Requirements

  • macOS 12.0+

Currently Not Supported

  • Multi-GPU support
  • Acceleration for Intel GPUs
  • V1 TensorFlow Networks

Installation Instructions

Environment Setup:

x86 : AMD

(Optional) Create venv: python3 -m venv ~/tensorflow-metal

source ~/tensorflow-metal/bin/activate
python -m pip install -U pip

arm64 : M1

Download and install Conda env:

chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate

Install the Tensorflow dependencies:

conda install -c apple tensorflow-deps

Install base tensorflow:

python -m pip install tensorflow-macos

Install metal plugin:

python -m pip install tensorflow-metal