I yearn for the day when someone makes a nice, simple, "install this and python ML works fine with your GPU" package.
Apple M1 support for TensorFlow 2.5 pluggable device API
61–70 of 124 posts
Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#62Earlier quoted context omitted.
`pip install --upgrade pip` fixed this for me. (not in tensorflow directly, but while installing something else on my M1 last week which required numpy)
OK, so we’re in mid-2021, why is installing Python THAT HARD? I think the only reason Node is so popular is because it JUST WORKS. Windows, Mac, doesn’t matter. One-click installer and you got NPM as well and access to thousands of packages.
Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#63I 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…
`pip install --upgrade pip` fixed this for me. (not in tensorflow directly, but while installing something else on my M1 last week which required numpy)
First, I ran:
pip3 install virtualenv
cd ~
python3 -m virtualenv tfenv -p python3 --system-site-packages
Now you can activate your tensorflow env at any time by running this: source ~/tfenv/bin/activate
I alias this to `tf2` in my ~/.zprofile file: alias tf2='source ~/tfenv/bin/activate'
Open up a new terminal and run `tf2`. Now you're in a clean virtualenv, with none of the conda BS. The nice thing about this venv is that if you already have some libraries installed, you can just `import` them. No need to reinstall them for every venv, which I quite like.So, the goal is to install tensorflow-macos and tensorflow-metal, but the problem is that their pip3 command is failing with some obscure numpy error.
Here's the command that works:
pip3 install --no-dependencies tensorflow-macos tensorflow-metal absl-py wrapt opt-einsum gast astunparse termcolor flatbuffers
The way I arrived at that command was to run `pip3 install --no-dependencies tensorflow-macos tensorflow-metal`, open a python repl, and try 'import tensorflow as tf'. If it threw an error about package_foo, I added `package-foo` to the end of the command.That method worked for tracking down every library except absl (unknown library name). But googling pip3 install absl showed that it was named absl-py, not absl.
Now I can run python3, then this code:
import tensorflow as tf2; tf = tf2.compat.v1; sess = tf.InteractiveSession(); sess.list_devices()
and it shows I have both a CPU and GPU device! I'm really hyped about that. I've wanted tensorflow GPU on my laptop for... about two years? more?Note that it spits out a warning like this:
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
I'm going to leave it as-is, until problems pop up for me. But if you want to try to address it, try adding tensorboard to that pip3 install command above, and repeat the process I described to install any other dependencies.Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#64I find the benchmarks confusing. If we normalize, is Apple close to beating Nvidia?
Not on M1. However as M1 is a chiplet design, it's pieces are stackable like legos (to some degree). It is then supposed that with enough stacking, apple could get close to a dedicated GPU performance. However this is speculative.
It's a monolithic SoC, and while it is packaged with the RAM that's just closer integration of chips that would normally be on-motherboard or a DIMM?
Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#65Earlier quoted context omitted.
Python 3.9.4 | packaged by conda-forge | (default, May 10 2021, 22:10:52) [Clang 11.1.0 ] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow Init Plugin Init Graph Optimizer Init Kernel >>> tensorflow.config.list_physical_devices >>> tensorflow.config.list_physical_devices() [PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/phy…
Ohhhh snapppppp! Excitement level just shot way up. Thank you. God, it’ll be nice having a gpu for tensorflow. I’ve dreamed about this for like… a long time.
Ahh, I've never had a local GPU before. Thank you Apple Santa Claus, whoever your team is.
Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#66Earlier quoted context omitted.
Not on M1. However as M1 is a chiplet design, it's pieces are stackable like legos (to some degree). It is then supposed that with enough stacking, apple could get close to a dedicated GPU performance. However this is speculative.
M1 isn't a chiplet is it? It's a monolithic SoC, and while it is packaged with the RAM that's just closer integration of chips that would normally be on-motherboard or a DIMM?
Eg., just look at the M1 variations present atm: variable gpu cores.
The "chiplet" speculation is that given the M1's variable high-perf, low-perf and cpu cores, this can scale up.
Leaks at least are all pointing in a 32-core, Xeon-competitor direction. It is theoretically possible they could do the same with GPU count, and try to compete perhaps in the mid-pro gfx range.
Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#67Earlier quoted context omitted.
So Apple would need 16x its GPU Core, or 128 GPU Core to reach Nvidia 3090 Desktop Performance. Or roughly 480mm2 Die Size, 192W TDP excluding memory controller and interconnect. Doesn't look too bad for Nvidia, especially when you consider 3090 is still on Samsung 8nm, which is equivalent to TSMC 10nm, compared to 5nm on Apple M1.
Doesn't 3090 use well north of 400W of power?
Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#68Earlier quoted context omitted.
`pip install --upgrade pip` fixed this for me. (not in tensorflow directly, but while installing something else on my M1 last week which required numpy)
In case it doesn't fix it for anyone else, here's what worked for me. First, I ran: pip3 install virtualenv cd ~ python3 -m virtualenv tfenv -p python3 --system-site-packages Now you can activate your tensorflow env at any time by running this: source ~/tfenv/bin/activate I alias this to `tf2` in my ~/.zprofile file: alias tf2='source ~/tfenv/bin/activate' Open up a new terminal and run `tf2`. Now you're in a clean v…
ERROR: Could not find a version that satisfies the requirement tensorflow-macos (from versions: none)
ERROR: No matching distribution found for tensorflow-macos
But it turns out that was using an x86_64 version of Python3 - setting up an arm64 version (under /opt/homebrew) worked.Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#69Re: Apple M1 support for TensorFlow 2.5 pluggable device API
#70M1 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…