Skip to content

Unlock the full potential of your Apple Silicon-powered M3, M3 Pro, and M3 Max MacBook Pros by leveraging TensorFlow, the open-source machine learning framework. This repository is tailored to provide an optimized environment for setting up and running TensorFlow on Apple's cutting-edge M3 chips.

Notifications You must be signed in to change notification settings

ChaitanyaK77/Initializing-TensorFlow-Environment-on-M3-M3-Pro-and-M3-Max-Macbook-Pros.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

Initializing TensorFlow Environment on M3, M3 Pro and M3 Max Macbook Pros.

TensorFlow on M3, M3 Pro, and M3 Max MacBook Pros: Harnessing Computational Power with Apple Silicon

Description:

Unlock the full potential of your Apple Silicon-powered M3, M3 Pro, and M3 Max MacBook Pros by leveraging TensorFlow, the open-source machine learning framework. This repository is tailored to provide an optimized environment for setting up and running TensorFlow on Apple's cutting-edge M3 chips.

Key Features:

  1. Efficient ML Workflows: Streamline your machine learning workflows on Apple Silicon for enhanced efficiency and performance.

  2. Tailored Configurations: Discover configurations and settings specifically designed for M3, M3 Pro, and M3 Max MacBook Pros, ensuring optimal resource utilization.

  3. Performance Boost: Leverage the native capabilities of Apple Silicon to achieve accelerated training and inference speeds, tapping into the computational prowess of your M3 MacBook Pro.

  4. Compatibility and Updates: Stay up-to-date with the latest TensorFlow releases and compatibility updates tailored for Apple Silicon architecture.

Getting Started: Follow all the necessary steps mentioned below.

Steps

  1. Install Homebrew from https://brew.sh.
  2. Download Miniforge3 for macOS arm64 chips.
  3. Install Miniforge3 into the home directory of your Macbook Pro.
  4. Type the following Bash code in the terminal.
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
  1. Restart terminal to prevent any errors.
  2. Create a new directory to setup the custom TensorFlow environment.
mkdir tensorflow-test
cd tensorflow-test
  1. Type ls in terminal to crosscheck the current directory.
  2. Initialize and activate the Conda environment.
conda create --prefix ./env python=3.8
conda activate ./env
  1. Install TensorFlow dependencies from Apple Conda.
conda install -c apple tensorflow-deps
  1. Install base TensorFlow.
python -m pip install tensorflow-macos
  1. Install Apple's tensorflow-metal to utilize the Apple Metal (Apple's GPU framework) for M3, M3 Pro, M3 Max GPU access.
python -m pip install tensorflow-metal
  1. Install data science packages.
conda install jupyter pandas numpy matplotlib scikit-learn
  1. Start Jupyter Notebook.
jupyter notebook
  1. Type the following code to check TensorFlow version/GPU access.
import numpy as np
import pandas as pd
import sklearn
import tensorflow as tf
import matplotlib.pyplot as plt

# Check for TensorFlow GPU access
print(f"TensorFlow has access to the following devices:\n{tf.config.list_physical_devices()}")

# See TensorFlow version
print(f"TensorFlow version: {tf.__version__}")

That's It!!

You should now be able to run all your ML models on Apple's GPU.

Thank You.

About

Unlock the full potential of your Apple Silicon-powered M3, M3 Pro, and M3 Max MacBook Pros by leveraging TensorFlow, the open-source machine learning framework. This repository is tailored to provide an optimized environment for setting up and running TensorFlow on Apple's cutting-edge M3 chips.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published