Greta on GPU vs CPU, any experiences


#1

Dear Greta developers.

Thanks for a fantastic product. I have used Greta as my primary baysian toolbox for the last ½ year.

But some of my model are computational very demanding, present my laptop is between 20 to 70 hours for different model specifications. So I’m looking to buy a desktop for computational task. And since greta from 0.3 does support GPU’s, i was wondering if any have had any experiences with performance of GPU vs CPU when it comes to Greta and tensorflow probability, So that i could choose the right hardware i.e. more cpu cores vs a dedicated GPU.

Kind regards


#2

It really depends on the type of model you’re using. If the slow operation is a big matrix multiplication, Cholesky decomposition, or something similar, then it will definitely get a speed up on a GPU.
For a big geostatistical model (dominated by a cholesky decomposition), I’ve seen something like a 5-10x speed up.

I use GPU-enabled machines rented from Google to do that, rather than investing in hardware. It might be worth your while testing that out first, before deciding to buy? It can be a pain to set up the GPU-enabled tensorflow, but I think the anaconda GPU install should help with that.

Two other things you could try before buying a GPU:

  • install TensorFlow with anaconda, since the optimised CPU instructions it uses make a big difference (2x speed up for me)
  • post an example of your model here, and we’ll see if there’s a more efficient way of coding it up!

#3

Thanks for your suggestions Nick…
Did try out google cloud and their k80 and p100 gpu, and observer af difference of around 5 to 6 times between these to, for my model, with a 32 core pure cpu placed somewhere in between 2 times faster than the k80. So there is something to gain from cpu, but still unsure if it’s worth the cost. Regarding my model i will put this an another question.
Thansk.