As we were taught in our schools, Central Processing Unit (CPU) is the heart of a computer. CPU can perform a given set of processes in a given time. There has been a significant evolution in the CPUs as the demand rose. For example, the Intel Core 2 duo that was launched in 2006 was 45nm in size and had two cores, compared to the modern-day Intel core i7 processor which is just 14nm in size, quad core and is much faster.
All this is fine. But why do we keep hearing about GPU?
Graphics Processing Unit (GPU) is a dedicated chip that is designed for rapid manipulation and parallel processing of data. Later there were general purpose GPUs which were used in Machine learning, running servers, etc. If CPUs can perform faster which is also getting evolved consistently, what is the need of GPUs?
The need of GPUs
If there is a straightforward answer to this, it would be parallel computing. Yes, Imagine a simple addition of two 1D vector arrays having 5 elements each. In a normal C code, we would traverse each element in a for loop and add it to store the results in another 1D array. If you closely look at the problem, we have different set of data (5 elements) but the same operation (addition). So if we have the same operation, we can bring in the use of parallel programming.
The same problem given above can be solved in a GPU having five threads running in parallel to do the addition. The time taken will be five times less in this case. So many applications that process large data sets can use a data-parallel programming model to speed up the computations.
There is no written script that says GPU is always faster. It all depends on the application you use. Basic level of distinguishing will involve the comparison of cores and processing speeds. A CPU will have limited number of cores and the processing speed will be high. Whereas in GPU the number of cores will be large in number but slower processing speeds. Before we dig deeper, we need to be aware of a couple of terms: Latency and Bandwidth. Latency is the time taken for a process to do its work and bandwidth is the number of processes that can be done in a given time.
CPU mainly concentrates on the latency. We can concur this by the fact that there is a high processing speed on the given limited number of cores. On the other hand, GPU focuses on bandwidth. Since the same operation is done in parallel, many computations can be completed in a given amount of time.
Another lower level key difference is that since they do data-parallel tasks, GPUs are designed in such a way that more transistors are devoted to data processing rather than data caching and flow control. GPU-accelerated computing offloads compute-intensive portions of the application to the GPU, while the remaining code still runs on the CPU. From a user’s perspective, applications just run much faster. While general-purpose computing is still the CPU’s domain, GPUs are the hardware backbone of nearly all intensive computational applications.
Use cases for GPU
- Deep Machine Learning
- Image processing
- 3D mapping
There are many more PUs that you are likely to come across:
APUs: The AMD Accelerated Processing Unit (APU), is a series of 64-bit microprocessors designed to act as a CPU and GPU on a single die.
TPUs: A tensor processing unit (TPU) is an AI accelerator application-specific integrated circuit (ASIC) developed by Google specifically for neural network machine learning.
Are CPUs obsolete?
Many tasks performed by PC operating systems and applications are still better suited to CPUs, and much work is needed to accelerate a program using a GPU. Since many existing software uses the x86 architecture, and GPUs require different programming techniques and miss several important features needed for operating systems, a general transition from CPU to GPU for everyday computing is very difficult.
GPUs are not replacements for CPU architecture. Rather, they are powerful accelerators for existing infrastructure. It is up to the application developers to choose whichever suits their requirement. Bottom-line is that CPU is best in sequential computing and GPU is well suited for parallel computing.
For more information please contact our vision team at email@example.com