Hacker News new | ask | show | jobs
by J0-nas 3005 days ago
I like both Swift and Tensorflow. But how is that going to work?

As far as I understand MacOS has no official Nvidia support (=> no Cuda), which is (at least) advised if you want to use a GPU for computing. Using OpenCL instead of CUDA would require building Tenfowlow from source. The OpenCL support is not as mature as with CUDA, so I imagine you could run into unexpected (performance) problems.

On windows, you have an excelent CUDA but lackluster Swift support.

Will they add OpenCL as a "first class backend" for Tensorflow or rather expect a "first class" support of Swift on Linux and Windows? Otherwise who is going to use it?

3 comments

People rarely train ML models on macOS for the reason you mentioned. Most machine learning work happens on Linux, so this should work well there.

TensorFlow supports a standalone server mode where it receives computation graphs and executes them. This is nice because then you can remotely execute on any accelerator (Cloud TPU, multi-worker multi-GPU) from your laptop.

In their demo, they did exactly that with a Cloud TPU: it connected to a TensorFlow server that executed the machine learning training part of the program.

I agree, I just had in mind that Apple just now added/announced support for external GPUs. Besides Image+Video edditing, I though general computing tasks is a use case they had in mind. It's not like Gaming is big on MacOS.
>TensorFlow supports a standalone server mode where it receives computation graphs and executes them. This is nice because then you can remotely execute on any accelerator (Cloud TPU, multi-worker multi-GPU) from your laptop.

Where can I find more documentation on this? I’ve been looking for something exactly like this.

CUDA has been available on macOS since 2010:

https://www.nvidia.com/object/mac-driver-archive.html

I currently have an NVIDIA 980 GTX in my 2010 Mac Pro and it works great (no additional drivers needed but NVIDIA also have downloadable drivers).

Coincidentally, macOS added support today for external graphics cards so you could add a set of external cards to any Mac with Thunderbolt 3 ports.

In any case, Swift on macOS has built-in support for Metal-compute (which works on any card) and CoreML which can be integrated with Tensorflow.

https://developer.apple.com/metal/

https://developer.apple.com/documentation/coreml

Training on an Apple device (read: overpriced device) is idiotic, nobody does that.