Live data from Hacker News

Apple M1 support for TensorFlow 2.5 pluggable device API

developer.apple.com

11–20 of 124 posts

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#11
post #8
post #7

I have found the M1 air fine for web browsing but kind of hard to install software on. Following the instructions: ----- python -m pip install tensorflow-macos ... ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly ----- (base) dave@daves-air ~ % uname -a Darwin daves-air.lan 20.5.0 Darwin Kernel Version 20.5.0: Sat M…

I run everything python under Rosetta. Easiest way is to install home brew for Intel processors then make an alias to that version for managing rosetta stuff

You’re missing out on a gigantic speed boost. If you haven’t checked lately check again, most of the big libraries have been recompiled over the last few months (tensorflow excluded apparently).

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#12
post #8
post #7

I have found the M1 air fine for web browsing but kind of hard to install software on. Following the instructions: ----- python -m pip install tensorflow-macos ... ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly ----- (base) dave@daves-air ~ % uname -a Darwin daves-air.lan 20.5.0 Darwin Kernel Version 20.5.0: Sat M…

I run everything python under Rosetta. Easiest way is to install home brew for Intel processors then make an alias to that version for managing rosetta stuff

Kinda silly to use Rosetta when the whole point of this is native support for TensorFlow on M1.

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#13
post #10
post #7

I have found the M1 air fine for web browsing but kind of hard to install software on. Following the instructions: ----- python -m pip install tensorflow-macos ... ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly ----- (base) dave@daves-air ~ % uname -a Darwin daves-air.lan 20.5.0 Darwin Kernel Version 20.5.0: Sat M…

I skipped the tensorflow-deps and the tensorflow-macos dependencies since it was trying to downgrade a bunch of stuff: $ pip install -U tensorflow-macos --no-deps That seemed to work for me at least.

Thank you.

The first time I did 'import tensorflow', the import line ran for a long time and then complained about flatbuffers being missing.

Then I ran several commands to install flatbuffers - all of which I could have sworn claimed it was already there, but then I tried the import again and it worked.

'import numpy' works too so the env feels complete enough.

My python binaries are coming from ~/miniforge3/bin

So all is well now, thx.

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#14
post #3

This is pretty cool to have more generic GPU-based support. Might also be related: Tensorflow Lite Core ML delegate enables running TFLite model on CoreML enabled iOS devices. https://www.tensorflow.org/lite/performance/coreml_delegate Would nice to see performance comparisons on M1 Mac/iPad for which way is more performance and efficient. (Admittedly TF vs TF-lite is a 100% apple to apple comparison, pun-intended).

Just running native models on OpenCL has existed for a while now, through PlaidML and other companies. Unfortunately you need CUDA support for custom kernels for a lot of modern architectures like Transformers, and AMD's CUDA transpiler leaves a lot to be desired.

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#15
post #9

I was able to install this fairly easily (much more so then the crap they dumped out here - https://github.com/apple/tensorflow_macos . Just take a look at the 200 github issues that were ignored for the most part...) I also noticed that in my project I got a decent speedup immediately when executing my model, but I have not run any benchmarks. But, where do you go to file bugs? Ask questions? etc. I am not a big Mac…

You can file bugs using the Feedback Assistant app in /System/Library/CoreServices/Applications, and you can ask questions on the Developer Forums at https://developer.apple.com/forums/>. Both will require you to have a (free) Apple ID.

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#16
Anyone know if this shows up as an actual GPU device? The last tensorflow-macOS thing did not. If you list devices using that, you’ll see only one: CPU:0.

Does this give a GPU:0 device? You can check via:

  import tensorflow as tf2
  from pprint import pprint as pp
  tf = tf2.compat.v1
  sess = tf.InteractiveSession()
  pp(sess.list_devices())
I’d check myself, but I’ve been so burnt by tensorflow 2 and M1 problems that I just don’t have the energy to figure out the inevitable compilation issues, and it sounds like at least one other person already has it running. Plus I’m on mobile.

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#18
post #5

M1 and AMD GPU support. I'm personally more interested in the latter as I haven't yet upgraded my MacBook Pro and I expect that my Vega 20 to be faster than M1 at ML training. The raw compute power of M1's GPU seems to be 2.6 TFLOPS (single precision) vs 3.2 TFLOPS for Vega 20. This can give you an estimate of how fast it would be for training. Just for reference Nvidia's flagship desktop GPU(3090)'s FP32 performance…

Vega 20 should be ~13.8 TFLOPs (single precision): https://www.anandtech.com/show/13923/the-amd-radeon-vii-revi...

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#19
post #8
post #7

I have found the M1 air fine for web browsing but kind of hard to install software on. Following the instructions: ----- python -m pip install tensorflow-macos ... ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly ----- (base) dave@daves-air ~ % uname -a Darwin daves-air.lan 20.5.0 Darwin Kernel Version 20.5.0: Sat M…

I run everything python under Rosetta. Easiest way is to install home brew for Intel processors then make an alias to that version for managing rosetta stuff

> I run everything python under Rosetta.

So basically the software that you require to run and do your work is still not available for Apple Silicon? In this case, Apple Silicon support for Python libraries.

The whole point of Apple Silicon is to supersede its Intel Mac counterparts and to run software natively with a noticeable performance increase, especially with software with high performance requirements.

In the case of python users and the ecosystem around it, it is still not ready.

Glad I sat that one out.

Re: Apple M1 support for TensorFlow 2.5 pluggable device API

#20
post #7

I have found the M1 air fine for web browsing but kind of hard to install software on. Following the instructions: ----- python -m pip install tensorflow-macos ... ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly ----- (base) dave@daves-air ~ % uname -a Darwin daves-air.lan 20.5.0 Darwin Kernel Version 20.5.0: Sat M…

I run everything on miniforge. Makes everything so much better. If you have the arm version of brew, just run "brew install --cask miniforge"
Post reply on HN