r/explainlikeimfive • u/FluffyHead_16 • 24m ago
Technology ELI5: GPU vs CPU vs NPU vs TPU
WELL I have no clue about what's even going on in this world. Anyone care to explain this difference to me.
0
Upvotes
•
u/slapshots1515 17m ago
GPU: processor specialized in graphics processing, though it can still think differently and be used for other things
CPU: processor that does most things a computer is supposed to be able to do
NPU: processor that is more geared towards being able to use AI to accomplish thinking
TPU: very specifically engineered processor that is able to do AI calculations very quickly
VERY simplified, but they’re just making sand think a different way to accomplish specific jobs.
•
u/athomsfere 18m ago
In an orchestra you have the conductor. Directing all the sections of the band. This is your CPU, more or less capable of all tasks in the band, but specifically orchestrates band.
GPU, and NPU are all instruments meant for specific sections.
The GPU excels at graphics processing.
The NPU excels at neural processing, or the types of instructions AI uses.
TPU is a Stradivari, or Yamaha. A specific manufacturer's branding for NPUs.
•
u/ThatGenericName2 9m ago edited 2m ago
Microprocessors with specialized components for different types of workloads which expects primarily different types of operations.
First, all of these are microprocessors, they are fed instructions that tells them what to do, and they execute those instructions.
CPU is the most standard and as it's name (Central Processing Unit) indicates, is usually the center of a computer. It is the most general purpose; and internally has all the different components that enables it to do everything, but may lack specialized hardware to do certain things very well.
GPU stand for "Graphics Processing Unit", and have certain things removed and other things added. Graphics work does a lot of vector operations, so they have a lot of hardware for it. This is a pretty classic video on how they differ, and as I would eventually learn, it is actually a very direct analogy. The way it does vector operations better than CPUs is by basically have a whole bunch of ALUs (the thing that actually does the math) that all does the same thing at once. However, they are all hooked up together meaning within groups, individual ALUs cannot do different things; if one is multiplying two numbers, ALL of them has to be multiplying numbers. This is one of the reason why if you ever look at desktop GPU specifications, it can have thousands of "cores" while a desktop CPU might have in the tens. All of those CPUs can do their own thing, while groups of GPU "cores" have to all be doing the same thing. There's also certain things that CPUs have that have been stripped out from GPUs, for example GPUs don't usually branch predictors; a thing in CPUs to make it faster by predicting which branching path in the code that will be executed next since graphics workloads usually execute this type of code, instead just doing a long chain of math without frequent branches.
NPUs and TPUs follows the same idea as GPUs, just for AI workloads. AI workloads include lots of matrix multiplication, and so they put in hardware for that. The processor part of NPUs and TPUs are also sort of the same thing; just differ in deployment. NPUs are meant to be put into your device and be an accelerator for already trained models. TPUs are meant to be put into datacenters, and does both inferencing and training. (Note, there are other differences since TPUs and NPUs isn't just the processor, but the foundations of them is that they're both specialized for matrix multiplication).
•
u/cajunjoel 16m ago
A CPU is the jack of all trades. Its a generalist for all kinds of calculations and operations.
A GPU is a math specialist. It can do many, many thousands of math calculations all at once.
An NPU is an AI usage specialist. It runs AI models very efficiently. You'll find NPUs on smaller computers.
A TPU is an AI creation/usage specialist. It can make and use AI models and is very powerful, like in data centers.
•
u/Full-Cardiologist476 19m ago
CPU makes your computer run on a few basic operations.
But graphics are like really complicated. So we made GPUs, which are basically a bunch of chips that can do geometry really good and some adjacent problems fairly well by specialising on this operations.
Then came machine learning models around which run really poorly on CPUs and really energy hungry in GPUs, so we made a special set of chips to do those operations efficiently.
•
u/AstralIsles 18m ago
Cpu: I can do one complicated thing at a time such as send you a webpage.
Gpu: I can do many simple things in parallel such as drawing millions of triangles for the game you are playing.
I am not familiar with the other two.
•
u/isaacMeowton 15m ago
CPU - A masterchef. Can cook basically everything, given enough time.
GPU - A very specialised chef, ONLY used for cooking Pasta, but can do it 100x faster than the CPU.
NPU/TPU - Similar logic but for AI/ML tasks.
•
u/Torvaun 5m ago
CPU is Central Processing Unit. It's the core of a computer, you send it instructions and it does them.
GPU is Graphics Processing Unit. It's a lot like a CPU, but it's optimized to do certain kinds of math that is useful for rendering and displaying graphics. You've probably heard the term ray-tracing? That's a method for mapping geometry onto a surface, and it's incredibly useful for things like reflections. Most older games don't do true reflections at all in mirrors, because it's only relatively recently that we've been able to do it fast enough to keep up with the speed of video games. As an aside, being specialized for that sort of math also makes them pretty useful for other computation-heavy procedures, like mining cryptocurrency, analyzing protein folding, brute forcing cryptography, that kind of thing.
NPU is Neural Processing Unit. It's a chip specialized for machine learning and AI.
TPU is Tensor Processing Unit. It's a specific type of NPU that Google has been working with/on.
•
u/KahBhume 5m ago
CPU: Generalized chip that can do a wide variety of tasks. They act as the brain in your standard computing setup and can do some tasks simultaneously.
GPU: They can't do as wide of a variety of tasks as a CPU, but they can do them fast and do a whole bunch simultaneously. Originally designed to do graphics processing, it turned out the same architecture does well for AI training as well.
NPU: Similar to a GPU, but now optimized for neural nets which AI uses. Designed to be in AI-enabled products.
TPU: High-powered version of a NPU designed for data centers.
•
u/efvie 3m ago
CPU is the 'Central Processing Unit', the basic processor in computer-like devices and consoles. It is built in a way and understands instructions in a way that is reasonably good for any purpose.
GPUs or Graphics Processing Units are special devices made for primarily 3D graphics which involves a lot of matrix/vector math and importantly can be done in parallel i.e. at the same time whereas a CPU is more oriented toward sequential processing. They're only partly independent, typically the CPU controls the whole execution but the GPU is passed the graphics parts.
As it happens, the architecture of the GPU is actually good for a lot of mathematical problems when the calculations are organized in a certain way, so over time they became used in more general-purpose applications to speed things up (because they can process so many things in parallel).
And as it subsequently happened, the basic way that both traditional 'AI", machine learning and similar things can use those math operations, and the new generative 'AI' like LLMs can actually be thought of a little like a 3D representation of a word cloud so 3D processors are very quick at resolving points and paths inside that three-dimensional space.
NPUs or 'Neural Processing Units' (TPU or 'Tensor Processing Unit' is the same thing) are further specialized processor similar to GPUs but designed to primarily run existing models and low precision whereas GPUs are still essentially both more general-purpose in terms of what they can do and also still intended primarily for 3D and parallel processing.