LOGO

TensorFlow on Mac M1: Unleashing GPU Power

November 18, 2020
TensorFlow on Mac M1: Unleashing GPU Power

A newly released, Mac-compatible version of the machine learning framework TensorFlow delivers substantial enhancements in performance. While a significant portion of this improvement stems from the recent enablement of GPU utilization for training processes – a feature previously absent – devices equipped with the M1 chip demonstrate even greater speedups, indicating that further optimizations for popular workflows are on the horizon.

The upgraded Mac version, as detailed on both the TensorFlow and Apple websites, exhibits over a tenfold increase in speed for typical training operations in optimal scenarios.

This advancement is noteworthy for machine learning professionals who frequently experience delays while their models are being trained. However, the fact that earlier TensorFlow iterations relied solely on the CPU when running on Macs likely restricted the number of users encountering this issue. (The majority of extensive machine learning training is performed using cloud-based resources.)

The transition from CPU-exclusive processing to utilizing both the CPU and GPU accounts for a considerable portion of the performance gains, as evidenced by benchmark results on an Intel-based Mac Pro, which reveal substantial improvements on identical hardware. Training durations that previously ranged from 6 to 8 seconds are now completed in mere fractions of a second.

This is not to diminish the capabilities of the M1 chip; however, the latest M1 Macs also feature updated GPUs, meaning the reduction in task completion time from approximately 10 seconds on a 2019 MacBook Pro to under 2 seconds on a new M1 machine cannot be solely attributed to Apple’s proprietary silicon.

I reached out to Apple for additional data, specifically performance figures for an M1 device running unoptimized code, which would clearly illustrate the extent of the improvements. However, a company spokesperson indicated that such data is currently unavailable.

Regardless, developers will likely find the enhanced battery life and thermal management of M1 devices particularly valuable. While performance increases are beneficial, they are less impactful if the machine overheats, its fan operates at maximum speed, and it requires frequent recharging – often within an hour. Fortunately, the M1 appears to exhibit exceptional efficiency under load, conserving battery power and maintaining reasonable temperatures.

Expect to see more announcements along the lines of “now performs better on M1” as the new Macs become more widely available and major software companies release updates they have been preparing for the past several months.

#tensorflow#m1#mac#apple silicon#gpu#machine learning