Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GPU vs CPU performance for common algorithms [closed]

I'm interested to know if any common algorithms (sorting, searching, graphs, etc.) have been ported to OpenCL (or any GPU language), and how the performance compares to the same algorithm executed by the CPU. I'm specifically interested in the results (numbers).

Thanks!

like image 931
Chris Avatar asked Sep 12 '09 17:09

Chris


People also ask

Is CPU or GPU more important for performance?

The GPU is an extremely important component of a gaming system, and in many cases, even more crucial than the CPU when it comes to playing certain types of games. Simple description: A GPU is a single-chip processor that's used chiefly to manage and enhance video and graphics performance.

Is CPU or GPU better for machine learning?

GPU vs CPU Performance in Deep Learning Models CPUs are everywhere and can serve as more cost-effective options for running AI-based solutions compared to GPUs. However, finding models that are both accurate and can run efficiently on CPUs can be a challenge. Generally speaking, GPUs are 3X faster than CPUs.

Is GPU always faster than CPU machine learning?

Due to its parallel processing capability, a GPU is much faster than a CPU. For the hardware with the same production year, GPU peak performance can be ten-fold with significantly higher memory system bandwidth than a CPU. Further, GPUs provide superior processing power and memory bandwidth.

Why is GPU faster than CPU for deep learning?

GPUs are known for being significantly better than most CPUs when it comes to AI deep neural networks (DNNs) training simply because they have more execution units (or cores).


2 Answers

GPUs are highly specialized hardware designed to do a small set of tasks very well and highly parallelized. This is basically arithmetic (particularly single precision floating point math although newer GPUs do quite well with double precision). As such they're only suited to particular algorithms. I'm not sure if sorting fits that category (in the general case at least).

More common examples are pricing of financial instruments, large amounts of matrix maths and even defeating encryption (by brute force). That being said, I did find Fast parallel GPU-sorting using a hybrid algorithm.

Another commonly quoted example is running SETI@HOME on an Nvidia GPU but it's comparing apples to oranges. The units of work for GPUs are different (and highly limited) compared to what CPUs ordinarily do.

like image 140
cletus Avatar answered Sep 20 '22 12:09

cletus


Have a look at thrust:

Thrust is a CUDA library of parallel algorithms with an interface resembling the C++ Standard Template Library (STL). Thrust provides a flexible high-level interface for GPU programming that greatly enhances developer productivity.

like image 22
Dirk Eddelbuettel Avatar answered Sep 20 '22 12:09

Dirk Eddelbuettel