Jim Keller: Abstraction Layers from the Atom to the Data Center | AI Podcast Clips

Jim Keller explains how CPUs exploit parallelism through out-of-order execution, finding roughly 10x speedup by fetching large instruction windows and building dependency graphs. Branch prediction evolved from simple last-direction predictors at 85% accuracy to modern deep pattern-recognition systems, with mispredictions triggering expensive pipeline flushes. He contrasts this deterministic approach with GPU-style parallelism and discusses tradeoffs between precise execution and faster, noisier computation in AI and HPC.
Chapters
So let's get into the basics before we zoom back out. How do you build a computer from scratch? What is a microprocessor? What is a microarchitecture? What's an instruction set architecture? Maybe even as far back as what is a transistor.
So the special charm of computer engineering is there's a relatively good understanding of abstraction layers. So down at the bottom you have atoms, and atoms get put together in materials like silicon or doped, silicon or metal, and we build transistors. On top of that, we build logic gates and then functional units like an adder, a subtractor, an instruction parsing unit. And then we assemble those into processing elements. Modern computers are built out of probably 10 to 20 locally organic processing elements or coherent processing elements. And then that runs computer programs. So there's abstraction layers and then software. There's an instruction set you run, and then there's assembly language, C, C, Java, JavaScript. There's abstraction layers essentially from the atom to the data center, right? So when you build a computer, first there's a target. Like, what's it for? Like, how fast does it have to be? Which today there's a whole bunch of metrics about what that is. And then in an organization of 1,000 people who build a computer, there's lots of different disciplines that you have to operate on. Does that make sense? And so.
So there's a bunch of levels. Abstraction in organizational, I can tell. And in your own vision, there's a lot of brilliance that comes in at every one of those layers. Some of it is science, some of it is engineering, some of it is art. What's the most, if you could pick favorites, what's the most important? Your favorite layer on these layers of abstractions, where does the magic enter this hierarchy?
I don't really care. That's the fun. You know, I'm somewhat agnostic to that. So I would say for relatively long periods of time, instruction sets are stable. So the x86 instruction set, the ARM instruction set, what's an instruction set? So it says, how do you encode the basic operations? Load, store, multiply, add, subtract, conditional branch. There aren't that many interesting instructions. If you look at a program and it runs, 90% of the execution is on 25 opcodes, 25 instructions, and those are stable.
What does it mean, stable?
Intel architecture has been around for 25 years.
It works.
It works. That's because the basics are defined a long time ago. Now, the way an old computer ran is you fetched instructions and you executed Them in order. Do the load, do the add, do the compare. The way a modern computer works is you fetch large numbers of instructions, say 500, and then you find the dependency graph between the instructions, and then you execute in independent units the those little micro graphs. So a modern computer, like people like to say computers should be simple and clean. But it turns out the market for simple, clean, slow computers is zero, right? We don't sell any simple, clean computers now. You can. There's how you build it can be clean, but the computer people want to buy. That's say in a phone or a data center, fetches a large number of instructions, computes the dependency graph, and then executes it in a way that gets.
The right answers and optimizes that graph.
Somehow they run deeply out of order. And then there's semantics around how memory ordering works and other things work. So the computer sort of has a bunch of bookkeeping tables that says what order cities operations finish in or appear to finish in. But to go fast, you have to fetch a lot of instructions and find all the parallelism. Now, there's a second kind of computer which we call GPUs today. I call it the difference. There's found parallelism. Like you have a program with a lot of dependent instructions, you fetch a bunch and then you go figure out the dependency graph and you issue instructions out of order. That's because you have one serial narrative to execute which in fact can be done out of order.
Did you call it a narrative?
Yeah.
Wow.
Yeah. So humans think in serial narrative. So read a book, right? You know, there's a sentence after sentence after sentence, and there's paragraphs. Now, you could diagram that. Imagine you diagrammed it properly and you said which sentences could be read in any order, any order, without changing the meaning, right?
That's a fascinating question to ask of a book.
Yeah, yeah, you could do that, right? So some paragraphs could be reordered, some sentences can be reordered. You could say he is tall and smart and X. Right? And it doesn't matter the order of tall and smart. But if you say the tall man is wearing a red shirt, what colors? You know, like, you can create dependencies, right? And so GPUs on the other hand, run simple programs on pixels, but you're given a million of them, and the first order, the screen you're looking at doesn't care which order you do it in. So I call that given parallelism, simple narratives around the large numbers of things where you can just say it's parallel because you told me it was.
So found parallelism, where the narrative is sequential, but you discover like little pockets of parallelism versus turns out large pockets of parallelism. Large. So how hard is it to discover?
How hard is it? That's just transistor count, right? So once you crack the problem, you say, here's how you fetch 10 instructions at a time. Here's how you calculate the dependencies between them. Here's how you describe the dependencies. Here's, you know these are pieces, right?
So once you describe the dependencies, then it's just a graph, sort of. It's an algorithm that finds what is that? I'm sure there's a graph theory theoretical answer here that's solved. But in general, modern programs that human beings write, how much found parallelism is there in that?
10X.
What does 10x mean?
So you execute it in order versus you would get what's called cycles per instruction, and it would be about three cycles per instruction because of the latency of the operations and stuff. And a modern computer executes it like 0.2, 0.25 cycles per instruction. So it's about we today find 10x. And there's two things. One is the found parallelism in the narrative, and the other is the predictability of the narrative. Certain operations say, do a bunch of calculations, and if greater than 1, do this, else do that. That decision is predicted in modern computers to high 90% accuracy. So branches happen a lot. So imagine you have a decision to make every six instructions, which is about the average, right? But you want to fetch 500 instructions, figure out the graph and execute them all in parallel. That means you have, let's say if you fetch 600 instructions and it's every six, you have to fetch, you have to predict 99 out of 100 branches correctly for that window to be effective.
Okay, so parallelism, you can't parallelize branches. Or you can. What does predictive branch mean? Or what does predictive branch?
So imagine you do a computation over and over. You're in a loop. Yep. So while N is greater than one, do. And you go through that loop a million times. So every time you look at the branch, you say it's probably still greater than one.
And you're saying you could do that accurately.
Very accurately. Modern computer.
My mind is blown. How the heck do you do that? Wait a minute.
Well, you want to know, this is really sad. 20 years ago, you simply recorded which way the branch went last time and predicted the same thing. Right.
Okay, what's the accuracy of that?
85%. So then somebody said, hey, let's keep a couple of bits and have a little counter. So when it predicts one way we count up and then pins. So say you have a three bit counter, so you count up and then you count down. And if it's, you know, you can use the top bit as the signed bit. So you have a signed two bit number. So if it's greater than one you predict taken and less than one, you predict not taken. Right. Or less than zero, whatever the thing is. And that got us to 92%. Okay. No, it gets better. This branch depends on how you got there. So if you came down the code one way, you're talking about Bob and Jane and then said, does Bob like Jane? It went one way. But if you're talking about Bob and Jill, does Bob like Jane? You go a different way. So that's called history. So you take the history and encounter. That's cool. But that's not how anything works today. They use something that looks a little like a neural network. So modern, you take all the execution flows and then you do basically deep pattern recognition of how the program is executing. And you do that multiple different ways. And you have something that chooses what the best result is. There's a little supercomputer inside the computer that's trying to predict that calculates which way branches go. So the effective window that it's worth finding grass and gets bigger.
Why was that going to make me sad? Because that's amazing.
It's amazingly complicated.
Oh, wow.
Well, here's the funny thing. So to get to 85% took 1000 bits. To get to 99% takes tens of megabits. So this is one of those. To get the result you want, you know, to get from a window of say 50 instructions to 500, it took three orders of magnitude or four orders of magnitude four bits.
Now if you get the prediction of a branch wrong, what happens then?
You flush the pipe.
You flush the pipe. So it's just the performance cost, but.
It gets even better. Yeah, so we're starting to look at stuff that says so executed down this path. And then you had two ways to go, but far away there's something that doesn't matter which path you went. So you took the wrong path, you executed a bunch of stuff, Then you had the mispredicting, you backed it up, but you remembered all the results you already calculated. Some of those are just fine. Like if you read a book and you misunderstand a paragraph, your understanding of the next paragraph Sometimes is invariant to that understanding, sometimes it depends on it.
And you can kind of anticipate that invariance.
Yeah, well, you can keep track of whether the data changed. And so when you come back through a piece of code, should you calculate it again or do the same thing?
Okay, how much of this is art and how much of it is science? Because it sounds pretty complicated.
Well, how do you describe a situation? So imagine you come to a point in the road where you have to make a decision and you have a bunch of knowledge about which way to go. Maybe you have a map, so you want to go the shortest way, or do you want to go the fastest way, or you want to take the nicest road? So it's. There's some set of data. So imagine you're doing something complicated like building a computer, and there's hundreds of decision points, all with hundreds of possible ways to go. And the ways you pick interact in a complicated way. Right. And then you have to pick the right spot. Right.
So that's harder.
Science. I don't know.
You avoided the question. You just described the Robert Frost poem Road Less Taken, described the Robin Frost problem.
What we do as computer designers, it's all poetry.
Okay, great.
Yeah. I don't know how to describe that, because some people are very good at making those intuitive leaps. It seems like this combinations of things. Some people are less good at it, but they're really good at evaluating the alternatives. And everybody has a different way to do it. And some people can't make those leaps, but they're really good at analyzing it. So when you see computers are designed by teams of people who have very different skill sets. And a good team has lots of different kinds of people. I suspect you would describe some of them as artistic, but not very many, unfortunately, or fortunately. Fortunately? Well, you know, computer design is hard. It's 99% perspiration. The 1%. Inspiration is really important.
But you still need the 99.
Yeah, you got to do a lot of work. And then there are interesting things to do at every level of that stack.
At the end of the day, if you run the same program multiple times, does it always produce the same result? Is there some room for fuzziness there?
That's a math problem. So if you run a correct C program, the definition is. Every time you run it, you get the same answer.
Yeah, that's a math statement.
Well, that's a language definitional statement. So for years, when people did. When we first did 3D acceleration of graphics, you could run the same scene multiple times and get different answers, then some people thought that was okay, and some people thought it was a bad idea. And then when the HPC World used GPUs for calculations, they thought it was a really bad idea. Now, in modern AI stuff, people are looking at networks where the precision of the data is low enough that the data is somewhat noisy, and the observation is the input data is unbelievably noisy. So why should the calculation be not noisy? And people have experimented with algorithms that, say, can get faster answers by being noisy. Like as the network starts to converge, if you look at the computation graph, it starts out really wide, and then it gets narrower, and you can say, is that last little bit that important, or should I start the graph on the next rev before we whittle it all the way down to the answer? Right. So you can create algorithms that are noisy. Now, if you're developing something and every time you run it, you get a different answer, it's really annoying. And so most people think, even today, every time you run the program, you get the same answer.
No, I know, but the question is, that's the formal definition of a programming language.
There is a definition of languages that don't get the same answer, but people who use those. You always want something because you get a bad answer. And then you're wondering, is it because of something in the algorithm or because of this? And so everybody wants a little switch that says, no matter what, do it deterministically. And it's really weird because almost everything going into modern calculations is noisy. So why are the answers have to be so clear?
So where do you stand?
I design computers for people who run programs. So if somebody says, I want a deterministic answer, most people want that.
Can you deliver a deterministic answer? I guess is the question, hopefully, sure.
What people don't realize is you get a deterministic answer, even though the execution flow is very undeterministic. So you run this program 100 times, it never runs the same way twice, ever.
And the answer, it arrives at the.
Same answer, but it gets the same answer every time.
It's just amazing.
Sam.










