GPU raw H/W only has about a 10x advantage over a CPU

Article: Parallelism at HotPar 2010
By: Richard (no.delete@this.email.com), August 9, 2010 3:58 am
Room: Moderated Discussions
Here are some numbers of my own benchmarks for an algorithm called collapsed cone superposition which is used to calculate the dose distribution of photon radiotherapy in heterogeneous tissue. It is basically a ray cast operation using non divergent rays trough a 3d voxel grid. The most significant function in terms of cost is 2-4 acos per voxel per ray per direction. In this test 106 directions where used and the voxel grid had a size of 128^3, which means at least 128^2 rays per direction (some times extensions of the entry plane are needed). The algorithm is embarrassingly parallel.

The GPU version is written in CUDA, the CPU version in C99. Both the GPU version and the CPU version are optimized implementations. The CPU version is optimized in relationship to cache usage and uses custom (less accurate where appropriate) math functions. The CPU version does not use SSE intrinsics, but instead relies on the compiler to use SSE, it could thus be optimized further for x86. I believe this explains the performance difference between the Intel compiler and the Microsoft one. The CPU version is multi-threaded and uses fine grained locking on shared data structures.

All calculations are done using single precision FP. The number of threads in the CUDA implementation are the "CUDA threads". We see here that a GTX260 core 216 is about 7.3 times faster than a Core i7 920 processor using 8 threads.

The reason the GPU does so well here is because the rays are non-divergent, and thus map really well to SIMD hardware. There is almost no branching, which means the vector paths are also non divergent. Also, the GPU version is slighty more accurate since the CPU version uses a less accurate acos() function, however using less accuracy actually reduced performance on the GPU since it normally uses the hardware acos (which is already less accurate).

Since this is close to optimal usage of GPU resources, I have a hard time believing 100x speedups for GPGPU unless we are talking about very specific optimizations such as using the texture samplers or very specific instruction mixes. Sometimes tuning for hardware can achieve nice results, see for instance this classic thread http://forum.beyond3d.com/showthread.php?t=54842 on hand optimizing SGEMM for ATI hardware.

The CPU is more flexible. We have to use 16 times as much memory on the GPU in the absence of (fast) mutexes to achieve optimal performance. This has been fixed somewhat in the latest generation of GPUs. Also, when we are allowed to use SSE intrinsics, the CPU performance could still go up somewhat, although we were mostly limited by other parts of the code and memory bandwith on older Intel processors, but the latter at least has been fixed in Nehalem. Alas, I do not have any newer benchmarks. I would be very interested in the latest CPUs versus NVIDIA's Fermi.

Results (convert to monospaced font for proper layout)

Platform A A A A B B C D
Compiler VC++8.0 ICC9.0 VC++8.0 ICC9.0 ICC9.0 ICC9.0 CUDA2.1 CUDA2.1
#threads 1 1 4 4 1 8 5376 13824
Dose (sec) 119.56 67.06 30.69 17.92 58.516 10.20 2.53 1.39

A Xeon E5430 2,66GHz
B Core i7 920 2,66GHz
C Quadro 3700FX / Xeon E5430
D GTX260 core 216 / Core i7 920
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Tarek's Hotpar 2010 article onlineDavid Kanter2010/07/27 07:29 AM
  Tarek's Hotpar 2010 article onlineAnon2010/07/27 01:57 PM
    Tarek's Hotpar 2010 article onlineDavid Kanter2010/07/27 10:48 PM
      Tarek's Hotpar 2010 article onlineAnon2010/07/28 02:44 PM
        Tarek's Hotpar 2010 article onlineanon2010/07/28 04:10 PM
        CPU+GPUDavid Kanter2010/07/29 11:38 AM
          CPU+GPUMark Christiansen2010/07/30 06:36 AM
            CPU+GPUhobold2010/07/30 06:54 AM
              CPU+GPUGabriele Svelto2010/07/30 07:18 AM
                CPU+GPUhobold2010/07/30 02:46 PM
              CPU+GPUAaron Spink2010/08/02 05:32 PM
                CPU+GPUhobold2010/08/03 03:33 AM
                  CPU+GPURicardo B2010/08/03 04:19 AM
            CPU+GPU - the software problemVincent Diepeveen2010/07/31 04:50 PM
              CPU+GPU - the software problemmpx2010/08/02 11:19 AM
                CPU+GPU - the software problemRichard Cownie2010/08/02 12:48 PM
                  CPU+GPU - the software problemGabriele Svelto2010/08/02 11:10 PM
                    CPU+GPU - the software problemhobold2010/08/03 03:41 AM
                      CPU+GPU - the software problemRichard Cownie2010/08/03 05:17 AM
                        CPU+GPU - the software problemhobold2010/08/04 06:45 AM
                          NVidia in a holeRichard Cownie2010/08/04 07:23 AM
                            NVidia in a holeRohit2010/08/04 07:33 AM
                              NVidia in a holeRichard Cownie2010/08/04 07:50 AM
                                NVidia in a holeRohit2010/08/05 06:31 AM
                                  NVidia in a holeGroo2010/08/05 01:08 PM
                                NVidia in a holeGroo2010/08/05 01:07 PM
                              NVidia in a holeMark Roulo2010/08/04 08:26 AM
                                NVidia in a holeLaughabee2010/08/18 07:28 AM
                            Can nVidia survive without a sub-$100 GPU market?Mark Roulo2010/08/04 08:29 AM
                              Can nVidia survive without a sub-$100 GPU market?Richard Cownie2010/08/04 08:42 AM
                                Can nVidia survive without a sub-$100 GPU market?Mark Roulo2010/08/04 08:55 AM
                                  Can nVidia survive without a sub-$100 GPU market?Linus Torvalds2010/08/04 10:35 AM
                                    "profit" is subjectiveRichard Cownie2010/08/04 10:49 AM
                                      "profit" is subjectivea reader2010/08/06 03:54 AM
                                        no price warRichard Cownie2010/08/06 06:18 AM
                                  Can nVidia survive without a sub-$100 GPU market?Aaron Spink2010/08/04 11:19 AM
                                  Can nVidia survive without a sub-$100 GPU market?Konrad Schwarz2010/08/06 07:13 AM
                                CPU lineup != GPU lineupRohit2010/08/05 06:43 AM
                                  CPU lineup != GPU lineupRichard Cownie2010/08/05 07:12 AM
                                    CPU lineup != GPU lineupRohit2010/08/05 07:37 AM
                                      CPU lineup != GPU lineupRichard Cownie2010/08/05 07:56 AM
                                        CPU lineup != GPU lineupRohit2010/08/05 10:19 AM
                                          CPU lineup != GPU lineuphobold2010/08/06 03:08 AM
                                            CPU lineup != GPU lineupRohit2010/08/06 06:24 AM
                                              CPU lineup != GPU lineuphobold2010/08/06 06:41 AM
                              Can nVidia survive without a sub-$100 GPU market?David Hess2010/08/04 10:31 AM
                              Can nVidia survive without a sub-$100 GPU market?Ricardo B2010/08/04 12:16 PM
                              Semiconductor economicsDavid Kanter2010/08/05 08:13 AM
                                Semiconductor economicsRichard Cownie2010/08/05 08:51 AM
                                  NV buying ViA could shake up thingsRohit2010/08/05 10:09 AM
                                    NV buying ViA could shake up thingsRichard Cownie2010/08/05 10:25 AM
                                      Not likelyDavid Kanter2010/08/05 01:39 PM
                                        Not likelyrandom2010/08/05 01:49 PM
                                          Not likelyAaron Spink2010/08/05 02:18 PM
                                        Not likelyGroo2010/08/05 09:05 PM
                                        Not likelyRohit2010/08/06 06:25 AM
                                    NV buying ViA could shake up thingsGroo2010/08/05 09:02 PM
                                    NV buying ViA could shake up thingsehud2010/08/06 12:53 AM
                                      NV buying ViA could shake up thingsRohit2010/08/06 06:30 AM
                                        NV buying ViA could shake up thingsKevin G2010/08/06 04:54 PM
                                          ViA buying NV could shake up thingsBrendan2010/08/19 05:23 AM
                                        NV buying ViA could shake up thingsGroo2010/08/06 07:24 PM
                            NVidia in a holempx2010/08/04 11:01 AM
                              NVidia in a holeRichard Cownie2010/08/04 11:31 AM
                                NVidia in a holercf2010/08/04 02:40 PM
                              NVidia in a holeRohit2010/08/05 06:51 AM
                              NVidia in a holeGroo2010/08/05 08:50 PM
                              NVidia in a holeAaron Spink2010/08/05 10:52 PM
                          Anyone else wish Intel would buy Nvidia ? (NT)Silent2010/08/07 12:30 AM
                            Hell noa2010/08/07 07:37 PM
                        CPU+GPU - the software problemno thanks2010/08/04 06:54 PM
                          CPU+GPU - the software problemJouni Osmala2010/08/05 12:41 AM
                            CPU+GPU - the software problemIntelUser20002010/08/05 06:54 PM
                              CPU+GPU - the software problemJouni Osmala2010/08/05 08:36 PM
                            CPU+GPU - the software problemLinus Torvalds2010/08/06 07:08 AM
                              CPU+GPU - the software problemanonymous2010/08/06 08:39 AM
                                CPU+GPU - the software problemLinus Torvalds2010/08/06 09:56 AM
                                  non-existent Via+NV vs real OntarioRichard Cownie2010/08/06 11:12 AM
                              CPU+GPU - the software problemkoby m.2010/08/07 01:06 AM
                  CPU+GPU - the software problemhobold2010/08/03 03:48 AM
                CPU+GPU - the software problemhobold2010/08/03 03:45 AM
                  CPU+GPU - the software problemRichard Cownie2010/08/03 05:22 AM
          CPU+GPUAnon2010/07/30 08:11 PM
            CPU+GPUanon2010/07/31 02:19 AM
            CPU+GPUAaron Spink2010/08/02 05:45 PM
          100x speedups -- here we go againAM2010/08/02 12:37 AM
            100x speedups -- here we go againanon2010/08/02 02:32 AM
              100x speedups -- here we go againanon2010/08/02 10:14 PM
            GPU raw H/W only has about a 10x advantage over a CPUMark Roulo2010/08/02 08:41 AM
              GPU raw H/W only has about a 10x advantage over a CPUMichael S2010/08/02 02:31 PM
                GPU raw H/W only has about a 10x advantage over a CPUanon2010/08/02 08:36 PM
                  GPU raw H/W only has about a 10x advantage over a CPUMichael S2010/08/02 11:41 PM
                    GPU raw H/W only has about a 10x advantage over a CPUMark Roulo2010/08/03 07:22 AM
                      GPU raw H/W only has about a 10x advantage over a CPURohit2010/08/04 06:08 AM
                      There is reasonable explanation...Jouni Osmala2010/08/04 09:10 PM
                  GPU raw H/W only has about a 10x advantage over a CPUMark Roulo2010/08/03 07:19 AM
              simple reality check for youAM2010/08/03 12:45 AM
                simple reality check for younone2010/08/03 06:27 AM
                  simple reality check for youAM2010/08/03 10:50 PM
                    simple reality check for youanon2010/08/03 11:06 PM
                      simple reality check for youAM2010/08/05 02:51 AM
                        catch the same boat as everyone else next time (NT)anon2010/08/05 03:44 AM
                Simple reality checkDavid Kanter2010/08/03 07:24 AM
                  Simple reality checkGabriele Svelto2010/08/03 09:51 PM
                  Simple reality checkAM2010/08/03 10:57 PM
                    Simple reality checkanon2010/08/03 11:12 PM
                      Simple reality checkAM2010/08/05 02:59 AM
                        Simple reality checkanon2010/08/05 03:47 AM
                          Study the papers, troll (NT)AM2010/08/05 11:01 PM
                    Simple reality checkhobold2010/08/04 04:05 AM
                    Simple reality checkDean Kent2010/08/04 08:30 AM
                      Simple reality checkMark Roulo2010/08/04 08:59 AM
                      Suggestion for David Kanter and Mark RouloAM2010/08/05 02:57 AM
                        Suggestion for David Kanter and Mark Roulonone2010/08/05 03:22 AM
                          Suggestion for David Kanter and Mark RouloAM2010/08/05 11:04 PM
                        Suggestion for David Kanter and Mark Roulonone2010/08/05 03:38 AM
                          Suggestion for David Kanter and Mark Rouloanon2010/08/05 03:43 AM
                            Suggestion for David Kanter and Mark RouloAM2010/08/05 11:11 PM
                              Suggestion for David Kanter and Mark Rouloanon2010/08/06 06:52 AM
                          Suggestion for David Kanter and Mark RouloAM2010/08/05 11:10 PM
                            Suggestion for David Kanter and Mark Roulonone2010/08/06 12:35 AM
                              price doesn't matter only in theories (NT)AM2010/08/09 01:13 AM
                            Not apple4appleMichael S2010/08/06 04:13 AM
                              Not apple4appleAM2010/08/09 01:09 AM
                                Not apple4appleMichael S2010/08/09 03:35 AM
                                  Not apple4appleAM2010/08/10 12:05 AM
                                    Not apple4applenone2010/08/10 12:38 AM
                                      Back to topicAM2010/08/10 11:03 PM
                                      Final note (and some remarks on Intel's paper)AM2010/08/13 03:28 AM
                                        Final note (and some remarks on Intel's paper)none2010/08/13 08:10 AM
                                          Final note (and some remarks on Intel's paper)AM2010/08/16 12:14 AM
                                            Final note (and some remarks on Intel's paper)none2010/08/16 05:29 AM
                                              One example of 1000X shown to be wrong.sea2010/08/16 06:55 PM
                                                You're short of some factsAM2010/08/17 12:13 AM
                                                  Maybe you need to read beyond the PR statementSteve Underwood2010/08/17 01:39 AM
                                                    Maybe you need to read beyond the PR statementGroo2010/08/17 07:18 PM
                                                    check the hw they usedAM2010/08/18 02:33 AM
                                                Please realize what Monte Carlo meansVincent Diepeveen2010/08/18 02:28 AM
                                              Final note (and some remarks on Intel's paper)AM2010/08/17 12:18 AM
                                        Final note (and some remarks on Intel's paper)anon2010/08/14 12:22 AM
                                          Final note (and some remarks on Intel's paper)AM2010/08/16 12:15 AM
                                            Final note (and some remarks on Intel's paper)anon2010/08/16 01:10 PM
                                              Final note (and some remarks on Intel's paper)AM2010/08/17 12:15 AM
                                                Final note (and some remarks on Intel's paper)Michael S2010/08/17 01:58 AM
                                                  Final note (and some remarks on Intel's paper)AM2010/08/18 02:17 AM
                                                    Final note (and some remarks on Intel's paper)gallier22010/08/18 03:52 AM
                                                    Final note (and some remarks on Intel's paper)Michael S2010/08/18 04:33 AM
                                                      Final note (and some remarks on Intel's paper)Gabriele Svelto2010/08/18 05:11 AM
                                                      Final note (and some remarks on Intel's paper)Steve Underwood2010/08/18 03:03 PM
                                                        Intel might be moving from ISA to platformhobold2010/08/19 02:58 AM
                                                          Intel might be moving from ISA to platformSteve Underwood2010/08/22 06:00 PM
                                                            Intel might be moving from ISA to platformAnon2010/08/22 09:43 PM
                                                              Intel might be moving from ISA to platformajensen2010/08/22 11:37 PM
                                                                Intel might be moving from ISA to platformMichael S2010/08/23 01:13 AM
                                                                  Intel might be moving from ISA to platformSteve Underwood2010/08/23 01:35 AM
                                                                  Intel might be moving from ISA to platformhobold2010/08/26 03:37 AM
                                                                Intel might be moving from ISA to platformAnon2010/08/23 02:47 PM
                                                              Intel might be moving from ISA to platformSteve Underwood2010/08/23 01:25 AM
                                                                Intel might be moving from ISA to platformhobold2010/08/23 02:03 AM
                                                                  Intel might be moving from ISA to platformSteve Underwood2010/08/23 03:26 AM
                                                                Intel might be moving from ISA to platformAnon2010/08/23 02:55 PM
                                                                Intel might be moving from ISA to platformrwessel2010/08/23 05:41 PM
                                                                  Intel might be moving from ISA to platformSteve Underwood2010/08/23 06:30 PM
                                                                    Intel might be moving from ISA to platformrwessel2010/08/23 08:50 PM
                                                                      Intel might be moving from ISA to platformSteve Underwood2010/08/23 09:34 PM
                                                                        Intel might be moving from ISA to platformrwessel2010/08/24 12:03 AM
                                                              Intel might be moving from ISA to platformIan Ollmann2010/08/23 08:21 PM
                                                          Intel might be moving from ISA to platformajensen2010/08/22 09:36 PM
                                                            Intel might be moving from ISA to platformIan Ollmann2010/08/23 08:45 PM
                                                      Final note (and some remarks on Intel's paper)AM2010/08/19 12:29 AM
                                                        Final note (and some remarks on Intel's paper)Richard2010/08/19 03:51 AM
                                                          I stand corrected.Michael S2010/08/19 04:30 AM
                simple reality check for youanonymous2010/08/03 09:25 AM
                  simple reality check for youAM2010/08/03 10:47 PM
                    simple reality check for youanonymous2010/08/04 09:17 AM
                      simple reality check for youanon2010/08/04 07:33 PM
                      SPECint/FPAM2010/08/05 02:49 AM
                  simple reality check for youRohit2010/08/13 07:31 PM
                    simple reality check for youhobold2010/08/16 05:29 AM
              maybe texture caches ?Richard Cownie2010/08/03 08:27 AM
                maybe texture caches ?none2010/08/03 08:59 AM
                  maybe texture caches ?Richard Cownie2010/08/03 09:15 AM
                    maybe texture caches ?Mark Roulo2010/08/03 09:23 AM
                      maybe texture caches ?Richard Cownie2010/08/03 09:33 AM
                        maybe texture caches ?Mark Roulo2010/08/03 09:37 AM
                          the Hess paperRichard Cownie2010/08/03 10:16 AM
                    maybe texture caches ?Aaron Spink2010/08/03 12:23 PM
                      maybe texture caches ?Mark Roulo2010/08/03 03:13 PM
                        maybe texture caches ?Michael S2010/08/04 12:47 AM
                  maybe texture caches ?Michael S2010/08/03 09:23 AM
                maybe texture caches ?Mark Roulo2010/08/03 09:19 AM
                  maybe texture caches ?Richard Cownie2010/08/03 09:42 AM
                Cache to cache comparisonDavid Kanter2010/08/03 11:28 AM
                  Cache to cache comparisonRichard Cownie2010/08/03 11:52 AM
                    Cache to cache comparisonDavid Kanter2010/08/03 12:21 PM
                      Cache to cache comparisonRichard Cownie2010/08/03 02:55 PM
                      Cache to cache comparisonGabriele Svelto2010/08/03 10:23 PM
                        Nehalem vs Core2Richard Cownie2010/08/04 03:24 PM
                          Nehalem vs Core2IntelUser20002010/08/04 06:26 PM
                          Nehalem vs Core2Gabriele Svelto2010/08/04 09:51 PM
                            Nehalem vs Core2Richard Cownie2010/08/05 02:27 AM
                              Nehalem vs Core2Gabriele Svelto2010/08/05 05:00 AM
                                Nehalem vs Core2Richard Cownie2010/08/05 06:10 AM
                                  Nehalem vs Core2Gabriele Svelto2010/08/05 06:41 AM
                                    Nehalem vs Core2Michael S2010/08/05 09:02 AM
                              Nehalem vs Core2Michael S2010/08/05 09:12 AM
                          Nehalem vs Core2Michael S2010/08/04 11:36 PM
                            Nehalem vs Core2Richard Cownie2010/08/05 07:33 AM
                              Nehalem vs Core2Michael S2010/08/05 08:44 AM
                                Nehalem vs Core2Richard Cownie2010/08/05 09:03 AM
                                  Nehalem vs Core2Michael S2010/08/05 03:21 PM
                                    Nehalem vs Core2Richard Cownie2010/08/05 06:15 PM
                                      I'm wrong, you're right - i's 2 dieRichard Cownie2010/08/05 06:21 PM
                                    Nehalem vs Core2Richard Cownie2010/08/06 07:12 AM
                                      Nehalem vs Core2Michael S2010/08/06 07:33 AM
                                      Nehalem L1 cache latency a hedge for higher clock speeds?Mark Roulo2010/08/06 07:36 AM
                                        Nehalem L1 cache latency a hedge for higher clock speeds?Kevin G2010/08/07 09:14 AM
                                          Nehalem L1 cache latency a hedge for higher clock speeds?IntelUser20002010/08/07 01:32 PM
                                        Nehalem L1 cache latency a hedge for higher clock speeds?someone2010/08/07 01:35 PM
                          difference between C2D/C2Q chipsetsMichael S2010/08/04 11:57 PM
                          Nehalem core goals ... my takeMark Roulo2010/08/06 06:53 AM
                            Bulldozer single-threadRichard Cownie2010/08/06 03:05 PM
                          Nehalem vs Core2Carlie Coats2010/08/07 07:41 AM
                            scalingMichael S2010/08/07 10:12 AM
                            why X5460?Michael S2010/08/07 10:12 AM
                              why X5460?Carlie Coats2010/08/08 03:34 AM
                                why X5460?Michael S2010/08/08 03:42 AM
                                  Polling/PIO based COMM libraries?Michael S2010/08/08 04:14 AM
                    Cache to cache comparisonAnts Aasma2010/08/04 09:00 AM
                      Cache to cache comparisonRichard Cownie2010/08/04 09:08 AM
                        Cache to cache comparisonAnts Aasma2010/08/04 10:28 AM
                      Cache to cache comparisonMichael S2010/08/04 10:33 AM
                        Cache to cache comparisonMark Roulo2010/08/04 11:29 AM
                          Cache to cache comparisonAnts Aasma2010/08/04 12:10 PM
                            Fermi and G200 instruction latencyMark Roulo2010/08/04 01:10 PM
                              Fermi and G200 instruction latencyAnts Aasma2010/08/04 02:01 PM
                        Cache to cache comparisonAnts Aasma2010/08/04 12:00 PM
                        Register read comparisonDavid Kanter2010/08/05 08:16 AM
                          Register read comparisonGabriele Svelto2010/08/05 10:42 PM
                maybe texture caches ?Aaron Spink2010/08/03 12:17 PM
              GPU raw H/W only has about a 10x advantage over a CPURichard2010/08/09 03:58 AM
                GPU raw H/W only has about a 10x advantage over a CPUnone2010/08/09 04:19 AM
                  GPU raw H/W only has about a 10x advantage over a CPUVincent Diepeveen2010/08/24 06:18 AM
                    Forget it, they won't hear itanon2010/08/24 03:37 PM
                    GPU raw H/W only has about a 10x advantage over a CPURichard2010/08/25 12:03 PM
                This forum supports pre tagMichael S2010/08/09 05:03 AM
    Tarek's Hotpar 2010 article onlineRich Vuduc2010/07/28 09:24 AM
      Tarek's Hotpar 2010 article onlineAnon2010/07/28 03:18 PM
  Low hanging fruitMoritz2011/02/03 11:20 AM
    Low hanging fruitJukka Larja2011/02/06 04:01 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell green?