7 ms·
Although I am a python guy, if I had to bet on an alternative language here - its going to be Swift. The amount of evangelism money that Google is spending on
by sandGorgon 7y ago
Although I am a python guy, if I had to bet on an alternative language here - its going to be Swift.
The amount of evangelism money that Google is spending on Tensorflow is staggering. Its not just t-shirts, but an entire ecosystem - TensorBoard.dev, Tensorflow Privacy, TF Enterprise, Explainable AI Beta, free TPU on Google Colab etc.
And all of them will soon be backed using Tensorflow Swift (https://www.tensorflow.org/swift https://www.tensorflow.org/swift). This is MNIST for Swift Tensorflow - https://github.com/tensorflow/swift-models/blob/master/Datasets/MNIST/MNIST.swift https://github.com/tensorflow/swift-models/blob/master/Datas... . Mind you this is runnable on Google Colab using TPU hardware acceleration in swift.
Swift vs Rust is a very political thing...but previous discussions on HN have been tilted in favor of Swift [1]
And we havent even touched on the elephant in the Room - Swift may soon hook into OSX Metal (which is arguably the only way to do GPU AI on macbooks now that the nvidia-Apple CUDA divorce is official [2] ). You can already call Metal from Swift...but not write shaders directly IMHO.
[1] https://cloud.google.com/explainable-ai/ https://cloud.google.com/explainable-ai/
[2] https://gizmodo.com/apple-and-nvidia-are-over-1840015246 https://gizmodo.com/apple-and-nvidia-are-over-1840015246
- Roritharr 7y agoThis is really new to me, I always thought of Swift as the iOS thing to look into when doing something there. Very interesting that Google is pushing Swift for their Tensorflow Platform. Any ideas why Swift is of interest for Google?
- bpicolo 7y agoSwift playgrounds seem very much aligned with notebook style ML development. They're in many ways a much more powerful version of notebooks. https://www.apple.com/swift/playgrounds/ https://www.apple.com/swift/playgrounds/
- jorgemf 7y agoThey hired one of the Swift leaders for the tensor flow team
- Abishek_Muthian 7y agoYou can read why Tensorflow team chose Swift here[1]. [1]https://github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md https://github.com/tensorflow/swift/blob/master/docs/WhySwif...
- k__ 7y agoI had the feeling Swift was much higher level than Rust and it also didn't bring much new to the table.
- hellofunk 7y agoI think the OP is making that point that Python was successful because of how relatively simple and high-level it is, thus Swift has potential in that area for the same reason. Rust is hardly approachable by "the masses", certainly all the ML-first engineers who are not as hard-core on the programming mindshare, hence why Python became king.
- throwlaplace 7y ago>And all of them will soon be backed using Tensorflow Swift Lol at this. It's ~5 years before S4TF has feature parity with TF let alone pytorch. I watch their design meetings almost every Friday (they're public) and not only is the core autodiff runtime nowhere near 1.0 (just a couple of weeks ago they were talking about replacing their bespoke system with XLA) there's almost no differentiable function type library (nn.functional). Not to mention ecosystem (there are probably, at most, 20 people, including the S4TF team, consistently using S4TF). This is not to say that they're not doing great work but that's it's far off. Edit: I forgot to also say they're going through the Swift evolution process (since they're building the autodiff into the Swift compiler) and it's completely unknown whether it'll be accepted. I have no idea what will happen to the project if it doesn't but if they end up having to maintain their own Swift runtime then S4TF is dead in the water because no one will be comfortable deploying two runtimes and even then no one will trust Google to maintain.
- justicezyx 7y agoHow can I audit the Friday design meeting?
- asparagui 7y agohttps://docs.google.com/document/d/1Fm56p5rV1t2Euh6WLtBFKGqI43ozC3EIjReyLk-LCLU/edit#heading=h.s0dsh2pzge57 https://docs.google.com/document/d/1Fm56p5rV1t2Euh6WLtBFKGqI...
- asparagui 7y agoAs one of those 20 people, I feel like I'm in good company! Five years is pessimistic. The core library is still in a state of flux, but the team is getting the fundamentals hammered out. Once the foundation is in place, adding higher level apis should be relatively straightforward. Re: XLA/MLIR, s4tf is actively trying to coordinate with other groups within google. Whatever short term losses there are in time/energy will be paid off down the road when the project can piggyback off other people's progress. Finally, while the swift evolution process isn't going as quickly as would be desired, the changes needed to merge the tensorflow branch have been identified and are being worked on. It's just a matter of time till the two projects are in sync.
- jorgemf 7y agoI whish it was kotlin instead of Swift. But as much as I want to move away from python, there are reasons to stick with it (ML libraries and low entry barrier for non programers)
- mark_l_watson 7y agoWhen first announced, I was very upbeat on S4TF and the XCode and Swift drops with TF and some examples more or less worked and were interesting. Since the first early release, which largely worked for me, subsequent releases have generally not worked for me. I even had much more trouble with S4TF than, for example, the Haskell TF bindings that always take a bit of setup since I don’t use the provided docker setup. A little off topic, but, the Julia Flux ML library is worth looking at if you wanna “turtles all the way down” setup.
- rob74 7y agoWhile Swift may be the "latest and greatest" language with official support, if you look at https://www.tensorflow.org/api_docs https://www.tensorflow.org/api_docs, it's only one of several (the others being C++, Java, JS, Go and of course Python). Plus, there are community-supported bindings for C#, Haskell, Julia, Ruby, Rust and Scala). Just to make the picture complete...
- throwlaplace 7y agoSwift for tensor flow aren't bindings - it's a ground up rearchitecting of tensorflow
- pjmlp 7y agoFor Mac OS only apparently.
- throwlaplace 7y agonot true https://github.com/tensorflow/swift/blob/master/Installation.md https://github.com/tensorflow/swift/blob/master/Installation...
- pjmlp 7y agoHaving a package available for a specific OS doesn't mean it is usable, specially when it still requires conditional compilation to import either Darwin or Glibc, instead of Foundation. And I don't see any Windows there. Then there is the whole set of libraries that only compile on Apple platforms, no IDE, no Playgrounds and so on.
- throwlaplace 7y ago>specially when it still requires conditional compilation to import either Darwin or Glibc, instead of Foundation. you don't need to compile from source - binaries are distributed (if you actually read my link instead of assuming it was just github source you would see that). >And I don't see any Windows there. yes they're aware of this and it's being worked on >Then there is the whole set of libraries that only compile on Apple platforms, no IDE, no Playgrounds and so on. you're moving goal posts in order to be able to have an axe to grind. your comment was >For Mac OS only apparently. the fact that there's a runtime that runs on linux shows that that was incorrect. >set of libraries that only compile on Apple platforms i don't know what you're talking about here - s4tf libraries compile on all platforms e.g. https://github.com/eaplatanios/swift-rl https://github.com/eaplatanios/swift-rl >no IDE, no Playgrounds and so on. i don't see how xcode being developed by apple (not the s4tf team) has anything to do with whether s4tf is multiplatform.
- eeZah7Ux 7y ago> The amount of evangelism money that Google is spending Same for Rust, Swift, Go... it's like we are in another bubble like the dot-com and everything is hype driven.
- microcolonel 7y agoWell... not everything, Rust is actually good. Just sit back enjoy the effects of the investment in this stuff, and don't worry about other people being foolish with their money.
- zozbot234 7y agoEven Go is not that bad tbh. It's basically Java/.NET done right, and that makes it quite appropriate for some uses.
- pas 7y agoI still have no idea how to get/run/make/compile/deploy Go stuff. Sure, there's some GOPATH, some packages, dep? go get? I have no idea how, but 1-2 years ago when Kubernetes was new I tried it, and somehow got it to build (obviously I must have been using the stuff from the README) - but I haven't learned it. Whereas with Rust? It's cargo. Done. That's up. Or rustup if you don't have anything yet. With Java? It's IntelliJ or the OpenJDK.
- jeremyfranco 7y ago`go run` doesn't seem too hard to me. https://golang.org/cmd/go/#hdr-Compile_and_run_Go_program https://golang.org/cmd/go/#hdr-Compile_and_run_Go_program
- pas 7y agoI haven't encountered it so far. Last time I fiddled with something Go based was wit cfssl (cloudflare's excellent PKI thingie), and that uses something else. I don't remember what, it's in the GitHub Action YML file now. (Which alas turned out to be a big hot air pipeline :// ) I plan on learning a bit more about Go, but last time with the 2.0 proposal and the go mod/dep thing it seemed like there will be some streamlining, so I decided to postpone the immersion into the Go-cean.
- The_rationalist 7y agoIt's not obvious to everyone yet but the modern language that will become the most mainstream is obviously Kotlin. It has almost all modern language features, a ton of justified syntax sugars, and is 100% compatible with the Java ecosystem making it the most production ready among "modern languages" The only other language with such a property is to my knowledge, typescript.
- hnaccy 7y agoEverything about TF on Swift says zombie project. I'll be amazed if it ever gets any significant foothold in the ML world.
- Abishek_Muthian 7y ago>And we havent even touched on the elephant in the Room - Swift may soon hook into OSX Metal Not sure whether I understood your statement correctly, but you can use Swift for using metal API already. Swift is not the bottleneck for TensorFlow, PyTorch like open-source machine learning library appearing for macOS based on metal, it is the closed nature of mac ecosystem itself. Look at the flak Google, Facebook get regarding these projects in-spite of them being open-source. If an equivalent metal (only) based open-source machine learning of this scale did pop up with Apple's help; it may not go well with the ML/DL community as sharing & collaboration is valued high here. Apple has even started to publishing open ML papers to attract talent. Then again, Apple doesn't get as much scrutiny as Google/Facebook does with the tech community, take a look at any HN thread on GoLang/Swift; the discussion on the former goes to the company rather than the programming language as in the case of latter in-spite of both being open-source.
- sandGorgon 7y agoI'm aware that you can hook into metal using swift already. I meant the shader language (which is a variant of c++), though there are issues and proposals to make it swift centric.
- ComputerGuru 7y agoI don’t know why you are painting this as Swift vs Rust when they are apples to oranges. Why so defensive? They’re drastically different languages operating at different abstraction levels with different (though overlapping) use cases, with different motivations and design goals.
- hellofunk 7y agoSwift for writing Metal shaders? That's the first I've heard of this, and honestly I find that doubtful but what do I know.