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.

Learn more about TensorFlow PluggableDevices

OS Requirements

  • macOS 12.0+

Currently Not Supported

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

Installation Instructions

Step 1: Environment setup

x86 : AMD

Create virtual environment (recommended):

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

NOTE: python version 3.8 required

arm64 : Apple Silicon

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

NOTE: python versions 3.8 and 3.9 supported

Step 2: Install base TensorFlow

python -m pip install tensorflow-macos

Step 3: Install tensorflow-metal plugin

python -m pip install tensorflow-metal

Questions and Feedback

To ask questions and share feedback about the tensorflow-metal plugin, visit the Apple Developer Forum.