Doing Bayesian Data Analysis On the GPU: Examples
github.com
github.com
The library used (Bayadera) is still pre-release, so much polishing is still needed, so this can be considered a preview. But, it is still very useful, and not more complex for programmers than the mainstream Bayesian tools.
[1] https://www.amazon.com/Doing-Bayesian-Data-Analysis-Second/d...
Does it make the same probabilistic guarantees as the methods used in Stan etc? Or is it trading validity for speed?
For example, robust linear regression from chapter 17, that fits 300 points over 4 parameters (easy, but far from trivial) runs in 180 seconds in JAGS and 485 in Stan, in parallel with 4 chains, taking 20,000 samples.
Bayadera takes 276,297,912 samples in 300 milliseconds, giving much fine-grained estimations.
So, depending on how you count the difference, it would be 500-1000 times faster for this particular analysis, while per-sample ratio is something like 7,000,000 (compared to JAGS).
Of course, JAGS and Stan are mature software packages, while Bayadera is still pre-release...
Is the speedup coming from a better implementation, or because GPUs are just way faster, or because it cuts statistical corners? If its cutting corners, are they sensible?
They may do a lot of work to make sure that MCMC is validly converging, and Bayadera also does its stuff on that front, but the truth is, and you'll find it in any book on MCMC (Gelman included) that you can never guarantee MCMC convergence.
The diference for the inference time is in the post below (but YMMV).
Currently, I do not have resources to take on the task of creating a general-purpose plotting library. My idea with the plotting toolbox available in Bayadera is to provide a tool that would do one job - provide fast, easy to use, plotting for exactly those types of plots that are needed for bayesian stuff - and do that job well.
Plotting in general is not that hard technically, but the problem is that each user in each situation wants something unique. The level of customizability found in ggplot, matplotlib and the likes is rather high; that's something I do not have motivation to pursue.
Michael Betancourt (à stan dev working on the HMC parts) has a pair of YouTube videos which go into details.
That said, I switched to pymc3 so that I could compute logp via opencl more easily and if there were better ways to do this, I'm happy to see them.
That's like saying that comparing a horse cart and an automobile is comparing apples and oranges.
That being said, there are other things where Stan might fare better. User familiarity, or maturity, or personal taste...