Actuarial pricing, capital modelling and reserving

Pricing Squad


Issue 28 -- November 2018

Welcome back to Pricing Squad!

Pricing Squad is the newsletter for fellow pricing practitioners and actuaries in general insurance. Today's issue is about CPUs and GPUs.


Simulating with CPUs and GPUs

Don't you sometimes wish there was more than one of you to handle all the things one needs to handle? Well, there is only one of you.

But in the narrow domain of your life that is random number generation, while there is still only one of you, you have more helpers than you realise.

I am talking of course about multiple CPU and GPU cores of your computer. Most desktops and laptops have 4 or 8 CPU cores (inside the main processor) and a dozen or more GPU cores (inside the graphic card).

Making all CPU and GPU cores work for you requires exotic programming skills. So here are some numbers to help you understand what is possible and whether it is worth investing in developing or buying those skills.

To model a certain London Market casualty product, Matt Evans and I have been simulating 1,000,000,000 generalised Pareto distribution random variables. We started with a standard single-thread technique in C# and C++ and then we did exactly the same using C++ OpenCL on 4 CPUs, then on 20 GPUs. Finally we used a high performance computer pictured below (the one on the middle). This beast has 218 GPUs.

Here is what we got.

  1. Simulating 1,000,000,000 GPD variables on single core in C# took 120 seconds.
  2. Simulating 1,000,000,000 GPD variables on 4 CPU cores in C++ took 18 seconds.
  3. Simulating 1,000,000,000 GPD variables on 20 GPU cores in C++ took 12 seconds.
  4. Simulating 1,000,000,000 GPD variables on 218 GPU cores in C++ took 2.5 seconds.

Note that different problems benefit differently from parallelisation. An even bigger gain is discussed in issue 23 of the Pricing Squad.

That's all folks. Thank you for reading.


Copyright © 2018 Jan Iwanik, All rights reserved. You are receiving this email because you subscribed to updates from www.iwanik.co.uk. We publish data and analysis for informational and educational purposes only. You can unsubscribe from this list by emailing us.