[
  {
    "startMs": 12480,
    "text": "Hello everyone. My name is Daniel. Uh, I work on AI and AI agents here at Cerebras. Um, what's your name?"
  },
  {
    "startMs": 20020,
    "text": "I'm Michelle. I'm a co-founder at Gimlet Labs, where we're building a multi-silicon neocloud to optimize inference at every layer of the stack."
  },
  {
    "startMs": 28380,
    "text": "And we're really excited to bring you our talk, all the things we have to do to satisfy your insatiable need for tokens."
  },
  {
    "startMs": 36720,
    "text": "As you know, AI spend is going kind of bananas right now, with this year we're sl-slated to spend seven hundred and sixty-five billion dollars on compute, and in twenty thirty one, up to one point six trillion dollars. The frontier labs are having a mad dash to secure as much compute as possible to buy, um, across hardware vendors, p- to do both training for their frontier models, as well as to serve all of their users. And all of their compute is going to satisfy"
  },
  {
    "startMs": 66720,
    "text": "everyone's insatiable need for tokens.  Um, Google, at their IO last year, said that they were serving four hundred and eighty trillion tokens per month, and l-last month, they said that it jumped up to three point two quadrillion tokens per month. So all of this is happening at the same time as models are getting cheaper and faster. Llama three point three seventy B, when it was first released, compared to now, is now twenty-five percent cheaper, while still being three point six times"
  },
  {
    "startMs": 96480,
    "text": "faster. So in today's talk, we're gonna talk about two things. One, what have we done so far to optimize inference to make it cheaper and faster? And what does the roadmap look like to juice perf and throughput even further? So to do this, let's take a little bit of a time jump to twenty twenty two and learn about all the optimizations that led us to the point we're at now and hopefully what the future looks like. So LLMs produce tokens one"
  },
  {
    "startMs": 126440,
    "text": "at a time in something called an auto-regressive loop. So to generate one additional token, you need to read all of the weights from memory into compute. So most of the time, the compute is sitting idle. It's just waiting for memory to be able to stream in all the weights necessary to do the compute itself. So up to ninety percent of the time, the compute's just sitting there waiting on memory to load. So how can we figure out how to optimize this so there's less idle time, and you can make full advantage and serve"
  },
  {
    "startMs": 156180,
    "text": "tokens faster? So what you can do is throw more compute at the problem. So instead of streaming in the whole set of weights, what if you could split up the entire model into four and have each GPU take care of a fourth of the model each? Then you could reduce, in theory, the amount of time it takes to serve a single token by four times. However, you have to pay a tax if you wanna do this. Before the attention block and then the F... Uh, so after the attention block and an FFN block, you have to do"
  },
  {
    "startMs": 186200,
    "text": "something called all reduce, where you take each of the individual calculations from each GPU, and you combine it all together, so you can actually get a calculation. Because each of those GPUs doesn't have the whole picture, it only does one-fourth of the model. So you need to do this across every layer twice, which can lead to only getting two x speed up for getting four x the amount of compute that you add on. If I were to graph this in a pretty graph, um, you can see that throwing more GPUs at the problem does get you faster tokens, but it requires"
  },
  {
    "startMs": 216480,
    "text": "exponentially more energy to serve a single token as you s- put in more compute at the problem because of the communication overhead we just talked about. So if we flip the Y-axis here, so it's throughput, you can see that this resembles something like a Pareto frontier, where you can see that you have to make some kind of sacrifice between throughput and speed when you're an inference provider. A great example of this is Claude Code Fast Mode, where you can spend, I think, six x the amount of tokens to serve a single token compared to"
  },
  {
    "startMs": 246360,
    "text": "regular Claude for twice the speed. So for that product, they're really optimizing towards the right of the Pareto frontier, where they're getting the speed, but at the cost of not being able to serve as many tokens. So during today's talk, we're gonna talk about what are the innovations we have done in the past and in the future to be able to shift the Pareto frontier to the right. So you al-already know from our previous slides that to generate each token, you have to read the whole model. So what if we could s-spend one"
  },
  {
    "startMs": 276420,
    "text": "pass that we already paid for to serve multiple requests? So that is where the idea of batching and continuous batching comes in. The idea of batching is when you take a weight read that you've already done and be able to serve multiple user requests. However, the problem though is that some of these requests are longer than others, which means that there's all of these idle periods in the compute where nothing is happening. So how can we solve this problem and squeeze out more performance?"
  },
  {
    "startMs": 306380,
    "text": "That's where continuous batching comes in. So the idea here is that for every single idle slot, you slot in a new user request to be served during that same weight read to be able to serve as many requests as possible. However, this does come with a slight downside because every single token, when you do inference, requires you to save something into the KV cache because that's how the attention block works. You need to understand how every single token, like what the K and V vectors"
  },
  {
    "startMs": 336340,
    "text": "are. This can add up very quickly. So if you're running a coding agent with very long context, for example, a hundred and twenty-eight K context, you're going to save forty-two gigabytes of KV cache that is needed to serve that individual request. So the rule of thumb here for a seventy billion parameter model is that for every three thousand tokens, you need one gigabyte of additional KV cache, and that's for one user request. So imagine you're doing batching, and you're doing like eight different requests at the same time. Then your KV cache is going to explode, and you will not"
  },
  {
    "startMs": 366300,
    "text": "have enough memory to be able to serve all of your requests. So what are some of the innovations we have done to be able to optimize how we use memory? So that's where paged KV cache comes into play. So how traditionally KV cache worked was that you would have physical memory that you would reserve to make sure that you could have enough room to be able to store all of the KV information from each request into memory. However, this came with a downside and a lot of inefficiency because you would just have a lot of memory blocks"
  },
  {
    "startMs": 396280,
    "text": "that would be reserved but wouldn't actually be used. So the idea with a paged KV cache is we use something s- that's similar to like an OS or a virtual machine where you provision a whole memory block that's all virtual, and you can store wherever there's free space KV cache for each request. So this allows you to serve three times more requests than not having a paged KV cache and just doing what was before. And this really reduces the amount of wasted space where you're reserving memory slots without"
  },
  {
    "startMs": 426300,
    "text": "actually using them. This was right after, followed by an innovation called prompt caching. So the idea here is that if you have a coding agent or if you have a chat app that has a very long system prompt, you don't actually have to recalculate the KV cache needed every single time you have a request. What you can do is you can reuse the KV cache that you calculated already for the previous request for the next request. That way, you can s- pick up where you left off. Here, you can skip"
  },
  {
    "startMs": 456280,
    "text": "the very, very time-consuming prefill phase. And you might be wondering, what is prefill? So during inference, you can split up what happens into two major phases, prefill and decode. So the prefill phase consists of all the things that happen once the re- request arrives, and then w- ends when the first tokens gets generated. And here you can see this when you type something into ChatGPT, and then it takes a couple seconds before it starts returning the first token, and then it goes kind of like smoothly from"
  },
  {
    "startMs": 486140,
    "text": "there. So what's happening during the first couple of seconds where it's not returning anything is that it's computing K and V vectors for every single prompt token that you've inputted and produces the first output token. This is very compute bound because you can optimize the hell out of this. You can parallelize this extremely. However, after the first token is generated, what happens is, uh, that you decode one token at a time, reusing the KV cache you just built in the prefill phase. So this is more reliant on memory."
  },
  {
    "startMs": 516320,
    "text": "The reason I'm talking about this is because something happened lately that's really messing up a lot of inference pipelines, which is super, super token-hungry coding agents. So let's say you have a coding agent that's using 200K context or 500K context, or a million context, right? What happens is that it starts to clog up the pipeline. While prefill is running, no other prefill or decode request can get through. So this is kind of catastrophic if you have a bunch of people that are sending in coding requests and a couple people that are just trying to figure out like"
  },
  {
    "startMs": 546260,
    "text": "math qual- problems in chat mode. So to avoid this clogging problem, there is an innovation called chunked prefill. That kind of goes and solves this problem, and the idea is quite simple here. The idea is taking a very long piece of prefill, chopping it up into smaller bits, so you can interleave in different decode and prefill requests. That way, there's not one thing that's taking up a bunch of time and clogging the whole pipeline. So now, Michelle, tell"
  },
  {
    "startMs": 576220,
    "text": "us more about what else we can optimize."
  },
  {
    "startMs": 578300,
    "text": "Yeah, so all of the optimizations that Daniel just talked about are runtime level optimizations. So that explains, uh, we explore how we make inference more efficient within a single worker. But in order to, to keep pushing that frontier, we really need to start looking at system level optimizations, which is how can we distribute these workloads across many different workers?"
  },
  {
    "startMs": 600700,
    "text": "And so the first thing to recognize there is that every request is different. So take, for example, a summarization use case. You're throwing the LLM a bunch of different documents, and you just really want a single question answered. And so this workload is going to have a long prompt and short answer, and so it's dominated by that prefill phase and so therefore compute bound. On the other hand, you might have a case where it's the opposite. Let's say you want to write a long story or book, you just wanna pass it a few themes for it to"
  },
  {
    "startMs": 630680,
    "text": "go off of. And so this is gonna have a short prompt and long answer, and this is gonna be dominated by decode because you have so many output tokens compared to the number of input tokens coming in, and this is gonna be memory bound. And finally, you can have a case that's somewhere in the middle, right? It's both a long prompt, a long answer, and you're seeing here that both the prefill and decode phases, and therefore compute and memory both matter. And by looking at these different examples, you can really see that the resource requirements that"
  },
  {
    "startMs": 660740,
    "text": "you have for your hardware, it's pretty different depending on what your workload looks like. And so how do you prevent yourself from getting, you know, bound by compute, bound by memory? And so one t- way to do that is called disaggregation, so splitting up your workload to different worker nodes. And so the most common form is called prefill decode disagg, where you're actually splitting and disaggregating this workload by phase."
  },
  {
    "startMs": 686600,
    "text": "And what that allows you to do is essentially have two pools. So you have your prefill pool, that's gonna be running the prefill part of your workload, the decode pool, that's gonna be running the decode part of your workload. And taking the summarization use case, for example, you know, you're gonna wanna scale up that prefill pool so you're not blocked by the compute, and scale down your decode pool because you don't wanna waste resources when you just really don't have that much decode work to do. And it's nice 'cause now you can scale all these independently, and neither part is"
  },
  {
    "startMs": 716280,
    "text": "stalling the other. And we can take that one step farther, right? We said before, prefill, that workload itself is inherently bound by compute. Decode, that is bound by memory. And just walking through that really quickly again, the reason for that is as you're doing decode, you're stepping through each of these tokens one by one, and for every decode step, you're rereading, you know, the entire KV cache, right? That's gonna be memory bound."
  },
  {
    "startMs": 741748,
    "text": "So yeah, um, the, the thing that Michelle just said about this being memory bound, this can be clearly seen by what the hardware can actually do. So GPUs, right? Uh, the, the speed at which you can transfer data from memory into compute is limited by something called memory bandwidth. So for an H100, this looks like 3.35 terabytes per second. However, Cerebras has 7,000 times the bandwidth of a H100, with 21,000 terabytes per second. This is because we have a very"
  },
  {
    "startMs": 771768,
    "text": "specialized SRAM-based memory architecture on our chip. So this really means that Cerebras is really built for decode. So we can serve tokens at 3,000 tokens per second versus an H100 serving it at 600 tokens per second for decode. So we're really excited to partner with AWS to productionize this. So we are going to partner with AWS Trainium, so they can serve prefill using their AWS Trainium chips, use their EFA service to transfer the KV"
  },
  {
    "startMs": 801808,
    "text": "cache to our Cerebras CS-3 systems to finally serve the end token. So this will lead us to give us 5X high-speed token capacity in the same footprint. So this is one of the things that we're doing to try to make fast inference more accessible and cheaper for developers. So we're really excited to really pa- pursue this partnership."
  },
  {
    "startMs": 819928,
    "text": "And at Gimlet, we're really generalizing that beyond just Trainium and Cerebras. What Gimlet is building is essentially a multi-silicon inference cloud, which takes your workload, breaks it down into finer grain pieces, determines the resource characteristics of all of those different pieces, and then figures out the best way to map it to the underlying hardware, where that hardware can be really anything, right? Nvidia, AMD, Trainium, Cerebras, d-Matrix, Intel Gaudi, the list goes on and on. And by running those tasks on the machine that is most efficient for running"
  },
  {
    "startMs": 849868,
    "text": "it, we're actually seeing pretty crazy results. So we're seeing three to 10 times faster inference compared to homogenous systems that have the same power budget. And this is diving into more than just the prefill decode disaggregation than before, and some of those techniques are, for example, disaggregating based on model instead of on phase. And so that's called speculative decoding. So just reviewing again the decode phase. Typically, you do a forward pass for each of the detoke- to- decode tokens that you're getting out,"
  },
  {
    "startMs": 879868,
    "text": "and that's the standard way of doing it. What speculative decode is, is that you essentially have a draft model, and this is just a smaller form of the full model that, um, can generally approximate the results that you get out of it. And the nice thing there is because it's smaller, it runs a lot more quickly and also uses less resources. And so in speculative decode, what you can do is, in order to get, you know, the nine next tokens, you will essentially run the decode on that draft model first. It's gonna give you back what is called candidate tokens. So you're"
  },
  {
    "startMs": 909908,
    "text": "not 100% sure all these tokens are right, but because, you know, often these have been fine-tuned or trained off of the full model, it's, it's approximately right. And you want to validate, okay, are these the tokens that I actually want to output? And so you'll actually run the next phase on that full model that's called the verify stage to validate, okay, which of these tokens are correct? And essentially, you can keep doing this until, you know, you've validated all these tokens from the draft model. And at the end of the day, you can see here on the top, the standard way of running it, you"
  },
  {
    "startMs": 939928,
    "text": "needed to run that forward pass on your full model nine times to get those nine tokens. On the other hand, with speculative decode, you actually only needed to run it three times on that full model. And if you can get that draft model to run really, really quickly, then that time is minimal, and you can really shorten the amount of time it takes to get your tokens. And looking at some more concrete results, so this is essentially that Pareto frontier that Daniel was showing earlier, where X-axis is the speed at which you're getting the tokens, and the Y-axis is"
  },
  {
    "startMs": 969868,
    "text": "the throughput. And so the baseline case we're comparing to here is prefill decode disagg across homogenous GPUs. And you can see that, you know, throughput is pretty good, but as soon as you're pushing on that speed, that throughput drops pretty drastically. So what if you then run speculative decode across those same GPUs? So now you're running that draft model, and you're able to see-- you're able to get that curve to the right. And the reason for that is because you're running the decode on that full model less times. But we can push that even farther, right? Like, going"
  },
  {
    "startMs": 999887,
    "text": "back to our theme of running those workloads on the hardware that can run it best on something such as, you know, d-Matrix or Cerebras, where you're able to run small models very, very quickly, you see drastic performance improvements. So here, this is where you're seeing those numbers. For that same throughput, right, you're able to get 10X the interactivity compared to if you're just running it on homogenous machines."
  },
  {
    "startMs": 1025288,
    "text": "The final form of disagg we wanted to talk about is called attention FFN disagg, and this one gets pretty exciting when you think about serving large models, and I'm saying like 3 trillion parameter models, where these models are so large that even just running one layer, it can be pretty resource intensive. And so the concept is essentially the same thing, right? Like for that particular task that you need to do, whether it's that attention layer or the feed forward FFN network layer, then you are essentially trying to figure out, okay, what are the resource"
  },
  {
    "startMs": 1054648,
    "text": "characteristics that what is the best hardware to map it to? And so the attention layer, that's gonna be more memory bound. It's doing a lot of KV cache accesses. The FFN layer, that's doing a lot of dense matrix multiplications. And so then it makes sense, right? You're gonna run the attention on the machine that has memory bandwidth, the FFN layer on the machines that can run those matrix multipli- multiplications as quickly as possible. And essentially what happens here is even within the model, you're ping-ponging across, you know, many different machines in order to, to get the inference from that"
  },
  {
    "startMs": 1084508,
    "text": "model and just really disaggregating every single layer. And one thing that we really wanted to note here is that there is no best form of disagg. There is actually no best hardware. It really depends on the trade-offs that you have for, you know, depending on what your model is, your workload, and what you need for latency and what you need for throughput guarantees."
  },
  {
    "startMs": 1106564,
    "text": "And as we look towards the future, we see that agents are only becoming more and more incorporated into our everyday life. It's incorporated into our work, everyone is using it, and it's continuing to push that need for more and faster tokens."
  },
  {
    "startMs": 1120464,
    "text": "Yeah, it's really getting yeeted to the right."
  },
  {
    "startMs": 1122744,
    "text": "I, I told Daniel not to say that.   Um, but the good thing about this is that even though, you know, this seems like a crazy, crazy target, we can actually use agents to help us solve these problems and keep pushing the frontier. And so one of the things that we're doing at Gimlet is actually using an agent to generate optimized kernels. Especially for our use case where we wanna support such a wide range of different kinds of hardware, we need to figure out how do you make that problem a lot more tractable? 'Cause right now, how people generate and, or how people"
  },
  {
    "startMs": 1152784,
    "text": "optimize kernels is that there's a lot of people sitting there hand tuning and figuring out how to optimize these kernels. And the thing is that these optimizations can vary pretty drastically based on, you know, the model that you're trying to run, the hardware that you're running on, even within generations of the hardware, and, you know, the workload shape itself. And so what we do at Gimlet is we built KForge, which is an agent for generating these kernels. It takes in a bunch of information like your hardware profiles, your workload profiles, basically anything that you"
  },
  {
    "startMs": 1182764,
    "text": "can use to figure out how to optimize kernels, and we solve it as a brute force problem, right? And so here's an example, right? We have a forward pass, and the kernel that, um, KForge optimized from it, and we're seeing pretty interesting results. So last week, you know, we're running the agent for probably less than the span of a week, and within that time, it was able to speed up GPT-OSS 120B on AMD hardware by 33% end to end. And the interesting thing to note here is that this is building on top of kernels that have already"
  },
  {
    "startMs": 1212724,
    "text": "been optimized."
  },
  {
    "startMs": 1215944,
    "text": "And you can go and take, you know, agents to the next level and use them to help us build and design custom silicon that is hyper-tuned for specific models or your specific workload. This can then be used to train even better and smarter and faster AI, which then can also be used then to design the next generation of the custom silicon. And, you know, this loop keeps going on and on, and it's a recursive loop. Like, shout out to the folks at Recursive."
  },
  {
    "startMs": 1242864,
    "text": "And I wanna end the talk by saying that we're just getting started in our journey to optimize throughput and speed on inference. Because at the very top of the stack, you don't think really about inference optimization when you talk about, like, incident response, right? But when you have agents that are making our systems much more reliable and increasing uptime, we're getting more throughput, and we can get more tokens."
  },
  {
    "startMs": 1266904,
    "text": "Or you can apply agents to the problem of bringing up models. As soon as a model drops on the market, getting it running on all the different kinds of hardware on day one."
  },
  {
    "startMs": 1275784,
    "text": "You can even go a little bit crazier with compilers. Imagine a world where y- an inference stack can be custom-built for your workload and the model that you're running. This is already being demonstrated by folks at Anthropic, right? That built a compiler in two weeks. So I think there's a lot of optimizations that you can do when you're building just-in-time custom software to support the model you wanna run on the workload you wanna run on your custom hardware."
  },
  {
    "startMs": 1299224,
    "text": "And referring back to the previous slide, using agents to continue to help us to build, you know, more custom silicon and helping speed up the tape-out process."
  },
  {
    "startMs": 1309284,
    "text": "And finally, this is the non-very technical part, but all of the things that surround what it takes to serve inference, all the procurement, all the legal, all of the things that are in the back office, all of these things combined with agentic workflows are able to be optimized. So when we do all of this, I'm really optimistic about the future and all the things we can accomplish to serve tokens faster and cheaper. So next slide, please. Thank you so much for coming to our talk. Uh, we are working both very, very hard to give you faster and cheaper tokens."
  },
  {
    "startMs": 1339484,
    "text": "And yeah, let us know if you have any questions. We'll be around after the talk."
  },
  {
    "startMs": 1342464,
    "text": "Yeah, and go eat tokens."
  },
  {
    "startMs": 1343944,
    "text": "Yay."
  },
  {
    "startMs": 1344064,
    "text": "We're making more tokens for you so you can also generate gifs like this."
  },
  {
    "startMs": 1347904,
    "text": "Yeah."
  }
]
