5 ms·
Here is an earlier submission of JAX from December 2018: https://news.ycombinator.com/item?id=18636054 https://news.ycombinator.com/item?id=18636054 JAX is pr
by chrisaycock 7y ago
Here is an earlier submission of JAX from December 2018:
https://news.ycombinator.com/item?id=18636054 https://news.ycombinator.com/item?id=18636054
JAX is pretty neat because it is effectively a derivatives compiler: it can automatically differentiate a function and JIT compile the result. This makes training in machine learning both fast and easy because gradient descent no longer has to be written by hand.
- superpermutat0r 7y agoFunction getting differentiated regularly is a loss function defined as (DesiredOutput(x) - HugeNumberOfParametersAppliedTo(x))^2. Are you saying that the symbolic expression gets transformed and is then used to represent the gradient? I thought that PyTorch, Tensorflow and similar already do that.
- tel 7y agoMany frameworks already compute derivatives, but they don't use a symbolic representation. Instead they use a method called "automatic differentiation" which does something along the lines of (a) extracts a trace of the algorithm by executing the code with dummy arguments, then (b) uses the chain rule to compute component derivatives at each node in the execution tree and combine them into the final answer. These methods are much faster than perturbation-based derivatives and much more applicable than symbolic methods (which cannot be automatically extracted from a program).
- p1esk 7y agoNot sure what you mean by “automatically extracted from a program”, all DL frameworks manually write backward pass for each op.
- tel 7y agoI mean the tracing operation that produces a structure appropriate for AD computation. I agree with you that there's work needed to specify the node derivatives. Although, honestly, I misspoke. The difference between AD and symbolic differentiation is more subtle. Really AD is profiting because it uses AST representations to keep a graph of intermediate values while symbolic methods can blow up exponentially (or require clever, difficult to generalize tricks to reconstruct that graph).
- apl 7y ago> gradient descent no longer has to be written by hand Nobody's been writing derivatives by hand for 5+ years. All major frameworks (PyTorch, Tensorflow, MXNet, autodiff, Chainer, Theano, etc.) have decent to great automatic differentiation. The differences and improvements are more subtle (easy parallelization/vectorization, higher-order gradients, good XLA support).
- Smerity 7y agoFor high performance CUDA kernels people still need to write derivatives by hand. I know this as for my own research, and for many production systems, I'd still need to write it myself. Many of my architectures wouldn't have been possible without writing the CUDA myself (Quasi-Recurrent Neural Network[1]) or using optimized hand written black boxes (cuDNN RNN). The lack of open optimized hand written CUDA kernels has actually been an impediment to progress in the field. Automatic differentiation allows for great flexibility and composability but the performance is still far from good, even with the various JITs available. Jax seems to be one of the most flexible and optimized for many use cases for now however. [1]: https://github.com/salesforce/pytorch-qrnn https://github.com/salesforce/pytorch-qrnn
- 6gvONxR4sf7o 7y agoHow has your experience with CUDA been? Is it as painful as it appears at first glance? I've done a ton of python and C, and yet whenever I look at C++ code, it just screams stay away. But I have some almost-reasonably-performant pytorch that I'd rather not just use as a cash burning machine, so it looks like it might be time to dive into CUDA :-\
- Smerity 7y agoThe CUDA I've written has never been joyous but it also hasn't been as horrific as I'd expected. There's a period of hair pulling but persistence will get you through it. The majority of CUDA code is closer to C than C++ too which is helpful. I'll be looking at diving back into CUDA in the near future given the exact speed issues we've been mentioning so feel free to get in touch.