David Patterson: Computer Architecture and Data Storage | Lex Fridman Podcast #104

David Patterson, Turing Award winner and Berkeley CS professor, traces the microprocessor revolution from Moore's Law through the RISC vs CISC debate. He explains why RISC won, the rise of open-source RISC-V, and how specialized accelerators and MLPerf benchmarks now drive machine learning hardware design.
Chapters
The following is a conversation with David Patterson, Turing Award winner and professor of Computer Science at Berkeley. He's known for pioneering contributions to RISC processor architecture used by 99% of new chips today, and for co creating RAID storage. The impact that these two lines of research and development have had in our world is immeasurable. He's also one of the great educators of computer science in the world. His book with John Hennessy is How I first learned about and was humbled by the inner workings of machines at the lowest level Quick summary of the ads two sponsors the Jordan Harbinger show and Cash App Please consider supporting the podcast by going to jordanharbinger.com lex and downloading cash app and using code lexpodcast. Click on the links, buy the stuff and the best way to support this podcast and in general, the journey I'm on in my research and startup. This is the Artificial Intelligence Podcast. If you enjoy it, subscribe on YouTube, review it the 5 stars on Apple podcast, support it on Patreon, or connect with me on Twitter lexfridman spelled without the e, just F R I D M A N. As usual, I'll do a few minutes of ads now and never any ads in the middle that can break the flow of the conversation. This episode is supported by the Jordan Harbinger show. Go to jordanharbinger.com Lex it's how he knows I sent you on that page. There's links to subscribe to it on Apple Podcasts, Spotify and everywhere else. I've been binging on this podcast. It's amazing. Jordan is a great human being. He gets the best out of his guests, dives deep, calls them out when it's needed, and makes the whole thing fun to listen to. He's interviewed Kobe Bryant, Mark Cuban, Neil DeGrasse Tyson, Garry Kasparov and many more. I recently listened to his conversation with Frank Abagnale, author of Catch Me if youf can and one of the world's most famous con men. Perfect podcast length and topic for a recent long distance run that I did. Again, go to jordanharbinger.com lex to give him my love and to support this podcast. Subscribe also on Apple Podcasts, Spotify and everywhere else. This show is presented by Cash App, the greatest sponsor of this podcast ever and the number one finance app in the App Store. When you get it, use code Lex Podcast Cash App lets you send money to friends, buy Bitcoin, and invest in the stock market with as little as $1. Since Cash App allows you to buy Bitcoin let me mention that cryptocurrency in the context of the history of money is fascinating. I recommend Ascent of Money as a great book on this history. Also, the audiobook is amazing. Debits and credits on ledgers started around 30,000 years ago. The US dollar created over 200 years ago, and the first decentralized cryptocurrency released just over 10 years ago. So given that history, cryptocurrency is still very much in its early days of development, but it's still aiming to and just might redefine the nature of money. So again, if you get Cash app from the app Store Google Play and use the code lexpodcast, you get $10. And cash app will also donate $10 to FIRST, an organization that is helping to advance robotics and STEM education for young people around the world. And now here's my conversation with David Patterson. Let's start with the big historical question. How have computers changed in the past 50 years at both the fundamental architectural level and in general in your eyes?
Well, the biggest thing that happened was the invention of the microprocessor. So computers that used to fill up several rooms could fit inside your cell phone. And not only, and not only did they get smaller, they got a lot faster. So they're million times faster than they were 50 years ago and they're much cheaper and they're ubiquitous. You know, there's 7.8 billion people on this planet. Probably half of them have cell phones right now. Just remarkable.
There's probably more microprocessors than there are people. Sure.
I don't know what the ratio is, but I'm sure it's above 1. Maybe it's 10 to 1 or some number like that.
What is a microprocessor?
So a way to say what a microprocessor is to tell you what's inside a computer. So a computer forever has classically had five pieces. There's input and output, which kind of naturally, as you'd expect, is input is like speech or typing and output is displays. There's a memory and like the name sounds it, it remembers things. So it's integrated circuits whose job is you put information in and when you ask for it, it comes back out. That's memory. And the third part is the processor where the team microprocessor comes from. And that has two P pieces as well. And that is the control, which is kind of the brain of the processor and the, the what's called the arithmetic unit. It's kind of the brawn of the computer. So if you think of the. As a human body, the arithmetic unit, the thing that does the number crunching is the. Is the body, and the control is the brain. So those five pieces, input, output, memory, arithmetic unit, and control, have been in computers since the very dawn. And the last two are considered the processor. So a microprocessor simply means a processor that fits on a microchip. And that was invented about 40 years ago, was the first microprocessor.
It's interesting that you refer to the arithmetic unit as the like. You connect it to the body and the controllers of the brain. So I guess I never thought of it that way. It's a nice way to think of it because most of the actions the microprocessor does in terms of literally sort of computation, microprocessor does computation. It processes information. And most of the thing it does is basic arithmetic operations. What are the operations, by the way?
It's a lot like a calculator. So there are add instructions, subtract instructions, multiply and divide. And kind of the brilliance of the invention of the. Of the micro, of the computer or the processor is that it performs very trivial operations, but it just performs billions of them per second. And what we're capable of doing is writing software that can take these very trivial instructions and have them create tasks that can do things better than human beings can do today.
Just looking back through your career, did you anticipate the kind of how good we would be able to get at doing these small basic operations? How many surprises along the way where you just kind of sat back and said, wow, I didn't expect it to go this fast, this good?
Well, the fundamental driving force is what's called Moore's Law, which was named after Gordon Moore, who's a Berkeley alumnus. And he made this observation very early in what are called semiconductors. And semiconductors are these ideas. You can build these very simple switches and you can put them on these microchips? And he made this observation over 50 years ago. He looked at a few years and said, I think what's going to happen is the number of these little switches called transistors is going to double every year for the next decade. And he said this in 1965, and in 1975, he said, well, maybe it's going to double every two years. And that what other people since named that Moore's Law, guided the industry. And when Gordon Moore made that prediction, he wrote a paper back in, I think in the 70s and said, not only is this going to happen, he wrote what would be the implications of that. And in this article from 1965, he. He shows ideas like computers being in cars and computers being in something that you would buy in the grocery store and stuff like that. So he kind of not only called his shot, he called the implications of it. So if you were in. In the computing field and if you believed Moore's prediction, he kind of said, what the. What would be happening in the future? So, so it's not kind of. It's. At one sense, this is what was predicted. And you could imagine it was easy to believe that Morris Law was going to continue. And so this would be the implications. On the other side, there are these shocking events in your life. Like, I remember driving in Marin, across the bay in San Francisco, and seeing a bulletin board at a local civic center, and it had a URL on it. And it was like for the people at the time, these first URLs, and that's the, you know, www. Select stuff with the HTTP. People thought it was. Looked like alien. Alien writing, right? You'd see these advertisements and commercials or bulletin boards that had this alien writing on it. So for the lay people, it's like, what the hell is going on here? And for those people in the industry, it was, oh, my God, this stuff is getting so popular, it's actually leaking out of our nerdy world into the real world. So that, I mean, there was events like that. I think another one was, I remember with the early days of the personal computer when we started seeing advertisements in magazines for personal computers. Like, it's so popular that it's made the newspapers. So at one hand, you know, Gordon Moore predicted it and you kind of expected it to happen. But when it really hit and you saw it affecting society, it was. It was shocking.
So maybe taking a step back and looking both the engineering and philosophical perspective, what do you see as the layers of abstraction in the computer? Do you see a computer as a set of layers of abstractions?
Yeah, I think that's one of the things that computer science fundamentals is these things are really complicated in the way we cope with complicated software and complicated hardware is these layers of abstraction. And that simply means that we suspend disbelief and pretend that the only thing you know is that layer and you don't know anything about the layer below it. And that's the way we can make very complicated things. And probably it started with hardware. That's the way it was done. But it's been proven extremely useful. And, you know, I would say in a modern computer today, there might be 10 or 20 layers of abstraction and they're all trying to kind of enforce this contract is all you know is this interface. There's a set of commands that you can are allowed to use and you stick to those commands and we will faithfully execute that. And it's like peeling the layers of a London of an onion. You get down, there's a new set of layers and so forth. So for people who want to study computer science, the exciting part about it is you can keep peeling those layers. You either take your first course and you might learn to program in Python and then you can take a follow on course and you can get it down to a lower level language like C. And you know, and you can go, and then you can, if you want to, you can start getting into the hardware layers and you keep getting down all the way to that transistor that I talked about that Gordon Moore predicted. And you can understand all those layers all the way up to the highest level application software. So it's a very kind of magnetic field if you're interested. You can go into any depth and keep going in particular what's happening right now, or it's happened in software last 20 years and recently in hardware, there's getting to be open source versions of all of these things. So what open source means is what the engineer, the programmer designs. It's not secret that belonging to a company, it's out there on the world Wide web so you can see it. So you can look at for lots of pieces of software that you use, you can see exactly what the programmer does. If you want to get involved. That used to stop at the hardware. Recently there's been an efforts to make open source hardware and those interfaces open. So you can see that. So instead of before you had to stop at the hardware, you can now start going layer by layer below that and see what's inside there. So it's, it's a remarkable time that for the interested individual can really see in great depth what's really going on in the computers that power everything that we see around us.
Are you thinking also when you say open source at the hardware level, is this going to the design architecture, instruction set level or is it going to literally the, you know, the manufacturer of the, of the actual hardware of the actual chips, whether that's ASICS specialized, a particular domain or the general.
Yeah, so let's talk about that a little bit. So when you get down to the bottom layer of software, the way software talks to hardware is in a vocabulary and what we call that vocabulary we call that. The words of that vocabulary are called instructions. And the technical term for the vocabulary is instruction set. So those instructions are like we talked about earlier. There can be instructions like add, subtract and multiply divide. There's instructions to put data into memory, we, which is called a store instruction, and to get data back, which is called a load instructions. And those simple instructions go back to the very dawn of computing. And, you know, in 1950, the commercial computer had these instructions. So that's the instruction set that we're talking about. So up until, I'd say, 10 years ago, these instruction sets are all proprietary. So a very popular one is owned by intel, the one that's in the cloud and in all the PCs in the world. Intel owns that instruction set. It's referred to as the X86. There have been a sequence of ones that the first number was called 8086. And since then there's been a lot of numbers, but they all end in 86. So there's been that kind of family of instruction sets.
And that's proprietary, and that's proprietary.
The other one that's very popular is from arm that kind of powers all the cell phones in the world, all the iPads in the world, and a lot of things that are so called Internet of things devices. Arm, and that one is also proprietary. ARM will license it to people for a fee, but they own that. So the new idea that got started at Berkeley kind of unintentionally 10 years ago is early in my career, we pioneered a way to do these vocabularies instruction sets that was very controversial at the time. At the time, in the 1980s, conventional wisdom was these vocabularies instruction sets should have powerful instructions. So polysyllabic kind of words. You can think of that. And so instead of just add, subtract and multiply, they would have polynomial divide or sort a list. And the hope was of those powerful vocabularies that'd make it easier for software. So we thought that didn't make sense for microprocessors. There was people at Berkeley and Stanford and IBM who argued the opposite. And we called that was a reduced instruction set computer. And the abbreviation was risc. And typical for computer people, we use the abbreviations to start pronouncing it. So RISC was the thing. So we said for microprocessors, which with Gordon's more is changing really fast, we think it's better to have a pretty simple set of instructions, reduced set of instructions, that that would be a better way to build microprocessors, since they're going to be changing so fast due to Moore's Law. And then we'll just use standard software to cover the use, generate more of those simple instructions. And one of the pieces of software that it's in that software stack going between these layers of abstractions is called a compiler. And it basically translates, it's a translator between levels. We said the translator will handle that. So the technical question was, well, since there are these reduced instructions, you have to execute more of them. Yeah, that's right. But maybe you could execute them faster. Yeah, that's right. They're simpler, so they go faster, but you have to do more of them. So what's that trade off look like? And it ended up that we ended up executing maybe 50% more instructions, maybe a third more instructions, but they ran four times faster. So this risk, controversial risk ideas proved to be maybe factors of 3 or 4 better.
I love that this idea was controversial and almost kind of like rebellious. So that's in the context of what was more conventional is the complex instructional set computing. So how'd you pronounce that?
Cisc. Cisc RISC versus cisc. And, and believe it or not, this sounds very, very, you know, who cares about this, Right? It was violently debated at several conferences. It's like, what's the right way to go? And people thought risk was a de evolution. We were going to make software worse by making the construction simpler. And there are fierce debates at several conferences in the 1980s. And then later in the 80s, it kind of settled to these benefits.
It's not completely intuitive to me why risk has for the most part won.
Yeah. So why did that happen?
Yeah, yeah. And maybe I can sort of say a bunch of dumb things that could lay the land for further commentary. So to me, this is kind of interesting thing. If you look at C versus C with modern compilers, you really could write faster code with C. So relying on the compiler to reduce your complicated code into something simple and fast. So to me, comparing risk, maybe this is a dumb question, but why is it that focusing the definition, the design of the instruction set on very few simple instructions in the long run, provide faster execution versus coming up with, like you said, a ton of complicated instructions, then over time, you know, years, maybe decades, you come up with compilers that can reduce those into simple instructions for you.
Yeah. So let's try and split that into two pieces. So if the compiler can do that for you, if the compiler can take, you know, a complicated program and produce simpler instructions, then the programmer doesn't care. Right, programmer? I don't care. Just how fast is the computer I'm using, how much does it cost? And so what happened kind of in the software industry is right around before the 1980s, critical pieces of software were still written not in languages like C or C, they were written in what's called assembly language, where there's this kind of humans writing exactly at the instructions, at the level that a computer can understand. So they were writing add, subtract, multiply, you know, instructions. It's very tedious. But the belief was to write this lowest level of software that, that people use, which are called operating systems, they had to be written in assembly language because these high level languages were just too inefficient, they were too slow or the programs would be too big. So that changed with a famous operating system called Unix, which is kind of the grandfather of all the operating systems today. So the Unix demonstrated that you could write something as complicated as an operating system in a language like C. So once that was true, then that meant we could hide the instruction set from the programmer. And so that meant then it didn't really matter. The programmer didn't have to write lots of these simple instructions. That was up to the compiler. So that was part of our arguments for RISC is if you were still writing assembly language, there's maybe a better case for sysconstructions. But if the compiler can do that, it's going to be, you know, that's done once the computer translates it once, and then every time you run the program, it runs at this potentially simpler instructions. And so that was the debate, right? And people would acknowledge that the simpler instructions could lead to a faster computer. You can think of monosyllabic instructions, you could say them, you know, if you think of reading, you could probably read them faster or say them faster than long instructions, the same thing. That analogy works pretty well for hardware. And as long as you didn't have to read all lot more of those instructions, you could win. So that's the basic idea for ris.
But it's interesting that in that discussion of Unix and C that there's only one step of levels of abstraction from the code that's really the closest to the machine to the code that's written by human, at least to me. Again, perhaps a dumb intuition, but it feels like there might have been more layers, sort of different kinds of humans stacked on top of each other.
So what's true and not true about what you said is several of the layers of software like, so if you hear two layers would be, suppose we just talk about two layers. That would be the operating system like you get from Microsoft or From Apple, like iOS or the Windows operating system and let's say applications that run on top of it like Word or Excel. So both the operating system could be written in C and the application could be written in C, but you could construct those two layers and the applications absolutely do call upon the operating system. And the change was that both of them could be written in higher level languages. So it's one step of a translation. But you can still build many layers of abstraction of software on top of that. And that's how, how things are done today. So still today, many of the layers that you'll, you'll deal with, you may deal with debuggers, you may deal with linkers, there's libraries, many of those today will be written in C, say, even though that language is pretty ancient. And even the Python interpreter is probably written in C or C, so lots of layers there are probably written in these, some old fashioned efficient languages that still take one step to produce these instructions, produce RISC instructions, but they're composed, each layer of software invokes one another through these interfaces and you can get 10 layers of software that way.
So in general to Risk was developed here at Berkeley.
It was kind of the three places that were these radicals that advocated for this against the rest of the community were IBM, Berkeley and Stanford.
You're one of these radicals. And how radical did you feel, how confident did you feel, how doubtful were you that RISK might be the right approach? Because it may. You can also intuit that is kind of taking a step back into simplicity, not forward and to simplicity.
Yeah, no, it was easy to make, yeah, it was easy to make the argument against it. Well, this was my colleague John Hennessy at Stanford and I, we were both assistant professors and for me I, I just believed in the power of our ideas. I thought what we were saying made sense. Moore's Law is going to move fast. The other thing that I didn't mention is one of the surprises of these complex instruction sets. You could certainly write these complex instructions if the programmer is writing them themselves. It turned out to be kind of difficult for the compiler to generate those complex instructions. Kind of ironically, you'd have to find the right circumstances that just exactly fit this complex instruction. It was actually easier for the compiler to generate these simple instructions. So not only did these complex instructions make the hardware more difficult to make build, often the compiler wouldn't even use them. And so it's harder to build. The compiler doesn't use them that much. The simple instructions go better with Moore's Law that, you know, the number of transistors is doubling every. Every two years. So we're going to have, you know, the. You want to reduce the time to design the microprocessor. That may be more important than these number instructions. So I think we believed in the. That we were right, that this was the best idea. Then the question became in these debates, well, yeah, that's a good technical idea, but in the business world, this doesn't matter. There's other things that matter. It's like arguing that if there's a standard width of railroad tracks and you've come up with a better width, but the whole world is covered in railroad tracks, so your ideas have no chance of success. Commercial success, it was technically right, but commercially it'll be insignificant.
Yeah, it's kind of sad that this world, the history of human civilization, is full of good ideas that lost because somebody else came along first with a worse idea. And it's good that in the computing world, at least some of these have. Well, you could. I mean, there's probably still CIS people that say, yeah, there still are.
Well, and what happened was, what was interesting, Intel, a bunch of the Cisco Companies with Cisco instruction sets of vocabulary, they gave up, but not intel, what intel did to its credit, because Intel's vocabulary was in the personal computer. And so that was a very valuable vocabulary because the way we distribute software is in those actual instructions. It's in the instructions of that instruction set. So then you don't get that source code, what the programmers wrote, you get after it's been translated into the lowest level. That's if you were to get a floppy disk or download software, it's in the instructions of that instruction set. So the x86 instruction set was very valuable. So what intel did cleverly and amazingly is they had their chips in hardware do a translation step. They would take these complex instructions and translate them into essentially in RISC instructions in hardware on the fly, you know, at gigahertz clock speeds. And then any good idea that RISC people had, they could use, and they could still be compatible with this, with this really valuable PC software base, which also had very high volumes, you know, 100 million personal computers per year. So the CISC architecture in the business world was actually one in this PC era.
So just going back to the time of designing risk, when you design an instruction set architecture, do you Think like a programmer? Do you think like a microprocessor engineer? Do you think like a artist, a philosopher? Do you think in software and hardware? I mean, is it art? Is it science?
Yeah, I'd say I think designing a good instruction set is an art. And I think you're trying to balance the simplicity and speed of execution with how, well, easy it will be for compilers to use it. Right? You're trying to create an instruction set that everything in there can be used by compilers. There's not things that are missing that'll make it difficult for the program to run. They run efficiently. But you want it to be easy to build as well. So it's that kind of. So you're thinking. I'd say you're thinking hardware, trying to find a hardware software compromise that'll work well. And it's, you know, it's. You know, it's a matter of taste, right? It's kind of fun to build instruction sets. It's not that hard to build an instruction set, but to build one that catches on and people use, you know, you have to be, you know, fortunate to be the right place in the right time or have a design that people really like.
Are you using metrics? So is it quantifiable? Because you kind of have to anticipate the kind of programs that people write ahead of time. So is that. Can you use numbers, can you use metrics, can you quantify something ahead of time? Or is this, again, that's the art part where you're kind of anticipating.
No, it's a big change, kind of what happened, I think, from Hennessy's and my perspective, in the 1980s, what happened was going from kind of really taste and hunches to quantifiable. And in fact, he and I wrote a textbook at the end of the 1980s called computer a Quantitative Approach.
I heard of that.
And it's the thing. It had a pretty big impact in the field because we went from textbooks that kind of listed. So here's what this computer does, and here's the pros and cons, and here's what this computer does in pros and cons to something where there were formulas and equations where you could measure things. So specifically for instruction sets, what we do and some other fields do is we agree upon a set of programs, which we call benchmarks and a suite of programs, and then you develop both the hardware and the compiler and you get numbers on how well your computer does given its instruction set, and how well you implemented it in your Microprocessor and how good your compilers are in computer architecture, using professor's terms, we grade on a curve rather than grade on an absolute scale. So when you say these programs run this fast, well, that's kind of interesting. But how do you know it's better? Well, you compare it to other computers of the same time. So the best way we know how to make turn it into kind of more science and experimental and quantitative is to compare yourself to other computers of the same era that have the same access, the same kind of technology on commonly agreed benchmark programs.
So maybe to toss up two possible directions we can go. One is what are the different trade offs in designing architectures? We've been already talking about CISC and Risk, but maybe a little bit more detail in terms of specific features that you were thinking about. And the other side is what are the metrics that you're thinking about when looking at these trade offs?
Yeah, well, let's talk about the metrics. So during these debates, we actually had kind of a hard time explaining, convincing people the ideas. And partly we didn't have a, a formula to explain it. And a few years into it, we hit upon a formula that helped explain what was going on. And I think if we can do this, see how it works orally to do this. If I can do a formula orally, let's see. So fundamentally the way you measure performance is how long does it take a program to run? Program. If you have 10 programs, and typically these benchmarks were sweet because you'd want to have 10 programs so they could represent lots of different applications. So for these 10 programs, how long did it take to run? Well, now when you're trying to explain why it took so long, you could factor how long it takes a program to run into three factors. One of the first one is how many instructions did it take to execute? So that's what we've been talking about, you know, the instructions of how many did it take? All right, the next question is how long did each instruction take to run on average? So you'd multiply the number of instructions times how long it took to run, and that gets you time. Okay, so that's. But now let's look at this metric of how long did it take the instruction to run. Well, it turns out the way we could build computers today is they all have a clock. And you've seen this when you, if you buy a microprocessor, it'll say 3.1 GHz or 2.5 GHz and more GHz is good. Well, what that is is the speed of the clock. So 2.5 gigahertz turns out to be 4 billionths of instruction or 4 nanoseconds. So that's the clock cycle time. But there's another factor which is what's the average number of clock cycles it takes per instruction? So it's number of instructions, average number of clock cycles, and the clock cycle time. So in these risk debates, they would concentrate on but RISC needs to take more instructions. And we'd argue maybe the clock cycle is faster. But what the real big difference was was the number of clock cycles per instruction per instruction.
That's fascinating. What about the mess of the beautiful mess of parallelism in the whole picture?
Parallelism, which has to do with, say, how many instructions could execute in parallel and things like that. You could think of that as affecting the clock cycles per instruction because it's the average clock cycles per instruction. So when you're running a program, if it took 100 billion instructions and on average it took two clock cycles per instruction, and they were 4Ns, you could multiply that out and see how long it took to run. And there's all kinds of tricks to try and reduce the number of clock cycles per instruction. But it turned out that the way they would do these complex instructions is they would actually build what we would call an interpreter in a simpler. A very simple hardware interpreter. But it turned out that for the CISC instructions, if you had to use one of those interpreters, it would be like 10 clock cycles per instruction, where the RISC instructions could be two. So there'd be this factor of five advantage in clock cycles per instruction. We have to execute, say, 25 or 50% more instructions. So that's where the win would come. And then you could make an argument whether the clock cycle times are the same or not. But pointing out that we could divide the benchmark results time per program into three factors. And the biggest difference between risk and CIS was the clock cycles per. You execute a few more instructions, but the clock cycles per instruction is much less. And that was what this debate. Once we made that argument, then people said, oh, okay, I get it. And so we went from. It was outrageously controversial in 1982 that maybe, probably by 1984 or so people said, oh, yeah, technically they've got a good argument.
What are the instructions in the risk instruction set?
Just to get an intuition, okay, 1995, I was asked to scientific to predict the future of what microprocess look at the future. So I, and that, and I'd seen these predictions and usually people predict something outrageous just to be entertaining. Right. And so my prediction for 2020 was, you know, things are going to be pretty much. They're going to look very familiar to what they are. And they are. And if you were to read the article, you know, the things I said are pretty much true. The instructions that have been around forever are kind of the same.
And that's the outrageous prediction, actually, given how fast computers have been going on.
Well, Morse law was going to go on, we thought, for 25 more years, who knows? But kind of the surprising thing. In fact, Hennessy and I, you know, won the, the ACM AM Touring award for both the risk construction set contributions and for that textbook I mentioned. But, you know, we're surprised that here we are 35, 40 years later after we did our work and the, the conventional wisdom of the best way to do instruction sets is still those risk instruction sets that looked very similar to what we looked like, you know, we did in the 1980s. So those. Surprisingly, there hasn't been some radical new idea, even though we have, you know, a million times as many transistors as we had back then.
But what are the basic instructions and how do they change over the years? So are we talking about addition, subtraction? These are the specific.
So the, the. So the things that are in a calculator, you are in a computer. So any of the buttons that are in the calculator in the computer things. So the. So if there's a memory function key, and like I said, those turns into putting something in memory is called a store. Bring something back, it's called load.
Just a quick tangent. When you say memory, what does memory mean?
Well, I told you there were five pieces of a computer. And if you remember in a calculator there's a memory key, so you want to have intermediate calculation and bring it back later. So you'd hit the memory plus key, M plus maybe, and it would put that into memory and then you'd hit an RM like recurrent instruction and it'd bring it back into the display so you don't have to type it, you don't have to write it down and bring it back again. So that's exactly what memory is. You can put things into it as temporary storage and bring it back when you need it later. So that's memory and loads and stores. But the big thing, the difference between a computer and a calculator is that the computer can make Decisions. And amazingly, decisions are as simple as is this value less than zero or is this value bigger than that value? So there's. And those instructions, which are called conditional branch instructions, is what give computers all its power. If you were in the early days of computing, before what's called the general purpose microprocessor, people would write these instructions kind of in hardware, but it couldn't make decisions. It would do the same thing over and over again. With the power of having branch instructions, they can look at things and make decisions automatically, and it can make these decisions billions of times per second. And amazingly enough, we can get, thanks to advances in machine learning, we can create programs that can do something smarter than human beings can do. But if you go down that very basic level, the instructions are the keys on the calculator, plus the ability to make decisions, these conditional branch instructions and.
All decisions fundamentally can be reduced down to these branch instructions.
Yep. So, in fact, and so going way back in the stack, back to. We did four risk projects at Berkeley in the 1980s. They did a couple at Stanford in the 1980s. In 2010, we decided we wanted to do a new instruction set learning from the mistakes of those risk architectures of the 1980s. And that was done here at Berkeley almost exactly 10 years ago. And the people who did it, I participated, but Krista Sonovich and others drove it. They called it RISC V to honor those risks, the four risk projects of the 1980s.
So what does RISC V involve?
So RISC V is another instruction set vocabulary. It's learned from the mistakes of the past, but it still has, if you look at the, there's a core set of instructions that's very similar to the simplest architectures from the 1980s. And the big difference about RISC V is it's open. So I talked earlier about proprietary versus open source software. So this is an instruction set. So it's a vocabulary, it's not hardware. But by having an open instruction set, we can have open source implementations, open source processors that people can use.
Where do you see that going? So it's a really exciting possibilities. But just like in the Scientific American, if you were to predict 10, 20, 30 years from now, that kind of ability to utilize open source instruction set architectures like RISC V, what kind of possibilities might that unlock?
Yeah, and so just to make it clear, because this is confusing, the specification of RISC V is something that's like in a textbook. There's books about it. So that's what that's defining, an interface. There's Also, the way you build hardware is you write it in languages. They're kind of like C, but they're specialized for hardware that gets translated into hardware. And so these implementations of this specification are what are the open source? So they're written in something that's called verilog or vhdl, but it's put up on the web just like you can see the C code for Linux on the web. So that's the open instruction set enables open source implementations of RISC V. So.
You can literally build a processor using this instruction set.
Yep, people are, people are. So what happened to us? The story was this was developed here for our use to do our research, and we made it. We licensed under the Berkeley Software Distribution License. Like a lot of things get detected licensed here. So other academics use it, they wouldn't be afraid to use it. And then about 2014, we started getting complaints that we were using in our research, in our courses and we got complaints from people in industry is why did you change your instruction set between the fall and the spring semester? And, well, we get complaints from industry all the time. Why the hell do you care what we do with our instruction set? And then when we talked to them, we found out there was this thirst for this idea of an open instruction set architecture. And they had been looking for one. They stumbled upon ours at Berkeley, thought it was, boy, this looks great, we should use this one. And so once we realized there was this need for an open instruction set architecture, we thought that's a great idea. And then we started supporting it and tried to make it happen. So this was kind of, we accidentally stumbled into this and to this need and our timing was good and so it's really taking off. There's, you know, universities are good at starting things, but they're not good at sustaining things. So like Linux has a Linux foundation, there's a RISC V foundation that we started. There's an annual conferences. And the first one was done, I think January of 2015. And the one that was just last December in it, you know, it had 50 people at it. And the, this one last December had, I don't know, 1700 people were at it. And the company's excited all over the world. So if predicting into the future, you know, if we were doing 25 years, I would predict that RISC V will be, you know, possibly the most popular instruction set architecture out there because it's a pretty good instruction set architecture and it's open and free and there's no reason lots of people shouldn't use it. And there's benefits. Just like Linux is so popular today compared to 20 years ago, and the fact that you can get access to it for free, you can modify it, you can improve it for all those same arguments. So people collaborate to make it a better system for everybody to use. And that works in software. And I expect the same thing will happen in hardware.
So if you look at arm, intel, mips, if you look at just the lay of the land and what do you think, just for me, because I'm not familiar, how difficult this kind of transition would, how much challenges this kind of transition would entail. Do you see? Let me ask my dumb question. In other words, no, that's.
I know where you're headed. Well, there's a bunch. I think the thing you point out, there's. There's these very popular proprietary instruction sets, the X86.
And so how do we move to RISC V potentially in sort of in the span of 5, 10, 20 years, kind of a unification, given that the devices, the kind of way we use devices, IoT mobile devices and in the cloud just keeps changing.
Well, part of it, a big piece of it, is the software stack. And right now, looking forward, there seem to be three important markets. There's the cloud. The cloud is simply companies like Alibaba and Amazon and Google, Microsoft having these giant data centers with tens of thousands of servers in maybe a hundred of these data centers all over the world. And that's what the cloud is. So the computer that dominates the Cloud is the x86 instruction set. So the instruction or the instruction sets used in the cloud are the X86. Almost 100% of that today is X86. The other big thing are cell phones and laptops. Those are the big things today. I mean, the PC is also dominated by the X86 instructor set, but those sales are dwindling. There's maybe 200 million PCs a year and there's. Is there one and a half billion phones a year? There's numbers like that. So for the phones, that's dominated by ARM and now, and a reason that I talked about the software stacks and the third category is Internet of Things, which is basically embedded devices, things in your cars and your microwaves everywhere. So what's different about those three categories is for the cloud, the software that runs in the cloud is determined by these companies. Alibaba, Amazon, Google, Microsoft. So they control that software stack. For the cell phones, there's both. For Android and Apple, there's software they supply, but both of them have Marketplaces where anybody in the world can build software and that software is translated or compiled down and shipped in the vocabulary of Army. So that's what's referred to as binary compatible because the actual. It's the instructions are turned into numbers, binary numbers and shipped around the world.
And so just a quick interruption. So arm, what is arm? ARM is an instruction like a risk based.
Yeah, it's a risk based instruction. It's a proprietary one. ARM stands for Advanced Risk Machine. ARM is the name where the company is. So it's a proprietary risk architecture. Architecture. So and it's been around for a while and it's, you know, the. Surely the most popular instruction set in the world right now. They every year billions of chips are using the ARM design in this post PC era.
Was it one of the early risk adopters of the risc idea?
The first arm goes back, I don't know, 86 or so. So Berkeley and Stad did their work in the early 80s. The Arm guys needed an instruction set and they read our papers and it heavily influenced them. So getting back to my story, what about Internet of Things? Well, software is not shipped in Internet of Things. It's the embedded device. People control that software stack. So the opportunities for RISC V everybody thinks is in the Internet of Things, embedded things, because there's no dominant player like there is in the cloud or the smartphones and you know, it doesn't have a lot of licenses associated with. And you can enhance the instruction set if you want. And it's. And people have looked at instruction sets and think it's a very good instruction set. So it appears to be very popular there. It's possible that in the cloud people, those companies control their software stacks so that it's possible that they would decide to use RISC V. If we're talking about 10 and 20 years in the future, the one that'll be harder would be the cell phones. Since people ship software in the ARM instruction set that you'd think be the more difficult one. But if, if RISC V really catches on in, you know, you could in a period of a decade, you can imagine that's changing over too.
Do you have a sense why RISC V or ARM has dominated. You mentioned these three categories. Why has, why did ARM dominate. Why does it dominate the mobile device space? And maybe the. My naive intuition is that there's some aspects of power efficiency that are important that somehow come along with risk.
Well, part of it is for these old CIS construction sets like in the X86 it was more expensive to these for, you know, they're older. So they have disadvantages in them because were designed 40 years ago. But also they have to translate in hardware from CIS constructions to RISC constructions on the fly. And that costs both silicon area, the chips are bigger to be able to do that and it uses more power. So arm, which has followed this risk philosophy, is seen to be much more energy efficient. And in today's computer world, both in the cloud and the cell phone and Internet things, it isn't the limiting resource isn't the number of transistors you can fit in the chip, it's what, how much power can you dissipate for your application. So by having a reduced instruction set, that's possible to have simpler hardware which is more energy efficient. And energy efficiency is incredibly important in the cloud. When you have tens of thousands of computers in a data center, you want to have the most energy efficient ones there as well. And of course for embedded things running off of batteries, you want those to be energy efficient and cell phones too. So I think it's believed that there's a energy disadvantage of using these more complex instruction set architectures.
So the other aspect of this is if we look at Apple, Qualcomm, Samsung, Huawei, all use the ARM architecture and yet the performance of the systems varies. I mean, I don't know whose opinion you take on, but you know, Apple for some reason seems to perform better in terms of these implementations architectures. So where's the magic Enter the big change.
How's that happen? Yeah, so what ARM pioneered was a new business model is they said, well, here's our proprietary instruction set and we'll give you two ways to do it. Either we'll give you one of these implementations written in things like C called Verilog and you can just use ours. Well, you have to pay money for that. Not only pay, we'll give you their, you know, will license you to do that or you could design your own. And so we're talking about numbers like tens of millions of dollars to have the right to design your own since they it's the instruction set belongs to them. So Apple got one of those, the right to build their own. Most of the other people who build like Android phones just get one of the designs from ARM to do it themselves. So Apple developed a really good microprocessor design team. They, you know, acquired a very good team that had was building other microprocessors and brought them into the company to build their designs. So the instruction sets are the same the specifications are the same, but their hardware design is much more efficient than I think everybody else's. And that's given Apple an advantage in the marketplace in that the iPhones tend to be faster than most everybody else's phones that are there.
It'd be nice to be able to jump around and kind of explore different little sides of this. But let me ask one sort of romanticized question. What to you is the most beautiful aspect or idea of risk instruction set or instruction sets or this work that you've done?
You know, I, I, I'm, you know, I, I was always attracted to the idea of, you know, small is beautiful. Is that the temptation in engineering? It's kind of easy to make things more complicated. It's harder to come up with a, it's more difficult, surprisingly, to come up with a simple, elegant solution. And I think that there's a bunch of small features of, of risk in general that, you know, where you can see this, examples of keeping it simpler makes it more elegant. Specifically in RISC V, which, you know, I'm, I was kind of the mentor in the program, but was really driven by Christo Sanovich and two graduate students, Andrew Waterman, Jensip Lee is they hit upon this idea of having a subset of instructions, a nice simple subset instructions like 40ish instructions that all software, the software stack RISC V can run just on those 40 instructions. And then they provide optional features that could accelerate the performance. Instructions that if you needed them, could be very helpful, but you don't need to have them. And that's really a new idea. So RISC V has right now maybe five optional subsets that you can pull in, but the software runs without them. If you just want to build the, just the, the core 40 instructions, that's fine, you can do that. So this is fantastic educationally, is you can explain computers, you only have to explain 40 instructions and not thousands of them. Also, if you invent some wild and crazy new technology like, you know, biological computing, you'd like a nice simple instruction set and you can RISC 5. If you implement those core instructions, you can run, you know, really interesting programs on top of that. So this idea of a core set of instructions that the software stack runs on and then optional features that if you turn them on, the compilers were used, but you don't have to, I think is a powerful idea. What's happened in the past for the proprietary instruction sets is when they add new instructions, it becomes required piece. And so that all, all microprocessors in the Future have to use those instructions. So it's kind of like for a lot of people, as they get older, they gain weight. Right. The weight and age are correlated. And so you can see these instruction sets getting bigger and bigger as they get older. So RISC V lets you be as slim as you're as a teenager. And you only have to add these extra features if you're really going to use them, rather than you have no choice, you have to keep growing with the instruction set.
I don't know if the analogy holds up, but that's a beautiful notion that it's almost like a nudge towards. Here's the simple core that's the essential.
Yeah, I think the surprising thing is still, if we brought back the pioneers from the 1950s and showed them the instruction set architectures, they'd understand it. They say, wow, that doesn't look that different. Well, you know, I'm surprised. And it may be something, you know, to talk about philosophical things. I mean, there may be something powerful about those, you know, 40 or 50 instructions that all you need is these commands like these instructions that we talked about. And that is sufficient to build. To bring about artificial intelligence. And so it's a remarkable surprising to me that as complicated as it is to build these things, microprocessors, where the line widths are narrower than the wavelength of light, is this amazing technologies at some fundamental level. The commands that software executes are really pretty straightforward and haven't changed that much in. In decades, which. What a surprising outcome.
So underlying all computation, all Turing machines, all artificial intelligence systems, perhaps might be a very simple instruction set, like a RISC V or it's.
Yeah, I mean, that's kind of what I said. I was interested to see. I had another more senior faculty colleague and he had written something in Scientific American and his 25 years in the future and his turned out about when I was a young professor and he said, yep, I checked it. I was interested to see how that was going to turn out for me. And it's pretty held up pretty well. But yeah, so there must be something fundamental about those instructions that were capable of creating intelligence from pretty primitive operations and just doing them really fast.
You kind of mentioned a different, maybe radical computational medium like biological. And there's other ideas. So there's a lot of spaces in asics or domain specific. And then there could be quantum computers. And so we can think of all those different mediums and types of computation. What's the connection between swapping out different hardware systems in the instruction set? Do you see those as disjoint or are they fundamentally coupled?
Yeah. So what's so kind of if we go back to the history when Moore's Law is in full effect and you're getting twice as many transistors every couple of years, kind of the challenge for computer designers is how can we take advantage of that? How can we turn those transistors into better computers? Faster, typically. And so there was an era, I guess, in the 80s and 90s where computers were doubling performance every 18 months. And if you weren't around then, what would happen is you had your computer and your friend's computer, which was like a year or year and a half newer, and it was much faster than your computer, and you, he, he or she could get their work done much faster than your template because you were. So people took their computers, perfectly good computers, and threw them away to buy a newer computer because the computer one or two years later was so much faster. So that's what the world was like in the 80s and 90s. Well, with the slowing down of Moore's Law, that's no longer true right now. Not des side computers, but the laptops. I only get a new desk, a laptop, when it breaks, right? Oh, damn, the disk broke or this display broke, I got to buy a new computer. But before you would throw them away because it just, they were just so sluggish compared to the latest computers. So that's, you know, that's a huge change of what's gone on. So. But since this lasted for decades, kind of programmers and maybe all of society is used to computers getting faster regularly. We now, now believe those of us who are in computer design, it's called computer architecture, that the path forward is instead is to add accelerators that only work well for certain applications. So since Moore's Law is slowing down, we don't think general purpose computers are going to get a lot faster. So the intel processors of the world are not going to haven't been getting a lot faster. They've been barely improving like a few percent a year. It used to be doubling every 18 months and now it's doubling every 20 years. So which is shocking. So to be able to deliver on what Morris Law used to do, we think what's going to happen, what is happening right now is people adding accelerators to their microprocessors that only work well for some domains. And by sheer coincidence, at the same time that this is happening has been this revolution in artificial intelligence called machine learning. So with, as I'm sure your Other guests have said, you know, AI had these two competing schools of thought is that we could figure out artificial intelligence by just writing the rules top down. Or that was wrong. You had to look at data and infer what the rules are. The machine learning and what's happened in the last decade or eight years is machine learning has won. And it turns out that machine learning, the hardware you build for machine learning, is pretty much multiply the matrix. Multiply is a key feature for the way machine learning is done. So that's a godsend for computer designers. We know how to make matrix multiply run really fast. So general purpose micro processors are slowing down. We're adding accelerators for machine learning that fundamentally are doing matrix multiplies much more efficiently than general purpose computers have done. So we have to come up with a new way to accelerate things. The danger of only accelerating one application is how important is that application. Turns out machine learning gets used for all kinds of things. So serendipitously we found something to accelerate that's widely applicable. And we don't even. We're in the middle of this revolution of machine learning. We're not sure what the limits of machine learning are. So this has been kind of a godsend if you're going to be able to deliver on improved performance. As long as people are moving their programs to be embracing more machine learning, we know how to give them more performance. Even as Moore's Law is slowing down.
And counterintuitively, the machine learning mechanism, you can say is domain specific, but because it's leveraging data, it actually could be very broad in terms of the domains it could be applied in.
Yeah, that's exactly right.
It's almost sort of. People sometimes talk about the idea of software 2.0. We're almost taking another step up in the abstraction layer in designing machine learning systems. Because now you're programming in a space of data, in the space of hyperparameters, it's changing fundamentally the nature of programming. And so the specialized devices that accelerate the performance, especially neural network based machine learning systems, might become the new general.
Yes. So this the thing that's interesting, point out, these are not tied together. The enthusiasm about machine learning, about creating programs driven from data, that we should figure out the answers from data rather than kind of top down, which is classically the way most programming is done and the way artificial intelligence used to be done. That's a movement that's going on at the same time, coincidentally. And the first word in machine learning is machines. Right. So that's going to increase the demand for computing. Because instead of programmers being smart writing those things down, we're going to instead use computers to examine a lot of data to kind of create the programs. That's the idea. And remarkably, this gets used for all kinds of things very successfully. The image recognition, the language translation, the game playing. And it gets into pieces of the software stack like databases and stuff like that. We're not quite sure how general purpose it is, but that's going on independent of this hardware stuff. What's happening on the hardware side is Moore's Law is slowing down right when we need a lot more cycles. It's failing us right when we need it because there's going to be a greater increase in computing. And then this idea that we are going to do, so called domain specific. Here's a domain that your greatest fear is you'll make this one thing thing work and that'll help, you know, 5% of the people in the world. Well this, this looks like it's a very general purpose thing. So the timing is fortuitous that if we can perhaps if we can keep building hardware that will accelerate machine learning, the, the neural networks that'll be, the timing will be right. That that neural network revolution will transform software, the so called software 2.0 and the software of the future will be very different from the software of the past. And just as our microprocessors, even though we're still going to have that same basic risk instructions to run big pieces of the software stack, like user interfaces and stuff like that, we can accelerate the kind of the small piece that's computationally intensive. It's not lots of lines of code, but it takes a lot of cycles to run that code. That, that's going to be the accelerator piece. So that's what makes this from a computer designer's perspective, a really interesting decade. What Hennessy and I talked about in the title of our Turing Warren speech is a new golden age. We see this as a very exciting decade, much like when we were assistant professors and the risk stuff was going on. That was a very exciting time where we were changing what was going on. We see this happening again. Tremendous opportunities of people because we're fundamentally changing how software is built and how we're running it.
So which layer of the abstraction do you think most of the acceleration might be happening if you look in the next 10 years? Google is working on a lot of exciting stuff with the tpu sort of there's closer to the hardware, there could be optimizations around closer to the instruction set. There could be optimization at the compiler level. It could be even at the higher level. Software stack.
Yeah, it's going to be. If you think about the old RIS debate, it was software hardware, it was the compilers improving as well as the architecture improving. And that's likely to be the way things are now with machine learning. They're using domain specific languages. Languages like TensorFlow and PyTorch are very popular with the machine learning people that those are raising the level of abstraction. It's easier for people to write machine learning in these domain specific languages like pytorch in TensorFlow.
So where most optimization might happen and.
So there'll be both the compiler piece and the hardware piece underneath it. So as you kind of the fatal flaw for hardware people is to create really great hardware but not have brought along the compilers. And what we're seeing right now in the marketplace because of this enthusiasm around hardware for machine learning is getting probably billions of dollars invested in startup companies. We're seeing startup companies go belly up because they focused on the hardware but didn't bring the software stack along. We talked about benchmarks earlier, so I participated in machine learning. Didn't really have a set of benchmarks. I think just two years ago they didn't have a set of benchmarks. And we've created something called MLPerf, which is machine Learning Benchmark suite. And pretty much the companies who didn't invest in the software stack couldn't run MLPerf very well. And the ones who did invest in software Stack did. And we're seeing, you know, like kind of in computer architecture this is what happens. You have these arguments about risk versus people spend billions of dollars in the marketplace to see who wins. It's not, it's not a perfect comparison, but it kind of sorts things out. And we're seeing companies go out of business and then companies like there was a company in Israel called Habana. They came up with machine learning accelerators. They had good MLPerf scores. Intel had acquired a company earlier called Nirvana a couple years ago. They didn't reveal their MLPerf scores, which was suspicious. But a month ago intel announced that they're canceling the Nirvana product line and they've bought Habana for $2 billion. And Intel's going to be shipping Habana chips which have hardware and software and run the MLPerf programs pretty well. And that's going to be their product line in the future.
Brilliant. So maybe just a linker. Briefly. MLPerf. I love metrics. I Love standards that everyone can gather around. What are some interesting aspect to that portfolio of metrics?
Well, one of the interesting metrics is what we thought. I was involved in the start. Peter Mattson is leading the effort from Google. Google got it off the ground, but we had to reach out to competitors and say, there's no benchmarks here. We think this is bad for the field. It'll be much better if we look at examples. Like in the risk days, there was an effort to create a. For the people in the RISC community got together, competitors got together building risk microprocessors to agree on a set of benchmarks that were called spec. And that was good for the industry. It's rather before the different risk architectures were arguing, well, you can believe my performance, others, but those other guys are liars. And that didn't do any good. So we agreed on a set of benchmarks and then we could figure out who was faster between the various risk architectures. But it was a little bit faster, but that grew the market rather than people were afraid to buy anything. So we argued the same thing would happen with MLPerf. Companies like Nvidia were maybe worried that it was some kind of trap. But eventually we all got together to create a set of benchmarks and do the right thing and we agree on the results. So we can see whether TPUs or GPUs or CPUs are really faster and how much the faster. And I think from an engineer's perspective, as long as the results are fair, you can live with it. Okay, you kind of tip your hat to your colleagues at another institution, boy, they did a better job than this. What you hate is if it's false, right? They're making claims and it's just marketing bullshit and that's affecting sales. So from an engineer's perspective, as long as it's a fair comparison and we don't come in first place, that's too bad, but it's fair. So we wanted to create that environment for MLPerf. And so now there's 10 companies, I mean 10 universities and 50 companies involved. So pretty much MLPerf has is this is the way you measure machine learning performance. And it didn't exist even two years ago.
One of the cool things that I enjoy about the Internet has a few downsides, but one of the nice things is people can see through BS a little better with the presence of metrics. So it's really nice.










