Swift for TensorFlow
tensorflow.org
tensorflow.org
Swift fits the requirements. As Chris Lattner is driving this, no one could ask that he choose something else.
But Rust also would have been a plausible choice. As the Rust team is very interested in applying the language to exciting new use-cases, it's a bit of a loss for it to miss out on collaboration here. Perhaps this could inspire similar work on the Rust side; many of the concepts would likely transfer straightforwardly.
I can't see Rust competing on similar merits. Swift however (like Kotlin to which it is extremely similar) seem to be in the right sweet spot in terms of languages designed for usability, with a lot of useful f.p. constructs.
I'm not saying Rust doesn't have it's sweet spot - but I can't see that as a general purpose language. (Likewise Haskell and Scala - that's just my opinion though :))
You can write Scala as Java or Haskell or anything in between.
I was under the impression that most Python libraries for machine learning (numpy, scipy, tensorflow, etc) are running C code under the hood. How much is Python's performance really holding it back?
You literally just described Julia. The Julia core developers are all part of Julia Computing (which contracts for ML work) or are somehow associated with data science and machine learning. For this reason there's a lot of on tooling for building computational graphs / performing AD, compiling for TPUs, etc. It's built on LLVM. It has loads of packages for optimization, machine learning (like 4 NN libraries, a few different ways to work with GPUs), data science, etc. And type-stable Julia code is as fast as C. So it's interesting that this gets some kind of noteworthy announcement when it's already been done and already been done well.
Also see Chris's introductory post for the project: https://groups.google.com/a/tensorflow.org/forum/#!topic/swi...
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?
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.
Where can I find more documentation on this? I’ve been looking for something exactly like this.
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.
I'm not native English speaker, so I wonder...
I guess i don't really understand why anyone would think this is surprising. Like, i understand the knee jerk reaction, but I guess i don't understand why i would try to force him to do something else.
Chris is a high level engineer who decided he wanted to prototype and build a system in a language he's familiar with and feels is a good match for his problem space. People generally agree it's a good match for his problem space and his familiarity/etc makes him more effective in getting things done there. This doesn't mean anything else is a bad match (general purpose languages are often good at multiple use cases, hence the reason they are considered general purpose)
Why would I try to stop him and force him to use another language?
What tangible benefit would such a thing bring Google?
It's not like Google is a bunch of language zealots who think everything must be written in language X - it already supports a number of production languages, because different languages tend to have different tradeoffs for different use cases.
Outside of that framing, i have trouble thinking of a sane goal that would be served by trying to force him to do it in a different language.
But if i'm missing something, i'd love to know!
Go just seems like a much worse match for this problem than Swift. Wrong type system, wrong compiler architecture, wrong runtime design, wrong language evolution strategy. This is in so many ways a great match for Swift.
Sure it's not necessarily.
Building on top of something that is yours, simply because it is yours, is in fact a form of zealotry.
It is fairly unrelated (IMHO) to building on top of something that is yours so you can make sure you experience what your customers will experience.
IE Building your own ML on top of your Java thing because you want your customers to build ML on top of your Java thing would make sense. Building your own ML on top of your Java thing just because it's yours does not by itself make sense. (IE it has to provide some particular value over not building it yourself, etc, otherwise it's pretty clear zealotry)
-Chris
It'll be nice to use the Xcode build system, but given that Xcode isn't open source, I wonder how this will play out. Is there a way to use Bazel natively with Swift ?
Exciting times though !
Yes. https://github.com/bazelbuild/rules_apple/blob/master/doc/ru...
All this works no matter how you choose to build your code: Xcode, Bazel, SwiftPM, makefiles, whatever. Also, since ML scripts are frequently small, a simple #! script like we showed in the demo is perfectly reasonable for many things.
-Chris
Is it related to Apple's Swift language?
https://groups.google.com/a/tensorflow.org/forum/#!topic/swi...
Quoth: "Is it me or did the audience had absolutely no clue what that presentation was about?" One day too early but it couldn't emphasize "April" more often in the article.
Quite a genius take on Apples openness and and wannabe-AI-ness.
[0]: https://medium.com/tensorflow/highlights-from-tensorflow-dev...
@Google: Hire me or ask nicely and I'll remove this so that your genius joke is not spoiled.