Tác giả giữ toàn bộ bản quyền (All Rights Reserved) — không phải giấy phép mở. Bạn vẫn xem và học miễn phí trên OpenER; muốn tái sử dụng cần xin phép tác giả.
DAN GARCIA
And welcome back. Now let's dig a little deeper into what we mean by having a multicore computer with a little bit of a history lesson. So this is a wonderful curve.
I really love this curve. It's not my data, but it's a wonderful visualization of the evolution to multicore and why we got to where we are now. So let's go back in time.
We're in the early '70s. We're looking at the total number of transistors in thousands. What I love about this view on the left is that it's unitless.
The units are attached to each of the curves.
So as I look to Moore's law, Moore's law says how many IC, how many Integrated Circuits, how many transistors on an IC, so how many transistors on an integrated circuit.
And we're looking at this number. This number was doubling every 18 months or so, which is a nice line here.
And then at some point, we actually were doubling every two years, doubling every two years in the early stages.
And at some point, it's kind of had a small bend, and we started doubling every 18 months, and we're doing amazing.
So we're just packing more and more transistors on — the feature size is getting smaller. It's getting down to some kind of nanometers, 65, 50, 30, 20.
It's getting smaller and smaller, which means that between two lines, it's getting smaller and smaller between the distance between two signal lines on the chip. Amazing, what they're doing.
Incredible engineering. This is an incredible amount of engineering going on here. If we continue to look here, we're also seeing the frequency is going up. Remember, I mentioned, just increase that heart rate.
Increase that heart rate. Do this, and in fact, it even took a bend where we even went steeper there. Now, we're also seeing the power go up.
So this is a story in which these curves are all related in interesting ways. And the power was going up. It was still small. We didn't care about it.
In the '90s, it was fine. And by the way, this was a great time for computer manufacturers, because they could argue that you need to buy this year's computer because it's twice as fast.
And every year, it was. Every a couple of years, you needed to upgrade.
You just really couldn't live with the computer that you had bought two or three years ago because, boy, the potential to have a computer that was 200 megahertz, and now it's 500, just based on only the clock rate, 250 megahertz.
Okay, 500 megahertz, 800 megahertz, a gigahertz? Oh man, we crossed the gigahertz line to 1.5, 2 gigahertz. Wow, we got — love this.
So for a lot of things in the computing engineering ecosystem, it meant that if you were a computer manufacturer, you were doing great because you can just continue to push machines out, and there were different specs.
And people were comparing, and then all the gamers were there, and the computer scientists were on this side, and the computational scientists who are using it for floating, where all the people were benefiting from this incredible — all this — all these curves were benefiting everybody using these systems.
What's interesting a little bit is that we didn't care about power that much, but people began to have more and more — as this number started to get up here — look at this.
We're now in the — I mean, look at this. This is 100 watts. That's an incandescent light bulb. So people used to say, these systems are getting too hot.
We can't cool them. That was the issue. We couldn't cool these systems down.
You had very arcane heat sinks with a radiator fan and a huge — a radiator system here with a lot of spokes and then a fan trying to blow and get that heat off of it.
And so you'd heat up a room if you were on exhaust-fan side of some of these computers. You would be really hot, be really quite warm.
And they started having liquid cooling because they could — even just air off of a radiator system couldn't cool off the heat sink off of a CPU.
So you had water coming in, and then you had oil coming, and very intricate engineering to get fluid to get in there and touch it as much as it can, get warm, and then get it out here and dissipate it and then cool it down and come back in.
Incredible engineering to try to just cool these things down. At some point, they said, we're not able to cool it anymore. We have to do something about this.
We can't keep turning the clock frequency up. And by the way, there were other architectural improvements as well I mentioned before. We're going SIMD and going wider. We're seeing a lot of performance.
But if you look at the frequency right around — a special thing happened. A sea change in computer architecture happened. Around 2005, look at this number — everything changes around that.
Look at that number. You saw the clock frequency start to level off. Well, that's an issue. The clock frequency levels off.
Now you've got — the power levels off. So you wanted to get to that. You wanted to level off the power, and you did.
By turning the clock down, now you're just kind of doing the same thing as you did before when you clocked them. But now all of a sudden, what's being hit?
By the way, you were still being able to continue Moore's law. You were still having more and more transistors being able to be squeezed into one CPU.
But you were seeing the sequential app performance — all the programmers who back here were lazy — see this curve?
This curve says, you could be lazy and write a bad algorithm, not optimize it, and do nothing, do nothing in terms of trying to squeeze more performance out of your software.
And guess what? The performance was just going up every year.
So lazy programmers — I mean, there are hardworking programmers everywhere, but you didn't have to worry so much as a programmer, as a developer, on how to squeeze the last drip of performance out because you were getting it for free.
You were getting this for free. And all of a sudden, 2005 hits, and you stop getting it for free. So this is an issue. Now we're going to the cloud.
Now we're having larger and larger data sets. Big data became a big deal. But you couldn't handle it. You had no way to work with that big data.
You weren't going to get any faster. If the data set size — you know, you're Pixar, and you have more and more refined models.
All of a sudden, your computers aren't processing them any faster. It's flat. So 2005 was a sea change. And enter the idea that you would have more cores.
This is, again, a history lesson. So in 2005, with — I believe the Intel Core 2 Duo was the first that I remember, was a production-level CPU that had more than one core.
There were architectures where you had two different dies before them, but never two cores in one die.
And so this number of cores started to go up, and it was amazing what that number is. And then you still have to grow as well, right?
This is a linear line on a log. A linear log plot is an exponential curve. So all these are straight lines, but they're exponentials.
So that started to go up and double some number of years. And then all of a sudden, you saw — this is the key — the parallel app performance continued to go up.
And so it said to all software developers, you better learn how to program in parallel.
You better learn how to work with all those cores effectively, because if you're going to live on the yellow line, the sequential app performance, you're flat. You're done.
You want to continue to be able to satisfy your hungry customers, hungry for data, hungry for processing power. You better learn how to program these cores well.
And this is what the goal of these lectures are. So let me just — that's a sample. I'm just literally sampling. We live here in the Bay Area.
Let's go down the road a little bit to Cupertino. This was one of their slides from they released the Apple A14 chip. This is on their phones. What are they saying?
What are what are the highlights of the A14 chip? Six-core CPU. Remember, this is on a phone. This is on a phone, okay?
This is not the one that's the latest and greatest. On a phone, six cores, and in fact, not just six cores.
They actually categorized some number of cores that are — I think they call them Firestorm and Icestorm, like, high-performance cores and then lower-performance cores, cooler. They call it Fire and Ice.
Cooler cores, not as fast, but you have four of them. So it's interesting to be able to distinguish between when you really need to crank it out, put them all on.
But if you're just kind of doing normal things, maybe having more cores but, really, more energy-efficient cores is better, so maybe change the clock rate possibly, thinking about how they do that.
So that's the first thing. They have different categorizations for their six cores. Six cores on a phone. I mean, 2005, no computer had multiple cores.
Maybe you were lucky if you had some special high-end thing, but most computers, they just had one computer, one CPU, one core. And now we're talking about phones having six cores, okay?
It's a new world. I've got a four-core GPU. That's incredible. I've got a 16-core neural engine for neural networking work.
This is unbelievable. And I also have another — so this is on one die. This is a chip. The chip is in the middle.
Look. This is the chip, that you buy this A14 chip, and you get all these pieces inside of it. 11 billion transistors is an incredible number, and you got an image processor as well.
So you're categorizing it, not just saying, well, I'm just going to do the normal CPU, be boring. No, I'm kind of, here's the GPU over here. Here's a neural engine.
Here's an image processing engine. It's incredible what they're putting together. So here's the execution model. As we think about this — if I think about, okay, now that's the world.
You're in a multicore world. What is shared and what isn't shared? So each core has — as the picture we showed the last lecture, each core has access to the entire memory.
So every core can connect to that entire memory there. That's fine. You've got to worry about keeping the caches consistent.
In fact, cache coherency — L1, L2, L3 — making sure that's all clean and coherent — coherent means just all on the same page in some sense.
"Page" is the wrong word because of virtual memory. But the idea is, they're all kind of clued in together and not inconsistent.
That's an important thing, and we're going to talk about that in about three lectures from now, three full lectures from now, not three pieces of one lecture.
So the advantage is you can actually now communicate. I can have these cores, if they needed to, communicate via memory.
If I need to have this core talk to that core, remember, each one of those has its own set of registers and its own caches.
But if I wanted to communicate with this guy, I could write something to a spot, and then I could say, wait, and then you could read from the spot.
So there's a little bit of communication through memory as the shared memory model. So that's a shared variable. You can have a shared variable that are working together, which is very nice.
You could all be writing to the same array. Let's all contribute to one big array. Let's all be reading from an array and then writing to the answers in different spots.
We'll see this when we actually see how we do this in software a little bit. The drawbacks is that — here's the catch — memory is slow.
If the only way these guys can talk is to go to Sacramento, that's what we're talking about, right?
I'm going write to a variable, and it's in memory, and then you're going to read from the variable, or we're all writing to the same thing, whatever, how we do our work.
Memory's slow. Going to Sacramento is slow, so that's a downside. And that's a bottleneck. I have a single bottleneck.
Like, remember we talked about Amdahl's law? That's in a couple of lectures after this. But Amdahl's law says, the serial part of a program is going to be your downfall.
It's going to really be the place that is the bottleneck for any piece of software. And I say serial. Well, there's only one piece of memory, so I'm kind of serially running through this.
I can't, in parallel, think about that. So if I'm all running to the same spot, that's an issue in terms of synchronization. So that's an issue.
You can think about using a multiprocessor in different way. You have what's called job-level parallelism and working on the separate problems, okay?
So one core is working on a movie, and one core is working on a spreadsheet. So that's totally reasonable, and there's no communication.
Or you could have a more complex and more common task, which is, well, I need to be converting something — I'm playing a movie while you can be working on this part of the screen, and I can be working on these pixels.
So you could have multiple cores all working on the same piece of memory, and that's maybe a large matrix or a large array of doing something, and that's really interesting.
And that's what we're going to be speaking about for the next couple of lectures, is doing that. In general, big picture, parallel processing.
In fact, this is under the umbrella of parallel and distributed computing. That's the idea. This is all hard. Doing things at the same time is hard.
It's inevitable. We talked about before, we've kind of run up against trying to squeeze more performance out of a stone, and we can't get it.
So it's almost like we have — it wasn't like, I'm so excited to go parallel because it's making programming easier. It's not. It's making programming a lot harder, but we have to.
It's almost like eating your broccoli. We have to go there to get the performance out of these machines that are being built for us now, so it's inevitable.
The only path to increasing performance really is going parallel and understanding that. And also, it's only way to deal with battery life issues and power issues.
I mentioned before, it isn't the case that we can keep just turning the clock speed up and relying on a computer to be faster every year. That's flat.
These numbers are all flat.
The only way to continue to grow and to continue to make use of the hardware that's coming out of here is to think about how to program parallel systems well.
In mobile systems — we've seen this. I mentioned before in phones, we have multiple cores, and my watch has two cores.
My new watch is Apple Series, what, 4 or 5 or 6 — that has two cores. It's remarkable — and different subcomponents of that as well. You also have different categorizations.
There's dedicated processors for motion and for image and for neural processing, at least on the iPhones. And the GPU has always been — usually, the GPU has been there.
In fact, in the early days of a 6881, one there was a special floating-point unit for that. So we've always had kind of dedicated hardware for things. I say "always."
I mean in my lifetime-ish. But now it really is the case on one die, there are pieces of it. Usually, here's a floating point coprocessor. Boom, a separate die for floating point.
And here's the main CPU, and here's the floating point. Then also let's pull the GPU out, have a big GPU.
Now you have a huge zoom with big fans, and you pay a lot of money for the high-end GPUs for the gamers who do this.
So we've almost always had either floating point separate from the main CPU or the graphics separate from the main CPU. This is useful.
We're going to talk about how to do this at a different scale.
What happens when, rather than talk about one core or one die and how to manage that, what happens when we're thinking about many, many, many machines all in one warehouse, like Facebook and Google and Apple, for Siri, at least?
How many folks — Amazon, obviously. How do you actually think about the warehouse-scale level of that?
If you're controlling maybe a million computers, each computer has many cores, how are you able to program that?
We'll talk about even software ways to do that, and it's very exciting once we get to the ability to be able to hit a couple of lines of Python, even.
Bada-bada-boom, and all of a sudden, a thousand machines can wake up and do your bidding. That's pretty remarkable. So you have multiple nodes.
Each of these modes have multiple CPUs and disk and memory, and think about it as one big unit, which is incredible, and how to cool it is the big deal.
We'll get to that a little later. But you obviously have MIMD, which is multicore, and SIMD, which is these vector-wide operations in each node. Let's talk about some performance.
This is a big-picture kind of lecture, so this is a sense of the year of — kind of every odd year for the last 15 years or so, 18 years or so.
So let's look at 2009 to kind of almost now or in these upcoming years. So how has the number of cores changed? You know, we're growing. On average, we're kind of growing.
Obviously, there are higher ones that are now — I think you will see the latest was 28 cores or something, but these numbers are doubling every — remarkable, doubling every 2 and 1/2 years or so.
That's a 2-and-1/2-times increase total in the number of cores over those 12 years. This is an eight times increase in the number of SIMD bits per core, which is nice.
If you multiply the core times the SIMD bits, the total floating-point operations you can do per cycle is a factor of 20.
So that's 20 times in 12 years, or basically doubling every three years if we can use it. So now I've got this system.
At the bottom line, how do we make use of all this stuff? How do we actually — from the point of view of software, why, I came out of vanilla computer science school.
You can't transplant somebody from taking 1970s computer science and put them today and expect them to be productive, because they don't have any courses on how to make use of all of that parallel hardware.
It's really hard and there's some issues there. So let's close it there and think about how we would even make use of that bottom row.
If you had the crazy high-end machine at the bottom row, how you could even make use of that? We'll see you in the next lecture.
Đăng nhập để đánh giá học liệu này.
Đăng nhập để bình luận — chưa ai bình luận về học liệu này.
Không có khóa học liên quan.