Live data from Hacker News

A Differentiable Programming System to Bridge ML and Scientific Computing

arxiv.org

1–10 of 75 posts

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#2
I’ve just given this a cursory read but wanted to say that this looks really exciting. Julia in general seems like such an exciting language.

I’ve recently switched some Fortran simulations at work for a pure Julia implementation and it is great fun to write. DifferentialEquations is a phenomenal piece of work!

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#3

I’ve just given this a cursory read but wanted to say that this looks really exciting. Julia in general seems like such an exciting language. I’ve recently switched some Fortran simulations at work for a pure Julia implementation and it is great fun to write. DifferentialEquations is a phenomenal piece of work!

Is the performance equivalent in your scenario?

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#4
Happy that this paper finally made it to arxiv. The biggest reason for writing it was to try and showcase some of the breadth of applications we see for really high quality first class AD support at the language level. There are several communities that need this technology, so it makes sense to try and build one system that can address all of them and share tricks. I'm also hoping this gives people a sense of why our list of feature requirements for this system is so extensive (pervasive custom gradients, higher order AD, mixed mode, ultra fast scalar AD, etc). These days AD is often discussed only in the context of deep learning, but as the frontiers of deep learning are pushed and hybrid models become more and more popular, I'm expecting our focus on generality to pay off here.

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#6

Is this somehow similar to the new Swift Automatic Differentiation feature? https://github.com/tensorflow/swift/blob/master/docs/Automat...

Does Swift have an equivalent to Python‘s numpy?

It seems to lack a nice way of doing vector and matrix operations.

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#7
An alternative approach https://www.microsoft.com/en-us/research/video/the-simple-es... where you define the right functional structures that allow a very compact and efficient way of expressing automatic differentiation and then let the existing compiler do the heavy lifting.

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#8

I’ve just given this a cursory read but wanted to say that this looks really exciting. Julia in general seems like such an exciting language. I’ve recently switched some Fortran simulations at work for a pure Julia implementation and it is great fun to write. DifferentialEquations is a phenomenal piece of work!

Is the performance equivalent in your scenario?

We have taken a slight performance hit, but the code is cleaner and much easier to extend.

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#9
post #6

Is this somehow similar to the new Swift Automatic Differentiation feature? https://github.com/tensorflow/swift/blob/master/docs/Automat...

Does Swift have an equivalent to Python‘s numpy? It seems to lack a nice way of doing vector and matrix operations.

They built in Python interop so that you can use numpy in TFSwift

Re: A Differentiable Programming System to Bridge ML and Scientific Computing

#10

An alternative approach https://www.microsoft.com/en-us/research/video/the-simple-es... where you define the right functional structures that allow a very compact and efficient way of expressing automatic differentiation and then let the existing compiler do the heavy lifting.

I've read the corresponding paper, and while I think it's a fun read, I'm not sure it does particularly much to clear up the underlying confusion here. Reverse mode AD on straight line primitives is describabable in about three lines of exposition. The tricky part is how do you handle control flow (equivalently recursion). The description thereof then depends on what your underlying IR data structure is, but describing this generally isn't horrible either. The real problem in the literature is that there is lots of confusion over what is the AD algorithm and what are the workarounds applied to make it work in the particular system described.

For example, all the ML frameworks generally combine a high level tracer with a straight line AD transform, which then sometimes gets presented as a fundamental aspect of AD (which it isn't, you're just using the tracer to get an IR you can handle). As a result, this field has a lot of confused terminology, but all the results have been known since the 70s.

The name of the game for all the latest generation tools is to cleanly separate out the semantic AD transform from the rest of the system and then just use an unmodified compiler thereafter. We do it by transforming Julia IR, the Swift folks do it on SIL, and the Scala folks have an implementation using shift/reset and LMS. If you do this, a bunch of traditional AD techniques become just special cases of general purpose compiler transforms (DCE, CSE, etc). See this talk I gave recently for some more details: https://juliacomputing.com/blog/2019/02/19/growing-a-compile...

As an aside, a pet peeve of mine is people calling these algorithms "tape free". High storage requirements, due to the need to remember (or alternatively, recompute) intermediate values are a fundamental property of reverse mode AD and you can't get rid of it. The best you can do is hide it (e.g. in compiler managed stack or closure environments), with all the same fundamental challenges. This is probably a terminology clash, with people wanting to use "tape" as a term for a much more narrow kind of data structure generated from a tracing AD system, but the requirement to have some data structure like it, no matter how hidden is fundamental to the algorithm.

Post reply on HN