it works but surprisingly slow on my devices
it works but surprisingly slow on my devices
Initial Train Loss: 5.9414
Initial Test Loss: 5.9414
Took: 175.90 seconds
Train Loss: 0.0108
Test Loss: 0.0108
Took: 183.89 seconds
Train Loss: 0.0016
Test Loss: 0.0016
Took: 188.95 seconds
Train Loss: 0.0010
Test Loss: 0.0010
SimpleChains is about 0.5 seconds on this computer, about 5 seconds to compile. So you're right, it is slow, too slow, like 300x faster than Jax, and I suspect something is wrong with the Jax script. It should probably be closer to like 2.5x or so because of memory handling and vectorization stuff, but not any slower than PyTorch.Tidying up the JAX script, I find that it runs in ~15 seconds on my laptop CPU. Likewise, fixing the crash error in the blog post (UndefVarError: alloc_threaded_grad not defined) then I find that the Julia implementation also runs in ~15 seconds on my laptop CPU.
So, 1x faster than JAX?
Clearly we're getting very different results here, so (a) I'd like to get to the bottom of this, but (b) perhaps we should be more cautious about making performance claims.
(EDIT: updated script in this GitHub gist: https://gist.github.com/patrick-kidger/68bf7b99ba02c246b20ea...)
I think the main slowdown was doing the model updates out of the JIT region. JAX-without-JIT is ridiculously slow.
https://gist.github.com/patrick-kidger/68bf7b99ba02c246b20ea...
Anyway, something to investigate if I ever get the time.
There were not any breaking changes, but enough fixes and additions (e.g., the convolutional layer and threading) that 0.2.0 isn't really comparable.
Odds are there is a version conflict in 0.2.1 (which also bumped dependency requirements) that does not exist in 0.2.0, and that this is preventing you from upgrading. You could start a smaller environment, or try `] add SimpleChains@0.2.1` to force it/get an error message telling you what the conflict is.