federated icon indicating copy to clipboard operation
federated copied to clipboard

anyway to install tff with tensorflow-metal

Open yshen22 opened this issue 4 years ago • 3 comments

I'm using my gpu version on macos(tensorflow-metal). https://github.com/apple/tensorflow_macos Tensorflow version:tensorflow2.4.0-rc0 However I can not installing a tff version on tensorflow2.4.0-rc0 When I am trying to install tensorflow_federated using pip install tensorflow_federated==0.18.0, it would automatically install another cpu version of tensorflow macos and replace tensorflow2.4.0-rc0 with tensorflow2.4.0cpu. Anyway to have a gpu version of tff in macos?

yshen22 avatar Jun 24 '21 20:06 yshen22

In a pyhton3.8 virtual env, for the tf base version 2.5 and tensorflow_macos==2.5.0 and tensorflow-metal seem to work:

SYSTEM_VERSION_COMPAT=0 pip install tensorflow-macos==2.5.0 tensorflow-federated==0.19.0 tensorflow-metal 

yingding avatar Nov 20 '21 19:11 yingding

I tested the tff example from https://www.tensorflow.org/federated, it is kind of weird to see the cpu is faster. But why?

| type      | time in secs | 
|-----------|--------------|
| cpu       | 3.46         |
| gpu/metal | 8.57         |

yingding avatar Nov 20 '21 19:11 yingding

An update on this with an intel based MBP works with [email protected]

SYSTEM_VERSION_COMPAT=0 pip install tensorflow-macos==2.8.0 tensorflow-metal==0.4.0;
SYSTEM_VERSION_COMPAT=0 pip install tensorflow-federated==0.20.0

yingding avatar Mar 20 '22 12:03 yingding

Closing as this does not appear to be an issue anymore.

michaelreneer avatar Aug 19 '22 21:08 michaelreneer