CPU vs GPU vs TPU vs DPU vs QPU

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and Far Away lands slaves dig the Earth for beautiful gems called quartz which contain silicon dioxide Alchemist or chemical engineers then refine and cook them into silicon substrate a material that can be doped to act as both a conductor and insulator shamans also known as electrical engineers and inscribe billions of microscopic symbols on them that can't be seen with a naked eye when lightning passes through them they can speak the incomprehensible language of binary highly trained Wizards called software Engineers can learn this language to build powerful machines that create Illusions these Illusions can then control the way people think and act in the real world in today's illusion I will harness this magic to pull back the veil on the almighty computer by looking at four different ways computers actually compute things at the hardware level because to put a computer needs a pu like a CPU GPU TPU or dpu the last 100 years have been crazy the first truly programmable computer was the Z1 which was created by Conrad Zeus in 1936 in his mom's basement but then it got blown up in 1943 during the bombardment of Berlin its entire highly mechanical with over twenty thousand Parts it represents binary data with sliding metal sheets it could do things like Boolean algebra and floating Point numbers and had a clock rate of 1 Hertz which means it could execute one instruction per second to put that in perspective modern CPUs are measured in gigahertz or billions of cycles per second over the next 10 years people thought really hard about how computers should actually work and in 1945 we got the Von Neumann architecture which is still used in modern ships today it's the foundational design that describes how data and instructions are stored in the same memory space then handled by a processing unit a couple years later there is a huge breakthrough with the invention of the transistor which is a semiconductor that can amplify or switch electrical signals like a transistor could represent a one if current passes through it or a zero if current doesn't pass through it this was a hugely forward then in 1958 the integrated circuit was developed allowing multiple transistors to be placed on a single silicon chip then finally in 1971 Intel released the first commercially available microprocessor that had all the features you know and love from a modern CPU it was a 4-bit processor meaning it could handle four bits of data at a time with approximately 2300 transistors the clock speed was 740 kilohertz which was extremely fast at the time CPUs are pretty complicated and if you really want to learn how they work I'd highly recommend reading cpu.land which does an amazing job of breaking down how they actually execute programs it's totally free and was written by high schoolers Lexi Matic and hack Club but what I want to focus on is what they're actually used for so we can compare them to the other pus like its name implies the central processing unit is like the brain of a computer it runs the operating system executes programs and manages Hardware it has access to the system's RAM and includes a hierarchy of caches on the chip itself for faster data retrieval a CPUs optimize for sequential computations that require extensive branching and logic like imagine some navigation software that needs to run an algorithm to compute the shortest possible route between two points the algorithm may have a lot of conditional logic like if else statements that can only be computed one by one or sequentially acpu is optimized for this type of work now modern CPUs also have multiple cores which allows them to do work in parallel which allows you to use multiple applications on your PC at the same time and programmers can write code that does multi-threading to utilize the cores on your machine to run code in parallel check out this video on my second Channel if you want to learn how to do that in JavaScript now to make a computer faster one might think we could just add more and more CPU cores the reality though is that CPU cores are expensive as the cores scale up so does power consumption and the heat dissipation requirements it becomes a matter of diminishing returns and the extra complexity is just not worth it at the time of this video 24 cores is typically the upper limit of higher end ships like Apple's M2 Ultra and Intel's I9 but there are massive chips like the 128 core AMD epic designed for data centers now when it comes to CPUs there are multiple different architectures out there and that's a big deal if you're doing low-level systems programming but every developer should be familiar with arm and x86 64-bit x86 is what you'll find on most modern desktop computers while arm is what you'll find on mobile devices because it has a more simplified instruction set and better power efficiency which means better battery life however this distinction has been changing over the last few years thanks to the Apple silicon chips which have proven that the arm architecture can also work for high performance Computing on laptops and desktops and even Microsoft is investing in running windows with arm in addition arm is becoming more and more popular with Cloud providers like the neoverse chip or Amazon's graviton 3 which allows the cloud to compute more stuff with less power consumption which is one of the biggest expenses in a data center but at some point we've all hit the limitations of a CPU like when I try to run pirated Nintendo 64 games on my Raspberry Pi it lags like crazy that's because a lot of computation is required to calculate the appearance of all the lights and shadows in a game on demand well that's where the GPU comes in a graphics Processing Unit or graphics card is highly optimized for parallel Computing unlike a CPU with a measly 16 cores nvidia's RTX 4080 has nearly 10 000 cores each one of these cores can handle a floating points or integer computation per cycle and that allows games to to perform tons of linear algebra in parallel to render Graphics instantly every time you push a button on your controller gpus are also essential for training deep learning models that perform tons of matrix multiplication on large data sets this has led to massive demand in the GPU market and nvidia's stock price recently landed on the moon so he says okay give me 200 I gave him 200 and for 200 I bought 15 I think it was 20 of Nvidia if gpus have so many cores why not just use a GPU over a CPU for everything the short answer is that not all cores are created equal a single CPU core is far faster than a single GPU core and its architecture can handle complex logic and branching whereas a GPU is only designed for simple computations most of the code out in the world can take advantage of parallel Computing and needs to run sequentially with a single thread a CPU is like a Toyota Camry it's extremely versatile but can't take you to the Moon a GPU is more like a rocket ship it's really fast when you want to go in a straight line but not really ideal if we're going to pick up your groceries as the name lies gpus were originally designed for graphics but nowadays everybody wants them to train an AI that can overthrow the government but there's actually Hardware designed for that use case called the TPU or tensor Processing Unit these chips are very similar to gpus but designed specifically for tensor operations like the matrix multiplication required for deep learning they were developed by Google in 2016 to integrate directly with its tensorflow software a TPU contains thousands of these things called multiply accumulators it allows the hardware to perform matrix multiplication without the need to access registers or shared memory like a GPU would and if you have a neural network that's going to take weeks or months to train atpu could save you millions of dollars that's pretty cool but that brings us to the newest type of pu the dpu or data processing unit the CEO of Nvidia described it as the third major pillar of computing going forward but you'll likely never use one in your own computer because they're designed specifically for Big Data Centers they're most like a CPU and typically based on the arm architecture but are highly optimized for moving data around they handle networking functions like packet processing routing and security and also deal with data storage like compression and encryption the main goal is to relieve the CPU from any data processing jobs so it can focus on living its best life by doing general purpose Computing and with that we've looked at four different ways a computer computes but there's one more wild card that we might get to experience in our lifetime and that's the qpu or Quantum Processing Unit all the chips we've looked at so far deal in bits ones and zeros but quantum computers deal in qubits or Quantum bits that can exist in a superposition of both States simultaneously now a Cuba can represent multiple possibilities at once but when measured it collapses into one of the possible States based on probability these qubits are subject to quantum entanglement which means the state of one is directly related to another no matter the distance between them these properties are used together to create Quantum Gates which are like logic gates and regular computers but work in entirely different ways that I'm too stupid to understand what I do understand is that if this technology ever gets good it will completely change the world current cryptographic systems like RSA are underpinned by the fact that classical algorithms used for factorization would take billions of years to crack with Brute Force even with the best computers of today but quantum computers will be able to run different algorithms like Shore's algorithm that's exponentially faster at factorization and thus poses a major threat to Modern encryption and security luckily there's no quantum computer today that can run this algorithm and even if there were they sure as hell wouldn't be telling you and me about it
Info
Channel: Fireship
Views: 1,659,647
Rating: undefined out of 5
Keywords: webdev, app development, lesson, tutorial
Id: r5NQecwZs1A
Channel Id: undefined
Length: 8min 25sec (505 seconds)
Published: Sat Aug 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.