Processing units are the intrinsic elements of computers, all of computers can’t exist without processing units, from supercomputer to smart watches to arguably any smart device that contain a unit called a microprocessor, which is a toy – an inferior version of CPUs.
In this article, we will explain processing units (CPUs, GPUs, TPUs) in a chronological fashion, but before we dive into our three subject processing units; we should review what a processing unit is.
Table of Contents
What is a processing unit?
It is a unit that receives some instructions, performs them, and give an output, it cannot only be electronical but also mechanical, as the first computers.
Now most of processing units are discrete; but there exist analog processing units.
A processing unit is accompanied with a memory to store the yet-to-do operations, and the output.
CPU – Central Processing Unit
CPU stands for central processing unit; so, as the name suggests it is the center that the realm of computers revolve around, which means if it ceases to exist; all the computer, mobile phones, the internet, … will disappear at once. Nobody can imagine a car without an engine, right? And a CPU is the engine of every electronic device.
CPUs work with what is called machine code, which is a set of binary instructions, a set of zeros and ones denoting whether electric current should pass through the semiconductors of the CPUs circuit or not. A CPU is a general-purpose processing unit, that means there are no specific kinds of instructions that they do better than other instructions; they are powerful and well-suited for any kind of computation; that’s why they can do different kinds of operations like running a GUI, managing inputs (keyboard and mouse), connect to a network, run multiple software and so on.
The engine of a car has different parts that work together in harmony to deliver good performance; a CPU also has different components responsible of doing different jobs, and every component is essential to the totality of the CPU, they are:
- Core: A core is the piston and cylinder of the CPU, every computation happens at the core of the CPU; better engines have more than a piston, so do modern CPUs, which often contain more than one core, and the newest versions can have more than 10 powerful cores.
- Cache: The engine contains a special fuel delivery system that match the speed of the fuel consumption rate not lower than it, and the cache is an ultra-fast memory that holds the instructions that needs to be executed, it has few levels of different speeds; the most immediate instructions are held in the fastest level.
- Memory Management Unit (MMU): A unit that is responsible for managing what goes where and when, for example: new instructions are placed in the slowest part of cache, the ones in that part gets pushed further, also it manages which instructions go to which core.
- Clock: As the instructions are executed in a sequential fashion, the clock is responsible of how much instructions are executed in a time unit (say a second), higher clock speeds means that the CPU is capable of performing more operations compared to CPUs with lower clock speeds in the same time frame.
Every part of the CPU works in harmony with the other parts to deliver the best performance for a variety of general tasks, but as you can draw from the CPU organization, it is not suited for parallel tasks (not human-level parallelism, but think of millions of operations needed to be done at the same time), because a CPU isn’t designed to perform such tasks.
- General-purposed: good at performing different kinds of tasks.
- Powerful: for single-threaded tasks it is the best choice.
- Compatible: almost all operating systems and software are built to be compatible with commercial CPUs.
- Ordinary multi-tasking: it is why you can use your computer to do different things at the same time.
- Added security features: new features are constantly added to modern CPUs, including some security feature.
- Relatively cheap: as new manufacturing technologies emerge the cost of a CPU decreases and their performance increase.
- Bad at parallelism: simple tasks in huge amounts choke the CPU and make it useless.
- It is hard to create a collection of CPUs to perform parallel tasks; it would be inefficient and expensive, both to build and maintain.
GPU – Graphics Processing Unit
Graphics processing unit is a specialized processing unit designed for processing graphics, as CPUs aren’t suited for processing gigantic amounts of parallel easy instructions, and graphics meet these criteria; which demanded the design of GPUs.
GPUs have the same set of components as CPUs, yet there are some differences in the specs of these components.
GPUs have many cores, but every one of them isn’t as powerful as a CPU core; also, the memory of a GPU is far better than the cache of the CPU, GPU’s memory is called the bandwidth of the GPU.
These significant differences make the GPU less efficient than a CPU in general purpose computations; yet the GPU outperforms the CPU in parallelism, when there are a lot of operations need to be performed at the same time, just like rendering a high-quality video (many pixels) with seamless performance, or video games.
Modern GPUs have special mathematical cores good at performing tensor operations, which enhance the GPU capabilities at rendering simulations and real-life video games.
Also, GPUs excel at machine learning which require this amount of parallelism, check out our article Why GPUs for Machine Learning to know more!
- Good at parallelism: you can feed large amounts of instructions.
- Somehow can do a wide range of tasks: graphics, machine learning, crypto-currency mining, … etc.
- More efficient in certain matrix and tensor operations than a CPU, these operations are essential in video games, simulations and machine learning.
- Larger bandwidth than the CPU’s cache.
- GPUs are compatible with each other; especially ones from the same company, that means you have the opportunity to have a large workstation.
- More expensive than a CPU.
- Not general-purposed: you can’t use a GPU without a CPU.
- Sometimes you can have difficulties installing your drivers, which isn’t the case for CPUs.
TPU – Tensor Processing Unit
TPU stands for tensor processing unit, especially created for the purpose of machine learning, the first TPU was announced by Google in 2017; after being used for a year in their data centers.
TPUs are proprietary hardware owned by Google, so the design isn’t public, yet their specs are.
As the special tensor cores in modern GPUs, TPUs are designed to perform tensor operations with higher efficiency, they operate on a very large number of inputs, yet with low precision on every operation, albeit the precision is as low as 8-bit precision, the number of operations is measured by terra FLOPS (float operations per second).
There are a few versions of TPUs at the time of writing this post, most of them are available through the cloud, yet there is one version called Edge TPU shipped under Coral brand, bundled in an SBC (Single -Board Computer).
Another feature of TPUs is that they are compatible with each other (more than GPUs), which support calculations for complex neural networks with the best time and energy efficiency.
- The power consumption per operation is very low; which makes a TPU very efficient for their use-cases.
- Provide accelerated machine learning setup; because all the features were specifically curated for machine learning.
- Very high memory, supports larger inputs than GPUs.
- As TPUs are relatively new; constant improvements still take place.
- Isn’t general-purposed as the CPU, and doesn’t support different kinds of operations as the GPU.
- There are no alternatives to the Google’s TPU.
- The options to use a TPU are a few, either cloud instances, Edge TPU, or Google Colab (just go to Runtime > Change Runtime Type > set hardware accelerator to TPU)
- TPU’s calculations aren’t precise as a CPU or a GPU.
- Isn’t cross platform, TPU’s are compatible with just Linux; the Edge TPU comes with a specific Debian-derivative operating system.
In this article, we have reviewed most of the common processing units, and their very specific uses. We have explored the differences between CPUS, GPUs and TPUs, and some of their pros and cons.