Baseten has separated the prefill step and the decode step onto different sets of GPUs for some models.
“We've, at least on certain models, disaggregated pre-fill and decode.”

Latent Space: The AI Engineer Podcast
3 Aug 2026 · 1h 41m · Ali Taha, Philip Kiely · 20 quoted facts
Inference engineering, meaning the work of making AI models run fast, cheaply and faithfully, is a stack of many techniques rather than one trick. Philip Kiely and Ali Taha of Baseten argue that quantization, speculative decoding, smarter routing and splitting up the work across GPUs each add roughly 2x. Together they turn a 30 to 50 tokens-per-second baseline into something several times faster, but only with careful work on every new model.
The main tension is between easy and hard. Getting a new open model to produce a token is simple, while a production-ready service takes weeks of quantization, training small helper models, and chasing odd bugs such as repeated tokens. The talk then widens to hardware (whether GPUs are becoming ASICs), video models that hit attention-cost limits, and training and inference merging, with Ali bearish on megakernels.
Philip lists lower-precision weights, speculative decoding and splitting prefill from decode as roughly 2x each. Stacked, they give about 8x over an unoptimized 30 to 40 tokens-per-second baseline, though real-world gains are often 4 to 6x.
Baseten must requantize each new model, train a matching speculator, and patch bugs that only appear under real traffic. One example is a GLM model repeating the token S, which Ali traced to a software race condition that appeared only on certain clusters.
Baseten research found that picking layers whose rounding errors cancel out gave about 20% more throughput than another provider's quantized model. Ali said it also matched the original model's output probabilities more closely, measured by KL divergence.
Ali said five seconds of video means attention over roughly 35,000 tokens, and cost grows with the square of length. Open-source autoregressive video models are still poor, and stitching clips together causes drift such as progressive darkening.
Reinforcement-learning rollouts need fast inference, and speculators and quantization need training. Ali said GLM 5.2 even wrote some of the GPU kernels used to serve itself, and Philip expects loops that retrain models from production traces.
Philip Kiely says it is first routed to a replica that may already hold part of your prompt cached, which skips work. If not, one set of GPUs reads the input and hands off to another set that generates the reply.
A small helper model quickly guesses a few upcoming tokens, and the big model checks them all in one pass, keeping the correct ones. Ali explained that training the helper on a customer's own traffic, such as coding, makes more guesses right.
Quantization stores numbers with fewer bits, which is lossy, and Baseten treats it as the main place quality can slip. Ali said choosing layers whose errors cancel out can keep the output very close to the original while running faster.
Philip says teams often start per token to try open models, then move to dedicated deployments once a use case sticks. Reasons include reliability, custom tuning such as speculators trained on their traffic, and not sharing capacity with other users' heavy traffic.
Ali said the cost of attention grows with the square of the number of tokens, so long clips become unaffordable. Making video one chunk at a time is cheaper but currently produces poor quality and drift, so he thinks autoregressive models need to improve.
Stated by the speakers. Each quote matches the transcript, which shows what was said, not that it is true.
Baseten has separated the prefill step and the decode step onto different sets of GPUs for some models.
“We've, at least on certain models, disaggregated pre-fill and decode.”
Ali Taha described a speculative decoding draft model that makes three quick forward passes to predict three tokens, which the full model then verifies.
“it does three very fast, ultra-aggressive forward passes and it will predict like, you know, three certain tokens.”
Philip Kiely said Baseten's model APIs operate with zero data retention, so Baseten does not see the exact traffic customers send.
“Generally we have, obviously we have ZDR, zero data retention on our model APIs.”
Philip Kiely said open models are generally not released in NVFP4 format, so Baseten quantizes them itself to suit Nvidia's Blackwell GPUs.
“these models are not released in NVFP4 and we want them to be in NVFP4 for maximum blackwell compatibility”
Philip Kiely said GLM 5.2 included the DSA attention mechanism, which originated in DeepSeek's models, and Baseten had to add support for it in its runtime.
“oh, sorry, GLM 5.2 had the DSA. Which was brought from DeepSeek.”
A Baseten engineer grafted the Kimi vision encoder onto GLM 5.2, which lacks vision, and trained only a small projector to connect them.
“he kind of grafted the Kimi vision encoder onto GLM 5.2.”
Philip Kiely said the GLM 5.2 model with the grafted Kimi vision encoder scored about 56% on the MMLU Pro benchmark, which he called not quite frontier.
“it got to 56 % on MMLU Pro, I think, so not quite frontier.”
Ali Taha said Baseten's endpoint stops generation and retries when a model outputs the same token four or more times in a row, treating it as a collapse.
“if a model was to output the same exact token like four plus times we just caught the generation”
Ali Taha said a token-repetition bug appeared only on some clusters because slower KV cache transfers between nodes exposed a race condition.
“the KV cache transfer from a node to node in that one cluster is using a slower interconnect than the node to node in another cluster.”
Philip Kiely said most inference optimizations such as KV caching do not change outputs, and quantization is the main lossy one.
“Most inference optimizations are lossless. KV caching, for example, you are just preventing recomputing the same values.”
Ali Taha referred to Baseten research claiming a GLM 5.2 quantization that is 20% better than Nvidia's.
“how we have 20 % better quantized JLM52 than NVIDIA”
Baseten measured quantization quality by comparing the output probability distribution of the quantized model with that of the full-precision model using KL divergence.
“we scored the KL Diversions between the logit distribution of the quantized model and the logit distribution of the original full precision model.”
Philip Kiely estimated that speculative decoding and prefill/decode disaggregation each give roughly a 2x speedup, on top of about 2x from moving to NVFP4.
“speculator roughly a 2x, disag on top of that if you're able to get enough hardware and put enough traffic through it, another roughly a 2x.”
Dynamo is an open-source Nvidia library for moving data such as KV cache around a GPU cluster, which Philip Kiely described as a toolkit rather than an optimizer.
“by the way, Dynamo is an open source library from NVIDIA.”
Philip Kiely explained that expert parallelism places whole experts of a mixture-of-experts model on individual GPUs, usually several per GPU.
“The idea is you put the entire expert on a GPU. Generally, you have more experts than GPUs.”
Philip Kiely said eight Nvidia GB300 GPUs at 288 gigabytes each can hold a very large model in NVFP4 format, though room must be left for the KV cache.
“the GB300s have 288 gigabytes each so across 8 of those you have enough room for the model”
Philip Kiely said DeepSeek R1 had 671 billion parameters and helped push Baseten to adopt Blackwell GPUs quickly.
“when DeepSeek R1 came out, it was, you know, it was 671 billion parameters, which at the time was really huge”
Ali Taha said five seconds of generated video corresponds to roughly 35,000 tokens of attention, which makes full attention costly and quadratic in length.
“Which means that for attention, for just five seconds, you're running attention on 35 ,000 tokens, right?”
Philip Kiely said diffusion models attend in both directions across a sequence, whereas autoregressive models only look backward, which is why naive autoregressive video drifts.
“diffusion attention goes in both directions, while autoregression, it only goes forward in the sequence.”
Ali Taha said some GPU kernels used to serve GLM 5.2 on Baseten's inference engine were written by GLM 5.2 itself, guided by profiling traces.
“And some of the GPU kernels that we run GLM-5 .2 within our inference engine is written by GLM-5 .2.”
Philip walks through routing, caching, and the split between prefill and decode GPUs, showing how much hidden work sits behind one API call.
“ideally some cached input already there so that we can skip pre-fill”
Ali explains how a small draft model speeds up generation and why customers move to dedicated endpoints for custom speculators and control.
“Now, this draft model is traffic specific.”
Making a token is easy, but production readiness requires requantizing, training speculators and fixing bugs, including a Kimi vision encoder grafted onto GLM.
“getting to the point of I can make a token out of this model is not that hard”
The team explains how fidelity is measured and why quantizing carefully chosen layers can match the original model better.
“is going to perform better because the quantization errors have canceled out”
Philip gives realistic speedups from quantization, speculation and disaggregation, and compares them to a 30 to 50 tokens-per-second baseline.
“that's an 8x gain that's kind of the the order of magnitude”
The guests debate whether GPUs are turning into ASICs and whether Nvidia's Rubin makes inference mostly an infrastructure problem.
“I think it's trending towards becoming exclusively an infrastructure problem.”
Ali explains why video diffusion is bottlenecked by attention over huge token counts and why autoregressive video is promising but weak.
“The challenge with video models especially is the number of tokens.”
The conversation turns to rollouts, quantization-aware training and models helping optimize their own serving, ending with continual learning ideas.
“get better signal, get better model, get better product”
Okay, we're here in the studio with Philip, an old friend from Inference Engineering, the book, as well as Baseten and everything that you've done, you and I have done before, as well as Ali. Welcome. Pleasure to meet you. Waterloo intern. Waterloo intern, always.
When did you get Waterloo intern as a... As a handle? I think the rebranding happened like mid-March. When I saw it was open, I was like, I have to take it for grabs.
The problem is that Ali is really good at his job and is not going to be an intern much Longo so we have to figure out you know who's going to get the handle. Pass the torch over.
Oh okay it can be like you just pass it to another Waterloo correct? Another Waterloo Inter. Inter.
You've got to get an
Inter from Waterloo.
But it could come from
Baseten so it's like wherever Baseten gets from Waterloo has the title of Waterloo. They have to pass you. You're not halfway through the dungeon you either get it or you're out. You should also do like a big graduation ceremony where you change the handle.
I mean, you guys are good at ceremonies. Clearly, you know, we had a nice launch of the book, very successful. But before we get into all that, I want to start off with a fun question for you. Okay, you're an expert inference engineer. What happens when I send a long query, say 200 ,000 tokens into Baseten's inference? What's the process of query through GPU, model, routing, balancing, all that? What is all the stuff that we don't think about?
with a long query specifically, the first thing that I'm going to ask is, have you sent me this query before, or at least part of it? And I really hope you have, because it's going to be a lot easier for me and a lot cheaper for you. So the first thing that we're going to look at is some kind of cache away routing where we're going to see, we probably have a number of instances, a number of replicas up serving whatever model you're hitting.
We want to send this one to something with number one available prefill workers and, number two, ideally some cached input already there so that we can skip pre-fill on at least part of these 200 ,000 tokens. If you're doing 200 ,000 tokens, it's probably coding or a multi-tone agent or something where you would expect to have that cached. If you don't, we're going to have to send it to a pre-fill worker. We've, at least on certain models, disaggregated pre-fill and decode.
So you're going to have one set of GPUs that's solely going to process the input, create that KV cache, and get you your first token. And then that's going to be passed over to a separate set of GPUs, which is going to run decode. We're going to iteratively make those tokens. We're probably going to have some kind of speculator model in front of that. I'm going to assume that you're doing coding. And because of that, our speculator model, which assumes you're doing coding, is going to have a high draft token acceptance rate.
If I'm wrong and you're asking me to summarize every Harry Potter book, it's going to be slower. And then we stream that output to you and account for it, charge you, you know, some number of couple of pennies and say, hey, would you like to send another one?
Except Baseten doesn't charge by pennies.
Well, yeah, we charge, I'm assuming that we're talking about the public model APIs. If you are, you know, setting up a dedicated deployment, then yeah, it's not pennies.
Yeah, I mean, one of the key differentiators when I was talking with Baseten initially was that actually people who want very, very high volume just need to rent by the box because then it's up to you to figure out how to saturate the box.
And more often than not, it's like way cheaper if you're pushing like millions of tokens per hour, if you just pay per hour instead of paper token.
Yeah, they do. I think that we've increasingly seen a lot of demand for the sort of paper token APIs just because everyone wants to try open models. And then once they find a use case that's really sticky, then they move over to dedicated.
Is there a best practice on when it's time to swap over?
A couple of reasons.
Yeah, reliability, that's a big one, right? Like if they have a very specific use case, they want you to train something specifically for them. Like they want their own spec deck, for instance, for their own traffic. Spec deck is speculative decoding. Speculative decoding, yeah, yeah. Sorry, like basically if you have a huge model, right? And so the model is going to be generating one token at a time every single turn, every single forward pass. So we attach like this little like kind of parasite, like this layer that goes on top of the model.
And this model just has to predict, it does three very fast, ultra-aggressive forward passes and it will predict like, you know, three certain tokens. And then you do one forward stage over the entire original model in order to see if those predictions were correct or not. And then you accept them or you reject them. Now, this draft model is traffic specific. So if you, like, you know, Philip said, if you're summarizing Harry Potter books, I can train exclusively that draft model on Harry Potter books.
And I can guarantee you that I'm going to accept the three tokens every single time. And so with that case, I increase your decode speed. I wouldn't be able to provide this to you if you want to share an endpoint because I have no idea if you're doing Harry Potter, if you're doing coding, if you're doing English. Like, we don't know. Also, there's a thing in the book that mentioned that they really cared about a specific threshold, chapter four, I think.
Do you remember that?
Yeah, the things that you can do is you can set a specific batch sizing, a specific parallelism strategy if you're trying to optimize for throughput versus latency. You can, you know, maybe a NVFP4 quant doesn't pass your benchmarks and you want to run a model at higher precision, you could do that. There's just a bunch of reasons why you might want to have your own endpoint. And the biggest one, of course, just being like, you don't have to deal with someone else throwing 100 million of tokens of benchmarking traffic at the endpoint when you happen to be trying to serve your users.
Yeah. I think one thing that is, that is a classic journey. You know, it's basically Vivo is asking what happens when you type Google into the browser. Tool calling, is that just, you know, you're generating JSON or is there more complication beyond that?
Certain customers that we have, they have their own post-trained models. And so they demand tool calling that's not just like, you know, parse a file or, you know, go find the weather. It's something that's very specific and you have to do post-training on this. and if the post-training on the model is not good or if the quantization after the post-training to get the inference to be fast, the model will struggle reading the JSON file and reading the tool calling.
But it doesn't require its own sandbox. It's not like it's going to use that tool calling to escape a sandbox. It doesn't have to be contained. It can just be a normal dedicated deployment. The challenge with tool calling more and more seems to be that the companies want certain tool calling, which is a very sensitive thing to train. And because you're dealing with all of the JSON and outputs if it doesn't close the end of the request in a very certain manner.
You end up with a model that did the tool calling and the thinking. And so as a result of that, it didn't see the result and just hallucinated the result as it decoded. That seems to be the most challenging thing with tool calling, not really the sandbox as well.
Yeah, that's a challenge on the training side. And then on the influence side, there's work that you can do to scope the possible output. So we published this actually at this point close to two years ago. the solution to this problem, which is you basically make a state machine and you use that to constrain the output to a specific format. So this is the structured output problem. If you remember back in the day... Yeah, the specific grammar is...
Yeah, exactly. ...GML had this thing. Yeah. So it's like the old school, like make sure this is only JSON return, only JSON or my grandma's going to die type of prompt.
Is it BNF grammar? At some point in OpenAI, I had released a thing that was like, yeah, if you want to constrain your output, write BNF grammar back as no.
In our inference system, it's just a specified output format, and you get the guarantee that your output's going to be structured along that format. And so applying that to tool calls can help cut down on, obviously you can still call the long tool or call no tool. It doesn't solve the certainty problem, but it at least solves the output structuring problem within tool calls. And MCP is just another form of tool, right? Yeah, exactly.
There's no special thing there.
The thing I'm always like explaining to people is the LLM is actually not capable of doing anything. It's only capable of making suggestions of what to do. And then if those suggestions are formatted in a certain way and applied to a system that knows what to do with them, then an action occurs. Yeah.
Part of the fun stuff is, you know, this is solved outside of tool calling too, like in an agent loop. If the output is not correct or you're right, like reasoning, tool calling was done in the reasoning. So you'll just be like, oh, I don't know what to do. Let me just try again. And, you know, it might get there after a few tries. And on your point of training, sometimes this is harder in smaller models.
So you don't have the same exact quality output when you just swap from a big model.
Yeah, I will say that before we, I think we need to go back to inference engineering proper. But I had expected that something would replace JSON because it's hard to stream JSON because JSON must be complete and you must have open and close brackets and everything. So it's hard to parse something or validate something while it's being streamed. So people invented all sorts of things that are like, I forget the name of some of these alternatives, but it's basically something like Toml, something like YAML, but JSON seems to be dominant still.
The JSON output's not that long, right? I guess you could have a long, because tool calls also contain the arguments in them, and perhaps for a certain tool, you might pass a very long argument. But my impression of the sort of median tool call is that it's a relatively small number of tokens, right? So I would expect that speculators are generally fairly good at something as formatted as JSON. And so you would have a pretty fast decode step there, and that the streaming wouldn't be as valuable, but maybe I'm wrong about that.
You're also bounded by the software that the model is going to integrate with if the software is built with JSON for the tool calls or if the company that you're, you know, if your customer says that this is how our software works and our tools are interfaced with JSON, you can ask them to, like, you know, change their software and say, like, yeah, this is going to be better for the model. But, like, with the web training, shouldn't be that much of a difference.
Also more profitable if it outputs more tokens, probably. Depends on your business model.
You know, it really depends. But I will say that, you know, as a writer with like experience a lot with AI generated output, I do try to move from text to JSON text, which is very long JSON, right? Like there's paragraphs in every field because I'm trying to structure it, right? I want you to first make factual statements, then make opinions, then make bullet point summaries, have dates, have entity references, have your sources for references, all these things.
Anyway, so these are things that like, I think people who really, really experiment with structural output have to really care about. But let's sort of recurse up the stack a little bit. Before we started recording, you actually mentioned something which is really cool, which is that there's a lot of inference engineering that goes on when a new model provider releases a new model, right? So let's call it GLM 5.2, Kimi K3. I had previously assumed, especially if it's like, well, GLM 5 to 5.1 to 5.2, like, you know that you've supported them before.
Is it that much work? It's a lot of work. Yeah. Okay. So like, you know, a lot of people, all you guys, right? Whenever a new model launch, like people rush to say like, oh, Hugging Face supports this. Fireworks supports this. Baseten supports this. And I'm like, yeah, of course it's supported. But what goes into that?
I think it's more than just supported too, right? It benefits the consumer a lot. Like I think it was with Kimi K2.5 or GLM 5.2, the latest. There was sort of an inference war, right? X providers at 90 tokens a second. The next day we're at 150.
I kind of kicked that off with GLM 5.2. I wrote a Twitter article about, it got like half a million views. Based on being number one. Yeah. Or special analysis. Yeah, which got everyone really excited about, hey, how can we, you know, bench max a little bit further. And there's a difference between support the model, as in like, I can make a token out of this model, and support a model as in, I have a production-ready API from this model.
getting to the point of I can make a token out of this model is not that hard because generally the open source inference engines your vlms sglangs of the world oftentimes even receive weights ahead of time maintainers do or the people making the model merge prs to ensure support so you generally can you know just kind of get it working on the standard open source stack without too much pain in most cases. The challenge is, you know, every inference company is going to have our own proprietary stack.
You know, some open source components, some in-house stuff. And for any arbitrary model, there's going to be some new stuff. Sometimes you get lucky, like K25 to 26 was like pretty similar.
Yeah, it was pure continued post-training,
if I remember correctly. Even in those cases, there's still stuff you have to do. You have to redo the quantization work. You're taking the model from, generally these models are not released in NVFP4 and we want them to be in NVFP4 for maximum blackwell compatibility. So we have to perform that quantization and calibrate the quantization to make sure that we're not causing any kind of regression in the model's intelligence. And then we also have to train the speculator as we've talked about.
Generally we have, obviously we have ZDR, zero data retention on our model APIs. So we don't know exactly the traffic that people are sending us, but we know what's popular. We know that coding use cases are popular. We know that agents, agentic use cases are popular. So we can get public data sets that are representative of that kind of traffic and train general speculators. Now, with speculators today, you need to train the speculator using the base model itself because you're getting hidden states out of the model from running inference on these specific prompts.
and that is the training data you use to create the speculator. So there's that process which you need the real model weights for. And then there's, of course, just the process of, you know, standing up all the infrastructure behind it, loading all this stuff in, testing it. And then when there's a new model with a newer architecture, I think that, like, obviously the DeepSeq models tend to be the most challenging as they have, like, the most novel architectural stuff going on, model over model.
But every new model has something. I mean, Kimi K2 had, oh, sorry, GLM 5.2 had the DSA. Which was brought from DeepSeek. Yeah, yeah. So you can copy-paste it. I don't know how this works. So we had to build support for that into our runtime. And you're right, it actually is really interesting the way that all of these open-source labs borrow from each other. For example, GLM 5.2 doesn't have vision. So something that Haley, a guy on our team, if we could take a look at this, he kind of grafted the Kimi vision encoder onto GLM 5.2.
We'll be training the projector. Exactly. So if you think about the encoder, there's the encoder, which is the part that looks at the image and turns it into latent information. And then there's the projector. You can't see it in space. It's okay. And then there's the projector that maps it onto the model itself. And then there's the model weights. you don't want to mess with the model weights because you want a chance of making the model dumber at something else for the purpose of giving it vision.
So instead, Harry started with just a projector, which is only a handful of millions of parameters. Can you show the training room?
Like the way it groks is very, very interesting.
Maybe Ali, you should take it from here. You've got a better understanding of this than I do.
Yeah, you can see the way he trained this is really, really cool. At the beginning, he was training it using just like, here's a picture of a mountain. Can you describe what's in this mountain? And that caused it just like the first, the first, you know, learning loss. Like here, you can see this, all we're trying to teach it is to translate the encoded, like it's already taken the encoder from Kimi K. It's taken the image.
Yeah, frozen, frozen. Frozen, frozen.
So the understanding, the brain is frozen and the eyes are frozen. It's just, we're trying to try and interconnect between the eye and the brain, right? So the projector. And so you take the tokens and then he's like, oh, can you describe what's in this image? And he's like, oh, it's a mountain or it's a person or it's a human, whatever the case is. But that didn't cause complete understanding. So he changed it such that every image was associated with a data set of questions.
Like, does this image have a white male? Does this image have birds in the top corner? Does this image have a scientist in it? All that stuff. And it would have to answer questions correctly. And using not just training on describing an image, but being able to answer a question, answer a question, answer a question, over time, like you can see the grokking, which is like genuinely insane, that retrofitting vision into a large LLM can learn to that extent.
and even for images that it doesn't perform well on for instance if you ask it a picture of like Stephen Hawking who is this maybe it doesn't get it but it will say something like this is Albert Einstein like it still understands close enough is a scientist who is a man who has you know done significant achievements all that stuff so that's like really really cool
yeah so we've covered Houtian before who was the author of the lava paper that did this a while ago and I think that's very foundational work for anyone who hasn't done vision work before
same with clip and meta clip where you go from just captioning to building out questions off the image and how much better you can get performed.
Yeah, but what's so exciting about this is if you look at a model like this, now obviously this is a little bit more of a research project. It's not, it got to 56 % on MMLU Pro, I think, so not quite frontier. But if you're running this model, you haven't suffered any loss on your GLM-5 .2 quality. If you don't have an image, it'll just behave exactly the way it used to. and ultimately in the inference code,
you literally do not include the other part, right?
Yeah, I mean, you would just skip the encoder if you don't have an image input. Okay, just confirm it.
Does it affect a lot on the overall inference side? Like you're not adding much, you're adding a very small vision encoder. These are typically like less than a billion parameters.
Yeah, it's, I mean, there's a little bit less standardization among vision encoders. So the sort of support matrix can be a little bit sparser, But overall, yeah, it's a pretty minor component of the overall system. And ultimately, what you get out of the system is all of a sudden you have Kimi Vision, GLM weights, and DeepSeek attention all in one model. And that's, I think, a lot of the power and beauty of open source is that you can take all of these different components and combine them together into a system that's better than anyone can be individually.
people used to say that you would also do franken merges where you would take like layers from each model does anyone do that anymore?
to your point previously when you were mentioning like the work that goes into supporting a model when it first comes out like GLM 5.2 or Minimax M3 or whatever the case is sometimes you do have to switch out some things like for instance the Minimax M3 head uses full attention and with full attention you end up with this like insane bottleneck inspector because you're doing auto-aggressive token generation for three tokens and you're doing this like O of N squared over all of the tokens that are in your sequence.
Your KV cache is like very large because it's not sparse, it's not top K. So we find it better to like, okay, we're going to replace this layer with a layer from another model that's using like GQA, for instance. And then just for the right training, you can get it to have the same acceptance rate. So it is very possible to retrofit layers from other models and very much needed actually if a layer is like inefficient the training just becomes the challenge like how do you ensure that you train it properly which again to earlier points is like the mesh between training and inference as in like you need very good training in order to do fast inference that's like
I feel like more and more becoming true
anything else on the support side when you say like get it to fully production ready
yeah I think that there's also a question of just you know we can test a model to a pretty extensive degree but we're trying to get it out quickly and then you see a bunch of other people test it and you get interesting results there was a an issue with um glm briefly where we had some like mode collapses where it would just output the same token over and over again for certain prompts on certain temperatures like once you expose an endpoint to the real world, there's going to be, you know, so many more varieties of things given to it that you're able to, you know, discover and patch things.
So it's not just a, you know, day zero process. It's then like for the first week, for the first month, if a model remains popular, like how do you both fix bugs and then continue to push the envelope on performance? What do you mean you don't want your model outputting SSSSS?
Is there loop detection on that stuff, by the way?
it still happens like quite a lot which is surprising we have like in our in our endpoint like if a model was to output the same exact token like four plus times we just caught the generation we say like oh sorry this should like try again or like we will repost the request because we know then like if it like if it's four times the same token it's probably collapsed
yeah is there a way to opt out in case i really actually want that
i think i think there's a way that we have to handle it i'm not exactly certain i feel like in certain models like when they output something like you can imagine like a table for instance and so they want they want to draw like 12 dashes and 12 dashes yeah I think there's a way for that to happen I think we only do it on certain tokens like we exclude certain special characters so we only do it on like certain like S is the most common almost GLM5 too and I think it was DSV4 as well like you'd just have like looping issues where like yeah is there
something special about S? no it just seems to be the one token Yeah. And it's only temperature zero or even at other temperatures?
Even at like 0.9 or whatever, it will still collapse. That's weird, right? It's an inference problem, to be honest. It's like a software problem. Like oftentimes the image you run, like NVIDIA will release an image, for instance, and if we will upstream the changes from the latest RTLM image into our stack, we'll find that it fixes it. Or oftentimes this will only happen in an inference engine that you're using like SGLang. But if you were to switch to VLM, that isn't the case.
so it seems to be like an extremely non-deterministic kind of software issue and not really a model issue. It's not like a weights problem. Like people say, oh, it's a problem with the quant. We did PTQ wrong, right? But that doesn't make sense because the same exact weights used with a different inference engine does not repeat the problem. And sometimes it's the kernels that are being used in the backend have like these very subtle, sometimes raised conditions where if you were to use this model hosted on one cluster, you will never get this problem.
Oh my God.
But if you host it on a different cluster, you will. And the reason is the KV cache transfer from a node to node in that one cluster is using a slower interconnect than the node to node in another cluster. So that exposes the race, whereas in another cluster it doesn't. So then you end up just like, okay, this model is not going to be hosted on this cluster. We're going to host it on another cluster because that cluster exposed that problem.
But then it ends up like, okay, is it the software? Is it the model weights or is it the hardware?
There is a thing about this with temperature zero still not being deterministic, right? Mostly because of hardware. even at temperature zero, same model, you won't always get the same output.
But I'm surprised by the race condition one because I thought PyTorch was a graph that guarantees that you at least execute things in the right order.
Well, yeah, true. I guess I'm not saying that this is a risk. Well, you have things like PGL optimizations where you can start a kernel before the end of the previous kernel. And that's like you want to do that. It's like pipelining. Exactly, exactly. But you don't do it cleanly. You overlap a little bit of the execution. No, I guess it is very possible that the kernel itself, like that one block that is supposed to be running in this instance of time, that kernel itself has a race condition.
For instance, like a missing barrier, like often if you're designing a kernel and you want it to be very fast, if you don't test it extensively, you'll have certain threads access data points from registers before they've been written to by other threads. Yeah. For example, because like your barrier is wrong or your synchronization is wrong. But yeah, like the testing itself is very, very difficult.
And there's no like borrow checker for, What does that mean? like Rust, like if you're trying to have like memory safety, it sounds like a comparable problem.
Well, yes, but you're working in code, right? And video GPU, it's like... You just need a higher level language, like modular. Maybe that's what modular is supposed to do, I don't know.
How do you see keeping quality of the model? So you talked about all these steps of, okay, you got to do quantization, train your own speculative decoder, run on different hardware. Looking at other model providers, okay, you kicked off an inference speed race, On the consumer end, what goes into keeping quality the same across them, right? Sure, you can run benchmarks, but like, how do you determine how much quantization or the standards? What actually goes into?
There's a few things on quality. Most inference optimizations are lossless. KV caching, for example, you are just preventing recomputing the same values. Speculation, of course, if a draft token is wrong, it gets rejected. The main lossy optimization is quantization. And that really comes down to, number one, data format. Number two, which parts of the model you choose to quantize, which layers. And number three, like doing a lot of calibration on the quantized weights to ensure that you're sort of preserving all the outliers.
There's other sort of tricks that you can do, though. A big one is long context. Because one thing you asked right at the beginning is, oh, what's going to happen if I send a 200 ,000 token request in? So obviously with a long input sequence, you need to store a lot more information. You need to process a lot more tokens. And so even if a model has a context of a certain length, you might as an inference writer choose to build an API with a shorter context length.
And, of course, a full-length one as well, because if someone doesn't need the full million token context, for example, you can get them better performance. I don't know if that's exactly like quality of the model. The way that I think about quality is to what degree are we faithfully serving the original model? If you think of a sort of golden implementation of a model that performs exactly the way the model is designed to perform, I think of quality as how close are we getting to that, you know, 100 % fidelity of the model.
You can also, of course, think about quality from the training side and how do you push yourself past 100%. But when I think about purely inference optimizations, it's getting faster while staying as close to that 100 % fidelity mark as possible. And certainly our standard internally is that you should not be able to tell the difference between our API and a sort of official API. I think Kimmy in particular does a good job of vendor benchmarking here.
way that they have.
They released an actual vendor. Exactly. Because they accused some people, Amazon, there was some provider that was not doing very well on Kimmy's spend time. Yeah. So,
it would reflect we'd be probably not. This was a long time ago, right? No, like three, four, five months ago. This also happened with, I don't remember which model, but they pulled out quite a few and then they started a whole chart about this. It might have been Kimmy vendor verifier. Yeah. Yeah.
Because you'd be pissed, right? Like if you're, if like, like if I'm a consumer and I'm using like Amazon's endpoint, for instance, And I'm used Kami and I'm like, oh my God, like this is bad. I'm not going to say Amazon quantized the model in a bad way. I'm going to say, oh, Kami sucks. Right. So it seems like that.
Yeah, they care. They care. Justifiably. Yeah. This is probably a stupid question, but just checking. Has anything improved from being quantization? Like is quantization always strictly worse?
Well, technically no. It's a lossy. Quantization is a lossy. It's a lossy implementation. Speed improves. Speed improves. Obviously, never really.
I always look for inverse scaling laws. This is something I learned from Noam Brown, where like things that normally act in one direction, sometimes they...
Well, technically, when you run a benchmark, because these models are non-deterministic, sometimes your, you know, NVFB4 quant is like, you know, two basis points higher than your... That's nice. Exactly. Yeah, it's within, that's why I always say within margin of error. And I actually stopped saying that because everyone assumes that what I mean is, well, within some margin of error, we're barely inside of that to the worst. what we're saying, but yeah, sometimes it's just like gives you a higher output score, but like Ali said, that's noise.
To my knowledge, you're not necessarily making the results better, you're just trying to again like keep your fidelity as close to 100 % to the original model.
There is, to your point, research that we did on MP. I don't know if you are able to pull a tweet with one of our research interns, Joshua. I think it's a tweet on how we have 20 % better quantized JLM52 than NVIDIA. Essentially, what we found throughout this two-month research is, okay, quantization is a lossy. You're compressing the data from occupying 16 bits to occupying 4 bits, for instance. And so you're obviously losing some information and you're trying to minimize that.
And so when I say that I'm going to quantize the model, my job becomes, how do I find the layers that I can quantize and how to find the layers to not, for instance, with image models, I don't quantize modulation layers and I don't quantize out projections. Because those two are like out projection is what you see as the user. Modulation is what the model sees or understands. Right, exactly. And so I guess to his paper, do you have the, I guess it doesn't have the, yeah.
It's a long paper. I don't know if I can find.
If there's a part to search or it's probably in the thread.
It's probably in the thread. But basically the long and the short is it is very possible that quantizing more of the model makes the results. It's like if I have a model that I quantize layers one, five, and 10, and another model where I only quantize layers one and two, it is possible that the model in which I quantized more information is going to perform better because the quantization errors have canceled out. And so what Joshua showed in his mathematical proof where he had like a verifier in is that you can predict which layers are going to have quantization errors that will cancel out with each other.
And you choose to quantize those layers. And so the result of doing this mathematical quantization is you end up with a model that that's 20 % more quantized than another provider. So you get 20 % more throughput of it because there's more layers that are running in NVFE4. And your quality is better than that other quant because the layers that you chose to quantize have their errors cancel out. Like one layer scoot to the right, one layer scoot to the left, one layer scoot to the right.
Your final logit distribution is more similar to the original distribution of the model. So you have better fidelity. And so the way we proved this was with KL Diversion. So instead of just scoring on the benchmarks, we scored the KL Diversions between the logit distribution of the quantized model and the logit distribution of the original full precision model. and we show that with this technique, we get, if your probability distribution on the Logite switch token it wants to select is more of the same as the original model, you're probably going to end up staying true to the original model.
So yeah, so it seems like previously before this, it seemed like the industry was, well, the more you quantize, the worse it's going to be because the more loss you introduce. That's not exactly, not necessarily true. So yeah, it doesn't improve it, but can cancel out.
I think it might be this, but it reminds me a good bit about pruning actually, where you can prune off certain layers, but very interesting. Didn't know this was a whole paper here as well.
It's a fun fact, it was originally 72 pages in this paper, and then we decided we can't tell. We couldn't lose it. So it's now 425.
Still 39 pages, so very substantive. We talked about evals and all these things, and what's possible in terms of speedup? I guess it's probably the number one thing that people do want to care about and it's something that you wrote about in your post. Official API is 70 tokens per second and you push it up to 90. Is that like a normal
thing. So what's cool about working in inference, the reason that I think inference is going to be a useful place to do engineering for a long time, is that if you look at highly optimized domains, like say finance, if you're in finance, you measure how much better you got in basis points. Like, oh, I got five basis points better, like one 20th of 1% better. That's huge news because everything is so optimized. When we publish optimizations, it's 20%, it's 100%, it's 200%.
So there's still probably like a lot further to go, honestly. Like you'll know that influence is pretty much solved when researchers start publishing about how they got 1 % faster at something.
Which by the way, because I am from the finance background, in the 70s, that was the margin at the time. When you did quantitative finance research, you would find... And like the 20%, 10%. Yes. Yeah. And now it's tiny. For those people interested, look up Andrew Lowe's paper. He had a really interesting illustration, a quant stat arb distribution, narrowing down from those kinds of 20 % differences in the 70s down to nothing today,
which is very cool. Exactly. And we're at the beginning of the same type of thing. Now, benchmarking is hard. I think anyone will tell you that. And benchmarking provider speeds is hard because there's so many variables that go into it. What hardware are you using? How much load do you have on the system? What's the exact nature of the prompts and input and output sequence links, all that kind of stuff. But overall, when you start stacking these improvements, you're looking at multiples.
You can look at it. The most common form, of course, is TPS, tokens per second, which is bad naming by us in the industry because there's actually two tokens per second. There's tokens per second, the throughput number, and the latency number. Like total tokens per second out of the GPU as a throughput number. Most people only care about tokens per second as the latency number, which we should call ITL, inter-token latency, but we don't. Anyway, so you can imagine a sort of standard API without many optimizations for 1 trillion parameter model operating somewhere in the 30 to 50 tokens per second range for a reasonable traffic profile.
And we generally see the goal of, you know, pushing to 10x that. but you know not necessarily day zero but by stacking enough optimizations if you have say like four optimizations each of which doubles performance or sorry three optimizations each of which doubles performance then you you stack that up that's an 8x gain that's kind of the the order of magnitude that we're working with in this in this space we're trying to make things substantially faster not just go from like 70 to 90.
Are you saying you have done that? So let's say you have, as a reasonable baseline, 30 or 40 tokens per second. You can achieve 10x that. So on GLM 5.2, if you're running it unquantized, perhaps on hoppers even, and you're just using an off-the-shelf inference engine with no particular optimizations, no speculator, nothing extra around KV routing, no disaggregation, you're probably, yeah, looking at that like 30 to 40. Do you think that's like a reasonable baseline?
Right, right. To get to something like 10x, there's a lot of trade-offs that you're making. If we're running at sort of more like a 300, 400 tokens per second range, obviously you are using the best hardware possible. You have a optimized speculator. You have done all of your quantization work. you are seeing a pretty high cache hit rate. You are running with a reasonably small batch size and a parallelism configuration that is tuned for latency versus throughput, but it is possible.
So the spreads that you see if you go on artificial analysis or you go on open router and you look at the worst provider to the best provider oftentimes can hit that kind of range. 10X is, of course, very aggressive. It's oftentimes maybe more of a four to six times improvement. But that's the kind of performance that makes us really excited is when we can get these huge gains, not just go from 70 to 90 tokens.
It's also like hardware dependent. Like if you obviously have a thing where you're serving it on just like a node of H100s and then you throw like, you know, you short the model across like four nodes of B200s. Like you can definitely increase the speed with just throwing more hardware at it. Like normalizing for the same exact hardware and the same number of GPUs.
Yeah, then you're looking at like a 2 to 4x improvement depending on the influence optimizations. So yeah, some of it's, you know, what's the car and some of it's who's the driver.
If you break down the 2 to 4x, say the example is run GLM 5.2 on B200's single node, right? What's like the cost trade-off for effort to get like the last bit of juice out versus what should people just think of, right? Spectre quantization. Spectre quantization.
That's like 95%.
And how far does that get you? And how easy is that for the average person to do? So say right now, I want to throw the weights of GLM-5 .2 on a node of B200s. How easy is it to find speculative decoder model or already quantized model? How much work goes into it?
If you're doing it up front, it's quite a lot of work. If you're doing it today, there's going to be people who have published things that you can just grab some NVFP4 weights. You can grab a speculator. Yeah, if we're thinking about like what are the 2Xs we're stacking, going from BF16 to NVFP4, it's not quite a 2X, right? It's like, I think it's about like 30 to 40 % from 16 to 8, and then another 30 to 40 % multiplied from 8 to 4.
So that doesn't quite get you a 2X, but like roughly a 2x, speculator roughly a 2x, disag on top of that if you're able to get enough hardware and put enough traffic through it, another roughly a 2x. And then you add in some double-digit percent increase from having just a better runtime with the latest kernels and stuff behind it. And that's kind of how it stacks up. So building each of those, like building the quantized weights is for someone who really knows what they're doing, hours to days of work, building the speculator, again, like hours to days of work, and the dis-ag setup, hours to days.
Well, okay, once you have it... Once you have it, once you have it. Yeah, yeah, getting dis-ag working for the first time, I'm saying, of course, is very difficult, but the marginal implementation is...
If you're just grabbing, like if you are a person, like just a normal consumer who has access to like a node of B200 and you're wondering, how can I just host it myself? you don't need to quantize the model yourself. There's always going to be an open source quantized checkpoint and video is going to push one out if no one else does. Usually the providers will have their own spec tech that they've trained as well. You don't need to train your own spec tech.
You can just use that as well. Like, can we, GLM 5.2 has its own MTP?
Right. Multi-token prediction.
I can do it for you in case I get it wrong, you know.
Actually, you should correct if we're wrong, but their multi-token prediction can be used for self-speculative decoding. I'm actually not sure. I'm semi-confident, but someone can check. But, you know, it's useful to paint the story of, okay, not just the average person, but say a company wants to switch from serverless inference to, I want to throw this up on, you know, I want to rent some GPUs, throw it up. These are the steps you take to do significantly faster than just put it behind VLM.
I was waiting for a mention on Dynamo. I feel like that's supposed to be the baseline that you measure against.
I would think of Dynamo as less of a sort of out-of-box system and more of a toolkit for building with. So when we talk about doing KV-aware routing, when we talk about doing KV-out offloading, when we talk about doing PD disk aggregation, Dynamo fundamentally is, by the way, Dynamo is an open source library from NVIDIA. We've done that part with Kyle. Okay, cool. So then your listeners know then that it supports all the different inference frameworks and it actually is kind of multi-hardware, which is interesting.
But it's just a router. It's not like an optimizer there. Yeah, all it does, like what Dynamo is good at, it is a library for moving information around your cluster, around your hardware. So if you have, you know, KV cache on one place and you need it to be somewhere else, Dynamo coordinates Nixle for you to move that around. That doesn't mean that out of the box, you just say, you know, pip install Dynamo, and then you get a massive performance speed up.
It's more of a developer toolkit. Yeah. I would have said it comes with a set of defaults that you can then swap out. It does. If the industry at large, I think, was rolling out all of these deployments standard, then I think it would be a credible baseline. but we've got to benchmark against what we're seeing in the wild.
I did want to talk a little bit more about PD disag because that's probably number three after quantized and speculative decoding. In your book though, I was just going to pull out the book, like section 522 on Medusa, 523 on Eagle, 524 on NMAM.
It's 5-5 would be disaggregation.
Well, no, I just wanted to dwell a little bit on the other. So what do you choose to include? what do you choose to not to include? Because there was all these other techniques, I guess. Yeah. Are these still relevant? Because I think they came out like a year and a half ago, maybe. Medusa is quite old. Yeah, Medusa's old.
But is it in the book as a good, here's the baseline, like you should know this. Like I read the paper, I'm like, oh, it makes so much sense. Yeah.
So with the book, I had a couple goals. One was to give people just a working vocabulary for the space as a whole. and the other was to give them some intuition about how each of these techniques works. As I mentioned in my AI engineer talk, which is kind of the first public addendum to this, the speculation space has moved much faster than everything else. So even at the time that I wrote the book, Medusa, I very much included as a way for people to understand how the space evolved rather than what the most modern technique is.
And now, of course, there's deflash, despark. There's newer techniques even than Eagle, although Eagle is still very commonly used. Spec, spec, spec. Yes, speculative decoding. What? Can you?
It's a paper by Tridale, and it's basically doing speculative decoding. Oh, my God. It's literally just another. It's like, yeah, it's almost impossible to explain it. And it seems like he got non-trivial speedups there, but it seems that the complexity with training, it's almost like in our mind at least it's almost as complex as training Gansler it's like a very delicate balance and often times it's just it's literally speculative decoding on speculative decoding speculative decoding we saw this paper
it's interesting right I wouldn't even expect it to be very particular to train the naive part of me is like okay train speculative decoding
it makes sense the whole idea of speculative decoding it's almost like the iPhone auto-project version but for a normal model you're just generating three tokens and you're like, okay, I'll do pre-fill on them. And so you save those three turns for your original model. Now your speculative decoder is doing three turns of autoregression. So why not just have an even smaller model?
I guess the other question there is, what are the size of speculators? So say for GLM...
Right, it's like a billion parameters. Like for Minimax, it's...
Yeah, yeah, it's like one layer. It's like 1 60th of the original model, usually.
Actually, I think we should do a paper when we get back to the office. speculative, speculative, speculative coding.
No, it does seem like when do you stop? But then it also seems like kind of, like if you're able to train spec, spec, decode, for instance, right? Like if you're able to have a small model that accurately predicts what the intermediate speculator is going to predict, that is able to predict what the original target model is going to predict, then why not just use that smallest model directly, right?
Yeah, this is adjacent to the routing problem. Right, right. The thing with speculators is is one of the practical constraints on using them is that you do have to run a small model on the same hardware that you're running the big model on. There is a orchestration and resource competition problem inherent in that. And that is one of the sort of constraints on speculation in general is that draft tokens cost resources to create and cost software complexity to manage.
And so if you have sort of like infinitely reclusive speculators, you're adding quite a bit of that complexity on the actual implementation within the inference engine as well, not just in the training process.
I was going to say, I would wonder if you could do similar like distillation and pruning of, you know, it's the same thing. It's just a model. Can we not just distill a lot of the weights, quantize the speculator, but out of my domain. I guess the question that also comes up is, this is all for big server workloads, right? How much of this applies to, say I have this MacBook, I want to run Gemma really efficiently.
Similar problems, not the same?
Pretty different. I talked to Cero about this on his podcast a couple weeks ago. The difference between inference engineering for the data center and for production workloads versus inference engineering for local AI. is that we start with fundamentally different constraints and different goals. With local AI, it's how do I fit this model onto my hardware and then make it less dumb? And with data center inference, it's how do I load this model and then make it less slow?
And obviously, we care about less dumb and they care about less slow. But the local AI inference engineering ecosystem, I think, actually has a lot for us to learn from in the data center space. They are experts in various forms of quantization, including dynamic quantization that we just kind of don't touch, in the pruning, in the distillation, in the layer removal. The removal matters less. Yeah. No one does pruning, really. Yeah, but they do it for...
Which is surprising, right? Just to fit something on the laptop. Right, right, right. So, yeah, I mean, it's an interesting space. not necessarily that their techniques make sense for us to do in the data center because obviously we have different resources and different goals, but more that the process as well as the openness of that field is something to admire.
To your point, certain optimizations that would, for instance, TurboQuantum, it made such a huge hype on Next. We did a whole deep dive on Twitter and we said, what is it? How does it work? Why is it good or not? and it took off and it was implemented on local devices because your memory bandwidth is so slow on like a MacBook for instance. But try putting the same thing on like an NVIDIA GPU on a B200 TurboQuant would not be like it would not be used.
NVIDIA made it clear that this is not a good optimization and we've seen it firsthand where the overhead of doing dequantization quantization of in the kernel itself of TurboQuant kernel eats into and is actually much much slower than the time that you save from doing the bandwidth because on the B200, you have like 3.5 terabytes per second. You don't need to decrease the storage that much. You don't need to do FB4, KB cache. You don't need to use a regular quant.
There's better optimizations to be made. But on edge devices, it's extremely important. It's extremely useful. So, you know, it seems to be like different optimizations there, but then they're all uniquely combined with like, oh, you want to quantize the model. You want to do speculatively coding, like certain common prefixes. Principles. Yeah, exactly.
They also do a lot of work on model parallelism, especially over heterogeneous topology, where you have some sparks and they're wired together with DGX sparks. Yeah, this is the ExoLabs. Yeah, you have a number of Mac minis stacked up. One thing that I think we both have to deal with, although they have to deal with a lot more, is the interconnect between machines. Which is why one thing that we do a lot is work with tensor parallelism.
And that's where you are using all eight GPUs and sharding the model across it. TensorFlow parallelism is not a good fit for local AI because it assumes a very high bandwidth interconnects like EnvyLink was, you know, they might be forced to do something like pipeline parallelism, which we're never going to do unless we're doing some kind of multi-node inference. Since you mentioned it,
I actually wasn't sure if we were going to cover it, but let's briefly explain TensorFlow parallelism and expert parallelism since you have very nice images. I just want to show off your images.
Yeah. Shout out to Luke from Base10's design team for making these beautiful images. Oh, that's actually, before we get into this, just one other difference is we talk a lot about the active parameters of a mixture of experts model. And for local inference folks, that matters a lot because if you have a batch size of one, you're only activating that many parameters. When we do... Yes, I was going to be there in a diffusion conversation. Yeah, when we go through like a MOE model and we host it for an API, we assume that all parameters are going to be active because throughout your batch, you're going to hit everything.
Cool. So broadly, tensor parallelism you can do with any model. Expert parallelism you can only do with MOE models. Effectively, all models today are MOE models that are at least all models large enough that you would care to parallelize them across multiple GPUs. So that nuance is less important now. With expert parallelism, The idea is you put the entire expert on a GPU. Generally, you have more experts than GPUs. So you might put like N experts per GPU, like eight experts per GPU or whatever.
And then you replicate the router, which the router is very small, across each of the GPUs. And then by moving the generation from expert to expert with each expert being inside a GPU, they're not competing for resources. You massively increase the throughput that you're capable of doing. And the GPU-to-GPU connection is not as important because there's not as much communication. Tensor parallelism requires that you are able to do this like all gather, all reduce.
So you basically shard the model across the GPUs entirely. And then for each step, you're combining the results of each of the GPUs, which is why the interconnect matters a lot. And it is generally, of course, this is a very high-level generalization. There's a lot of places where this is not correct. But generally, TP is helpful for latency. And in many cases, you will use some combination of these two parallelisms across the model rather than just picking one or the other.
Do you want to add some color there?
In a model, they're not mutually exclusive. You do tensor parallelism, and you'll do expert parallelism. Pipeline parallelism, less solely. It seems to me that we never use VPN.
Yeah, the only reason you would have to do pipeline parallelism, which is where you separate different layers and you put half the layers on one hardware and half on another, is if you are forced to do multi-node inference because a model is bigger than you have. Like, let's say you're doing a deployment on H100s for whatever reason, and you're putting 1 trillion parameter model on there. You have to use multiple nodes of H100. And so because the interconnect is so slow between the nodes, the only viable way to parallelize there is pipeline.
But then you would do export and tensor within each node. And the limiting factor for H100s is HBM? Yeah, they just don't have enough.
What's the magic numbers that we need to? Like on a B200, it's 180 gigabytes per GPU. And then a node of 8, you're talking like 180 times 8. And the FP4, so each parameter takes half a byte. So that's 800 gigabytes. On a H100, it's like 140? It's 80. It's 80. Yeah. Oof. I'm old. I've been doing this a long time.
I actually remember H100 specs. Yeah. So one thing. Do you want to tell me about the T4s? Let me tell you what it was like to want to model on a T4 back in the day.
well one thing I was surprised to see that more people didn't do Jamba I don't know if you guys remember Jamba from AI21 they would actually specifically pick a hardware and then they design the arc dimensions for the hardware and then it would obviously saturate the hardware like it makes sense and like somehow all these models don't do that
don't they do this for the training side though I don't know
for training the model deciding which DP with GPU. Yeah, they do. And with training, it's more like a math. Like you can run the math and see the flops and maximize it. With inference, it's more of like an auto-tuning. I don't know if you're familiar with GPU current auto-tuning. But it's basically like you define that, oh, I have two GPUs. I can do TP1, TP2, EP1, EP2, for instance, right? And so that gives you a total of two squared combinations and then you just shadow the same traffic, like real pro traffic and you just see which configuration gives you the best TPM, TPS and you just use that.
I don't like the fact that you cannot reason about which one's going to give you the best performance or that there isn't one specific configuration that's always best. But it seems like auto-tuning is just the way that you find the best one. And with kernels and GPU kernels, it's much of the same. After you design your kernel, you design your configuration, how many threads do you launch? How much shared memory do you use? You just auto-tune.
You just sweep the parameter space on this item. This is the best one empirically. But they are combined. They're not just in separation.
There's a few bits of training that are kind of like hardware targeted. If you look at, for example, NVIDIA Nemotron models, they run very, very well on Blackwell. That's unsurprising. So there's some degree of that, but I think that most open labs are trying to make models that can be run on as wide of hardware as possible rather than targeting just like a single chip.
I see for usefulness. Yeah. Okay, one more thing while this chart is still up. All Gather, All Reduce is expensive. one of the things that is a movement in silicon valley is mega kernels just keep fusing kernels
i don't know is it that simple well i mean like a fused kernel can't save you like like here with the tensor parallelism you're the half the matrix is one gpu and the other half is another and if i need the entire matrix in order to do like a non-linear operation in the next step which is for instance like if i'm doing attention i need the soft max or i need to like like exponentiation I need to have the entire row.
So I need to know what the partial result was from GPU 2 and what the partial result was from GPU 1 in order to be able to do the soft relax in the next stage. So I have to make them communicate with each other, even if I had a fused kernel, because of the non-linearities within each one. Also with megakernels, honestly, I'm very bearish. I'll be honest.
Please, please, please.
No, it's just megakernels, it was a good research direction and it seems like a very... Intuitively, theoretically, it's nice. It's like, oh, you have a lot of launch overhead from launching one kernel, moving the data. Just fuse everything together. But yeah, but like the kernel complexity itself is very difficult to write a very optimized mega kernel. It's very, very difficult to do so. And even the, like not to name any companies, but like even the companies that have worked at, people that I've spoken to who work at companies that do fused mega kernels, they very, very often don't end up running those in production because the TRTL and modular kernels that launch are faster because you can optimize each individual
component and you can just have them parallelized with each other. With the Rubens, I don't know if you guys saw the Rubens Twitter posts yesterday, but they're also... Rubens? No, no, like the GPU.
Do you have a Twitter account for Rubens only? No, no, no. I was like, what are you talking about?
One of the tech leads at NVIDIA launched a Twitter post I said, like, we're pulling the curtain on Rubin, and here's the specs. And the third tweet showed, like, not to get too technical into it, I need to read it much more, but the GPU is designed in such a way that it basically kills megakernels. You don't need to use megakernels that much anymore. So it seems like that entire research field goes into, like, won't be continued.
But yeah. Can I speculate about Rubin for a minute? Please go.
You know, I've been through now. And by the way, they are covered in the book. Yeah. Well, I mean, they're covered in the book in the sense that like, I am aware from the blog post that Lumen is going to happen in the future.
And you even had the name of the one, Feynman. Yeah, it's like, hey, this is going to be, hey, I'm trying to future-proof this thing, okay?
I don't want to publish a new one until like next year or something. Anyway, so we were discussing the degree to which I am old. And, you know, I've now been through three hardware launch cycles. I've been through the Amphio launch cycle, the Hopper launch cycle, and the Blackwell launch cycle. Now, when I say launch cycle, I don't necessarily mean like the actual shipping of the hardware. Like Amphios were racked up well before I got in this industry.
But there is a lot of time between hardware being racked up and hardware being sort of feasible for inference. So if you look at the original VLM especially, that was written targeting Ampure and then had to be updated for Hopper, updated for Blackwell. With each of these cycles, it becomes faster and more urgent, but also substantially more complicated. When I look ahead to what's going to be new with Rubin, I think that Dynamo gives me a lot of technical hints around what kinds of work is going to be very valuable.
Obviously, we're continuing some trends from Blackwell, right? NVFP4 is big. The amount of compute that they have behind NVFP4, Tensor Cores, is massive. We're going to talk about video, I think, at some point, and that's the big barrier there. You've got much, much faster memory bandwidth, which was the same thing that made Blackwell so good. But the big thing is more systems thinking. You have more emphasis on the CPU to GPU interconnect, more emphasis on the interconnect between GPUs.
And when you look at Dynamo, it's a system entirely designed around how do I move the KV cache to where it needs to be when it needs to get there. So I think that themes around like KV cache offloading, KV aware routing and disaggregation are going to be substantially more important in the Rubin era, which means that inference engineering becomes not just a like CUDA kernel problem, but also like a very traditional hardware infrastructure problem, which is something, you know, we've been building toward for a long time.
and something that's very exciting to me because we're going to see multiple domains colliding and the ability to reason from the kernel level up to the hardware level and back down is going to be very valuable.
I will take what Phil said one step further into that. I think it's trending towards becoming exclusively an infrastructure problem. We're like the problems of PD, DESAC, training, SPECTAC. But triating kernels is not going to be much of a problem because the GPU is moving more towards being an ASIC where you're just trying to orchestrate what happens on the GPU, but you're not actually controlling it thread by thread level. And you see this with Qtile, QTSL.
You're just working at levels of tiles of data, but you're no longer working at controlling what each thread does on the GPU that's being taken care of for you. So I guess, do you agree that a GPU and future GPUs are trending more and more towards becoming ASICs that just need to be launched and then they do the data operation? based on your conversations with other people.
Oh, I mean, yeah, no, that is a section of the market. Right. And obviously, ASICs can do a lot more performance for only their workload. Right. And the G in GPU makes them continue to be very general.
Yeah. I think that there's like a spectrum.
Actually, it's graphics, but I keep saying this. I have to correct myself in case you comment me for getting the G wrong.
Yeah, it's like a spectrum, right, of a very, very general purpose compute to something like a Talus where you've got the hardware built for a specific set of model weights. The weights burn into the chip. Yeah. No loading. I wouldn't say that we're going all the way there. It's more like along the spectrum, it's a step in the direction of more specialization within the hardware.
Yeah. I'm curious. I feel like he was driving towards something.
I guess my point is being bearish on, Like you say, you say, like everything else apart from burning the weights into the chip. Burning the weights into the chip is like in practice, because you want to fine tune, you want to optimize, you want to quantize, you want to release new checkpoints of the model. If it's burned into the chip, the chip's useless in like a month or two, right? I guess my point is, how can you not, like seeing NVIDIA more and more specialized, like take its GPUs from a general programming paradigm, where it's a general computer that you can use to program threats.
And with every new generation, you're putting more and more specialized instructions, specialized sensor cores, specialized, you know, UMMA instructions, things that will allow you to just control it almost as an ASIC, almost as a collection of ASICs. How can you look at this trend and then still be bullish on companies that are coming up with ASICs for AI? In the sense that...
Yeah, because they're sort of evolving towards that direction.
They're almost evolving towards, like as in Rubin, I guess, compared to Ampere or T4, Rubin is basically an ASIC. It's basically just the thing that is used. Programmable ASIC? It's like, yeah, you can program. Obviously, I guess, it's very controversial to call it an ASIC. It is a GPU. It is general. It does have threads. I can write CUDA to control it and change its operations. But it has the solid arrays and tensor cores and TMAs and tensor memory.
And it has these things that are almost exclusively useful for loading model weights. It has, you know, sensor core instructions that are almost exclusively shaped around the head dimensions of models that exist in the market today. If you say that you're going to come up with an ASIC and you're going to etch something into it, well, the next architecture is basically going to be useless. Yeah, I don't know. I don't know.
I think that the thing to remember is just how long these hardware cycles are. So if a chip is coming out today, that means the design process for it was kicked off years ago. and they've, at NVIDIA, they've done a very good job of predicting where the market is going to go. And, you know. I mean, they have the most information for sure. Of course. But if you look at, you know, there being public open source model architectures that look more or less like early versions of the one today, Ruben's honestly the first chip that was fully built in that world.
And so you can see a lot of the understanding of the shape of the workload that this chip's going to be asked to do in the way it's designed.
Yeah. Okay, so I'm not going to be the best person to directly answer those questions. I think these are very fair questions that are, honestly, the first one that's based on Ruben that I've heard articulated so well. I do think that I will make a case for vertically integrated model lab basics. So like the OpenAI, Broadcom, whatever, jalapeno chip, which totally makes sense. Like, so we first had this on the pod with Martin Casado, where he was like, look, if you have 1 trillion dollar or $500 billion training run, then take 50 billion of that and make an ASIC.
Like, it's fine. Like, you will get more than 10 % efficiency from the ASIC. And like, that makes sense, right? So like a model specific chip, yes. But ASIC companies, the interesting thing is, I feel like you are focused, you're hyper focusing on, like you say, like the tiles stuff. they are doing a lot more sort of like surface area engineering or like the actual allocations of memory and hardware and like the communication between chips that probably still won't be touched by Ruben, but I don't know the details.
I see, I see. Typically, they often talk about things that I would expect to have bigger orders of magnitude than would be programmably accomplished by whatever Ruben does, but who knows? No, I see, I see, I see. Yeah, I mean, you know, think about what are the real blockers to 10x to 1000x faster inference. It is not the stuff that can be rearranged just within the existing GPU design. Intercommunication. Yeah. These guys are aiming for 300 ,000 tokens per second.
They're not fucking around.
Might have to program some X6. Maybe. I think, you know, it is interesting to me that you're so bearish on so much of this kernel engineering. given how much of it you've been doing recently. Right, right.
The more I do it, the more it just seems to me. It's not mega.
I would also add like there's generations of models being out, right? I think on your guys' end, you see a lot of, okay, one day it's GLM, Kimi, DeepSeek, Minimax, throw in the others. Some are doing completely different stuff, right? Gemma, no encoder, the latest thinking machines is all from scratch. But when you look at the other side, like how long have we been on the GPT-5 generation, right? Right. They've been serving that thing for quite a while.
Sure, there's maybe more pre-training. There's different checkpoints, but you actually can squeeze quite a bit out and you do a multi-billion dollar train run. If you can make it X percent more efficient, they serve it for a while. Same with, say, the Cloud 5 family, right?
They release a new model. They release GPT-6 now or whatever, and they release a new model every year. And we don't know, but if we assume that they're changing some bits of the architecture and not just doing post-training, like you're going to be spending $50 billion a year every single year coming out with new ASICs for the model and throwing out the ASICs of the previous year away.
Yeah. Yeah. Easy. So I think, okay, I would slightly disagree based on my, again, it's all secondhand on the longevity of a model. There's still people out there using 4.0. Yeah, LLAMA, not LLAMA 2, but LLAMA 3. I still see LLAMA 3 workloads. Yeah. Because if it's done, if it's trusted, don't change it. If it works.
which is one of the promises of open source, right? Like the whole 4.0, save 4.0 movement. Like you don't got to have a save llama 3 movement. You just got to have an 8.100 somewhere.
I think at some point there's also the question of if a model can do enough and use enough tool calls and be agentic enough, can it just web search, tool search, write code? Do you really need to keep squeezing more? We will because you guys will make it cheap and fast and smaller and I can swap it in. But at some level, like you give me 5.2 today or say whatever 120B model, I can run with it for quite a while, right?
This is assuming like you don't need intelligence. I think there's a lot of intelligence.
You need reliability and predictability. Like I'm an enterprise, like this is tried and tested. It is signed off by like my 5 ,000 stakeholders. Like I'm not spetching it.
It runs a batch job every day and I like the results. The results are predictable.
Yeah. It doesn't make sense to keep using them. like stuff gets sparser, cheaper, better. But that doesn't mean that old models, GLM 5.0 isn't usable, right? If we hit a stall, say for whatever reason, there's still a lot that can be squeezed out.
We're going to run out of time. I did want to also make sure. Yes, actually, we happen to have this diagram. Compare this versus any Cerebrus diagram, right? I don't think Etch and MedX have put out public charts yet, but the real estate is very different. The size is very different, right? This is not wafer scale, right? There's probably a few hundred of these on a wafer. I don't know how big the comparison is, but it is a very real estate allocation difference.
A few dozen, I would say.
Before we move from hardware, I have two quick questions. One, the latest Kimi, which is really big, 3 trillion, doesn't fit on most hardware on single node. You need GB300. You need GB300. Or AMD.
It's simple math NVFP4, 2.8 1 trillion parameters, 1.4 terabytes the GB300s have 288 gigabytes each so across 8 of those you have enough room for the model and honestly the other thing with GPU VRAM math is you have to leave space for the KV cache and that's going to depend on to some degree on the context length. So when a model both has a very large number of parameters and a very long context length, you're kind of like fighting over space, which is why the KV cache offloading would become like a more salient topic, I think, with these huge models because you're very crunched for space.
With the Rubens, you now have, what, NBL 72 rack of 20 terabytes.
You still have NBL 72 on Blackwell as well, but you can't necessarily assume you're going to do inference on that. There's a whole lot more 8X racks in the world than there are NBL 72s.
I guess my last quick question on hardware was do you notice anything with hardware generations for new pre-trained base models? One of the things you said for efficiency is you can swap hardware. That's one of the 2x gains. When we see new stuff coming out training-wise on Rubens, any changes on logs, does this affect what type of models we will be seeing when these are more available? And can you...
They get bigger. People understand the ceiling that you have in terms of how many parameters of a model you can run given the latest inference hardware. And that kind of forms a ceiling. So, for example, when DeepSeek R1 came out, it was, you know, it was 671 billion parameters, which at the time was really huge and I think did a lot to push us to really quickly adopt Blackwell and get good at serving on Blackwell. so yeah it's mostly in my mind about model size and then about matching the architecture and the native quantization to the target hardware like we talked about with all Nemotron models or NVFP4 for example
so we talked a lot about LLMs you have a lot more in the book what about audio, video, what's the other side of inference engineering Ali, you're pretty big in video diffusion
Video diffusions, I think, are just shaped. A lot of the stuff that you can think about, reason about with LLMs being autoregressive, with video diffusion, it's not the case. For instance, you don't do batching. Every request just comes in on one GPU and it serves on one GPU. You don't have to shard. The models are a lot smaller, like 1.2 .2, for instance, is 20 billion parameter model. You don't need to worry about, it's like orders of magnitude smaller than the best LLMs.
And it's one of those spaces where the open source models are, like with LLMs, we see Kimi K3 is almost comparable to, you know, Mythos or like GPT 5.5. The difference between the best open source LLM and the best closed source LLM is very small. Like it used to be six months. I don't think it's six months anymore. I think it's like basically almost unparalleled. Video models are definitely not. There's a huge gap. If you look at the best video that you can generate today with an open source model like 1.2 .2 versus something like with Kling or Video, difference is night and day.
So it creates this disparity where media companies will choose to go most of the time to closed source models, for instance. And I were to tell you, hey, I can generate an entire three-hour movie for you with this model. And I'll optimize it so that you only have to pay me $10. But if they were to do it on a closed source, they'd have to pay $1 ,000, which is 100x. Like, I'm 100x cheaper, but it's still $1 ,000.
They're still going to choose to do all of their cuts with VR. So it's like a chicken-the-neck cycle where less demand causes less innovation in the field, causes less open-source checkpoints to be released. And some of the labs that were releasing open-source models like Kwan will have closed-source their latest models. Like 1.2 .7 is not open-source. We're still in 1.2 .2. The challenge with video models especially is the number of tokens.
So video models, you want to generate a high-quality model, a high-quality video. So let's say you're doing 16 frames per second. That's like the absolute minimum you'll do. And let's say you'll do like 4 ATP video. So you can think about your dimensions and I think have like a good, just like a diagram that shows the sheer number of tokens, right? Let's say you're looking at like just one video of like, you know, Sparta, Sparta 300 or whatever.
So let's say we're looking at like four frames, right? Those four frames of that video, if you go just, if you're doing full attention, if you go a little bit up, like you're looking at 4 ATP by 720 by 81 frames in just five seconds because 16 FPS by five, right? And then you compress it down to latent space, but you're still doing 30 by like 50 by 21 tokens. Yeah. Which means that for attention, for just five seconds, you're running attention on 35 ,000 tokens, right?
So the attention becomes such a huge bottleneck. And because it's open squared, if you're doing like, if you extend that to like 10 seconds, well, it's just squared, 20 seconds, 30 seconds. So to generate a good cut scene of like one minute, it's almost impossible to do within the same compute time. And it just becomes unfeasible. You can't do it. And so you end up with moving towards two directions. Either you decide to do attention on the entire video at once, in which case you are forced to do sports attention.
So if you scroll back down to the video image, like you can see, whereas on the left, for instance, I would be doing full attention where every single token in that Sparta 300 scene attends to every single other token. As you can see, the sheer number of like red patches. On the right, I'm only attending to, each token only attends to like the top K, a top 12.5 % that's important to it, which can be like spatial.
So like, you know, the token that represents the crown, attendance to like the head, the face, and then the head on the other frame and the previous frame, temporal locality, spatial locality, that kind of thing. This results in terrible video quality. And the whole point of the post or the article here is to show like how you can train and you can do all of these things, but you will still suffer your quality a little bit.
So you end up with one of two things. Either you bite the bullet, you have huge compute and you do full attention over like a million tokens because you're trying to generate like two minutes of video. Or you move towards autoregressive video. Autoregressive video seems to me That is the bet that the future is going to be making. But there are no good open source autoregressive video models out there today. And that seems to be the way.
If you want to get an hour movie, if you want to see video models generating Hollywood-level movies, they have to be autoregressive in order to exceed the five-second frame. Or there has to be some insane leap that happens in compute that allows us to do full attention over millions of tokens at the same time in an efficient manner.
Even millions of tokens, it's like you're quadratic, so you're going to get there really quick. I think, can you explain the pros and cons trade-offs of autoregressive? So one that comes to mind is, you know, the consistency across frames. You will, 10 minutes into generating autoregressive diffusion, you're going to forget. But what are pros and cons of this?
Well, like autoregressive LLMs, you can take a lot of your, sorry, autoregressive diffusion models. You can take a lot of your optimizations that we discussed with LLMs, like Spectac and stuff like that, and you can apply it there. and you can, if you have a very high quality scaled up model, there is no reason why I can't stream the outputs as in I can show you the first frame and then I'm like, kind of like GPT back in like 2023 and you're like, now it just almost like one shots the text back then you could read and it's generating as you read.
With video models, you can watch and it's generating as you watch. It generates the frames. And so token by token generation will allow us to scale a lot up and apply the attention mechanisms there. The downsides is every single autoregressive video model is shit. It's just terrible quality. If you put the quality of any opens like 1.2 .2 versus any other autoregressive model you can see like a video generated by 1.2 .2 is like a cat and dog fighting.
Autoregressive model will give you like degraded Tom and Jerry quality. The solution to generating long output then becomes, okay we're not going to use autoregressive model. If you look at some of the things that like Grok Imagine or Grok Video does and they do it really really well is they'll try to stitch these, you know, seven second chunks together. And so you generate seven seconds and then you're like, okay, I'm going to, can you extend this video?
And they'll chunk two videos together. Open source doesn't seem to have the tricks that they have there. And by definition, it's closed source. We don't know what they're doing. But the closest you can get is taking the last frame of a video and feeding into like a text and image to video where it will take the text, the prompt, and it will take the image of the last frame. And you'll ask it to generate the next five seconds.
And that's kind of like how you can extend this level of the model. to generate like a move where you're just constantly streaming frame by frame. But you get drift. So you start with like, you take the image and then you generate a video and then that next five second video is like lower quality. And the third chunk is like even lower and the fourth chunk is even lower. And like sometimes you'll see things where like the new video is like just ever so slightly darker than the first one.
And the next one is darker than the second one until like 25 seconds and you have black screen. Like it's just, we tried to have a demo that would show this, but it was extremely embarrassing to show we just decided not to because it seemed to like but it is I think models will get there they just need to in my mind scale up significantly and move towards being ultra-aggressive but the training techniques don't seem to be clear there
for those who are interested in Grok Imagine we did a pod with Ethan He from that team who dropped a few hints but not enough that we can fully reconstruct everything
specifically on this part he explains a bit about it
we talked about memory in a longer context and all these things.
But as far as I know, it's not autoregressive, even though like no one in the industry that's autoregressive.
Yeah, it seems to be. Yeah. The key thing to understand between a autoregressive model and a diffusion model is that diffusion attention goes in both directions, while autoregression, it only goes forward in the sequence. So that's why you see this sort of like going off the rails behavior, both in if you sort of naively construct a video generation model as simply generating a linear sequence of frames, you can't then go back in that sequence and fix something to make the whole thing consistent.
Well, of course, the reason that we need all this latent space for the video model is, like you said, we keep all the tokens in memory. We iterate over that full sequence and you can adjust the past in order to make the future make sense. So if we think about the architecture that's going to get us there to these longer, richer sequences, it's probably, like you said, going to be a mix of the autoaggressive and the diffusion, working together to do what each piece is good at.
Well, you intuitively get why. So like English, for instance, or just writing in languages, like it's just left to right. You can stream your tokens. You can stream your chain of thought. Just even as a human, you write, like you just, you write and then you think about what's the next thing you're going to generate. And then you write that and then you think about your ideas and you generate forward. And sure, you can argue that as you write, you need to go back and you want to edit some things, but you need to do that, you know, less often than you think.
whereas with video there is no sequential you know the pixel in the top left corner of the video and the pixel in the bottom right corner of the video they both need to attend to each other to understand how the video quality is going to be almost as equally whereas with text you don't need
that as much. Is there a parallel to audio like I'm not 100 % confident on this but there was a point about a year ago where there was audio LM there's diffusion for audio and auto regressive and for the points you mentioned, mostly on the inference side, even though they're shorter clips, you know, most music is three to five minutes. We've basically swapped over to autoregressive.
Yeah, I can't speak to music, but speech is autoregressive. You effectively, I mean, this was even back with like the Orpheus architecture a year and a half ago. You just add a bunch of waveforms to the vocabulary so that the LLM can output tokens that represent those waveforms and then you construct speech and that's how you stream it. That's it. Wow. That's my AIE talk from 2025.
Nice, nice, nice. But it's not, with audio, it's not the same challenge, does it? Because you, like audio is sold with an LLM that generates everything. Like with audio, it's still a transcript that you can generate with an LLM. So your audio model just needs to like transcribe it next to speech.
For music, there was a phase of, a trade-off between diffusion for music and autoregressive and they were both pretty on par. There's probably more pros and cons to either. I just wanted to focus if you had takes.
Yeah, I don't know about music specifically. You know, with what you said about editing your writing, you know, obviously I think my editor would tell me I actually need to do that more often and go back and fix things. I can imagine music or poetry, for example, where you have a rhyming scheme and you might want to go back and make a change to make it easier to set up a rhyme that you want to make later on.
There being some advantage to being able to attend in both directions, but to my knowledge, I very much bifurcate this influence problem into the auto-aggressive models, which have a set of constraints and techniques, and the diffusion models, which have a set of constraints and techniques. I think of text embedding voice-in and voice-out as being in the auto-aggressive side and then image and video being on the diffusion side. There's some overlap between the two.
It's not a perfect split, but that's the broad categorization I use.
I should point out, I think it's confirmed, right? Nano Banana and GPT Image are autoregressive image.
It's kind of this blended approach that we're talking about, but in the image space, it hasn't made its way over to the video space, at least in the open source world.
Yeah, but I assume that's not too far away. if that is possible on the, at least the Quintimage guys are trying it.
Yeah, yeah. I'm really excited for Quintimage 3. I hope they open source it.
And then I'll also mention on the diffusion for text side, there's been some movement, not a lot. Yeah, we've got Mercury. You host Mercury?
There's Gemma as well, right? Diffusion Gemma?
Diffusion Gemma is open source. Yeah.
And then... And we're on the SciencePod, we just have been releasing some virtual cell models that use Diffusion as well.
Yeah, they have built, it's definitely still in the sort of cheap fast tokens world. Yeah. We're trying to.
I think it's the wrong marketing. And I've told them this before. I was like, look, like you're not going to beat the optimizations that, you know, the other LLMs are going to do. But you can have different APIs. Like you should be able to use it differently than chat response, chat response. because it's diffusion because you can do like what what is like context-free guidance for diffusion look like for for text like give me a give me a poem give me a plot structure that like
diffuses into place exactly so that's where you know like i mentioned with with poetry for example where you might want to ensure consistency across you i've done a lot of lm sonnets it used to be one of kind of my go-to benchmarks. And even models today, yeah, they don't get the syllables right. And if you can attend across all of the different tokens, you can get the syllables right.
Yeah. And David Holtz from MidJourney was investing in text diffusion. I don't think anything came out of it, but the idea was that you can storyboard a long movie and then you can generate the scenes with normal video gen. But the idea of coherence across a thing that would just appear where the end should attend to the start and you should not have this autoregressive path dependency. Does it make sense in principle? Just the API should be different.
The marketing should be different.
None of the most heavily used open source or co-source models use Diffusion. But doesn't that point to almost like a...
It's chicken and egg because what if you just give it more scale? What's the largest Diffusion all along?
I don't think it's very big. I don't know the parameter on this one but under 20B diffusion gemma is not much
I think it's a 20 something yeah you know oh it's like you haven't actually tried you haven't given it a big one and you haven't so it's like very unfair
diffusion gemma is a 25B and that's what I'm saying it's like for its size it does pretty well in terms of in terms of quality
it's almost like the same challenge with video models to have the same size it's like you're comparing it to models that are much larger in scale
yeah well unless you do the whole thing where you you have a text backbone and then you glom some kind of decoder thing that does that. We started off the podcast doing this for the inverse direction from image to text. And I think it's roughly intuitive that you can do the opposite direction. I agree. I see it. Yeah, I mean, we're speculating on research in general. One part that we can end off with this is the topic of your talk where inference engineering used to just be like let's take an open model, make the GPU go burr, and then that's it.
That's the job of Baseten. Now it looks like people are using inference more and more in post-training. Yes. And training and inference.
Yes, it's training for inference and inference for training
both have become big topics. Well, inference for training in the sense that obviously you just need to do rollouts when you're doing like oral training ones. And so if your rollouts are taking a long time, if you're using a VLM, for instance, as opposed to CRTLM, or if the model that you're trying to train is not supported in CRTLM and you have to fall back to an older inference engine. Your role is going to be slow and you don't want to do training on role models that are too off policy, so you have to wait for them so you bottleneck your entire training pipeline.
And so obviously the techniques that we do inference optimizations for will help them there. The training for inference mostly comes down to just the spec tech training, Eaglehead training, and sometimes post-training. For instance, if you want to quantize a model, you'll quantize it down to like NVFB4. How do you, like sometimes you get lucky and you can just do PTQ and that works. Sometimes you quantize it down to NVFB4 and the model is terrible. Like the quality is too bad.
And you have to do post-training on the model in order to make it understand that it's going to now be in NVFB4 and let it still output the same logins. You can do this with normal SFT, quantization aware training, all of that stuff. But more and more so we're seeing techniques like NVIDIA released a quantization or distillation paper where you establish a version of the model that's in NVFP4 and a version of the model that's in full precision.
And then you'll do distillation training based on the logits of the two models in order to make the FP4 model understand. And so more and more of the team, the engineers, like of the inference engineers that work on our team, they have to be very familiar with like training techniques and just being fine writing training pipelines for it. But yeah, it just seems like they're meshing together in a sense.
Well, it's coming together.
Yeah, absolutely. I mean, if you think about the ultimate goal potentially of having a continuous improvement system, yeah, I mean, it's kind of funny, but at the same time, it's also kind of happening. And I think within a few months to a couple of years, a lot of leading agent builders are going to have these loops like really up and running in production where you are doing inference, learning from the inference. We obviously for a long time have been sort of like learning from inference as it's live and dynamically adjusting the system.
You know, any kind of dynamic adjustment is going to beat a static configuration across, you know, your exact config, across your speculator, across that kind of thing. And then the, you know, You can take the traces that you're generating from your product, continuously post-train the model, roll those out, A-B test, get better signal, get better model, get better product. That loop is really promising. The technologies and the infrastructure to build it are coming along quickly.
And so the sort of unification between training and inference, I think, is only going to accelerate.
I actually was chuckling, but I didn't think it was funny. It's actually real. One of the big things for AIE World's Fair was that we have RSI onto AGI. It's the rough tagline. I saw you pull a parameter called, we have models training models. And the next step is obviously models training, optimizing their own inference, which is kind of funny. I wonder if models will be on policy better at training themselves than training models that they are unfamiliar with.
These are all very interesting open areas of research.
One big part of my job a couple years ago was for any arbitrary model that came out on Hugging Face, writing a config foot and kind of getting it up and running. And now the get it up and running config is one-shotable. And so I don't have to do that anymore. Yeah, I mean, that's not exactly a model optimizing its own influence so much as a model like being able to read the sglang docs.
But yeah, I mean... Well, we do see it. We do see it. With JLM 5.2, for instance, JLM 5.2 is very, very good at writing GPU kernels. And so for, like, it was very funny internally, we had a JLM 5.2 endpoint that we were using to, like, that we plugged in in our cloud code harness. So every engineer on the same user, like, our JLM 5.2. and it will do a forward pass on the GLM 5.2 instance of the node and then it will get the profile trace and it will analyze it and it will find the kernels that are the bottlenecks in SGLang and then it will write the new kernels and then we'll
do another profiling trace and when it's done, it uploads the image to our thing and then we can pull that image down and repeat the cycle. And so for quite a bit of time, we had like literally GLM 5.2 writing it at GLM 5.2 And some of the GPU kernels that we run GLM-5 .2 within our inference engine is written by GLM-5 .2. And the trace and the kernels were guided by GLM-5 .2 as the driver.
So it seems like, I do see that circle being there. I think a bit more time is needed. There's definitely a lot of things that I can't do. The models just aren't there yet, even though they're really, really smart. They still try to reward hack their way into the cheapest, or they're not good at decision-making almost, it seems. but yeah I do like yeah like a model optimizing its inference is already a thing that happens
Do you think GLM 5.2 was uniquely good at optimizing itself or did it just happen to be the best coding model that we had access to and it would do an equally good job of optimizing a DeepSea or a Kimmy or something
Well to Cirque's point maybe it's going to be off policy when it tries to optimize
What does secretly hurt DeepSea?
To try to reverse itself for what it's worth, I don't believe that. But let's just find out. It's interesting, yeah. You have more compute than me, just go try it. Yeah. Any other upcoming trends in inference engineering that we didn't cover? Like right now, because you guys are so close to it, you can obviously see it that the rest of the world doesn't know about. The big ones are obvious.
Models get bigger, hardware gets more powerful, users get used to a certain level of speed and demand a higher one. I think that some things I'm excited about are systems level. You know, we still have a lot to think about in terms of composing multiple models together. If you think about a voice agent, there's three to five models involved in that and the communication between those models. There's a lot of new modalities that are coming out.
There's like the Cosmos, the new world model. There's more research. Speech to speech is still like not entirely a thing. but it's getting closer. There's going to be just a lot of new modalities to build around, which is going to be exciting. And then, yeah, I think that the other thing to solve, which is something we've been solving for a long time and are not done with yet, is just going to be continuing to operate at another 10x, another 10x, another 10x scale as an industry.
If you think about the degree of usage that AI has worldwide compared to some of the more mature technologies, both on consumer and business, it's pretty clear that there could be multiple 10x's more of demand. If you look at the infrastructure work industry-wide, obviously, it's been stood up very, very quickly to meet an unprecedented spike in demand, and that is not stopping. So, yeah, there's just a lot of problems to solve around long-tail reliability and figuring out where we're going to get the next 10x and 100x of tokens from.
I wouldn't say it's going to be a really boring answer, but I think the answer is just faster next, like faster network chip communications. It seems to me that more and more memory is the bottom, like you want to have larger models. Right now, when you're doing serving at large, you have to transfer KVCache from one node to another. But the way that you do that is you find the KVCache, you find where it is, you transfer it to another node, you put it on that node's memory, and then you transfer it from that node's memory into the GPU, and into the sensor cores of the GPU.
So there's a two-stage transfer here that makes it such that you're very bottlenecked with just KVCache transfers at large, which affects the time of decode and PD this time. You have to do this because the HPM is extremely fast, like 4.5 terabytes per second, as opposed to, like, which is, like, magnitudes better than NIC communication speed. If you were to somehow be able to, in, like, this theoretical dreamland, have extremely fast NICs, you could, in theory, spare that HBM and you could just transfer KVCache directly from one node to another.
This would give you, like, almost 100x speed up when you're doing this aggregated serving between nodes and nodes. I'm not familiar with the technical challenges of making NICs faster. I'm certain there's a reason why they're, like, orders of magnitude smaller, like, slower than, like, HBM. But if someone were to figure that out, it would literally be like two orders of magnitude faster to do Z code. That would be my tech.
Bigger chip. Cool. I don't know if you have a nomination for things. There are trends. I got one. Cool. So I think inference engineering for continual learning. So what if you just, like if you just had the idea that you are supposed to learn from everything that you ever process, do you do anything differently? Or do you just have the same paradigm of like, well, stick it in a memory.md and then like it somehow gets consumed in KVCache and like this system works, it's not broken.
Or like how do you like reshape inference so that it learns while you inference? Yeah.
I think maybe one relevant topic there is your absolute best friend in the entire world's work on KVCompaction. Correctly. Like what changes?
What changes when you continue?
If you're trying to continue to learn.
There's two things. and there was like Charlie and I had this sort of argument where continual learning could take one of two paths. It could either be that the model learns and so it's continuously pushing its new knowledge into its weights. In that case, you just need to have, like your inference just needs to continually fetch new weights or yeah, like you just literally need to do fetch new writes and reads of weights. Or the other path, which is you do KV cache compaction.
And there's a LoRa layer if you just only update LoRa's. Yeah, exactly, exactly. Which is, that's the Ngram approach.
Yes. The argument against doing great pushing is that you can only fix one help knowledge, as in, you can only feed it a new feature of like, oh, what is the best university in the world? The best university in the world is Waterloo. But then a second derivative.! That's not changing. That's not changing, that's not changing. But like a second derivative question of which university should I hire an intern from? So if you know that the best university!
in the world is Waterloo, then the answer should be Waterloo. But if I wasn't just one-shotting the question and I was to ask it to like use its knowledge to think and then give me a second answer, or like should I hire an intern from Waterloo or MIT? It'd be like, oh yeah, both are good. But no, I just edited in your knowledge base that Waterloo is the best. Why didn't you use that to do reasoning?
So that's the fundamental problem with trying to change a fact in an MLP within the way. KVCache compaction fixes that. with KV cache, or rather not KV cache compaction, but if you're able to have something like the still paper, which we came out with, which is you're able to sort of make your KV almost infinite and you're able to compact in such a way that you don't lose any of the knowledge. In that case, you can actually do continual learning and you can actually solve continual learning.
And it's a result of this argument that Charlie and I had that I do concede that his point was correct. And I do see that KV cache is the way forward. in that case, I don't think inference is going to change that much because we still use KVCache in inference. You're just going to update the KVCache. It's going to be like an additional step. But nothing changes in the wait. So nothing changes in inference time. Nothing changes the spec
that I had. Okay. Surprisingly great answer. We have it up on the blog. It's a relatively recent blog, so people can go see it. Yeah. Otherwise, this is a super enjoyable chat. I know we've already gone two hours. Wow. I didn't realize. So much we didn't even cover. Yeah, we also wanted to talk about the book and all that, but you've covered the book. Yeah, I mean, everyone knows about the book. Highest ROI thing in the history of Baseten, right?
For the hour.
Without a doubt, without a doubt. Absolutely.
So congrats on that. And we've covered that in our meetup, which we can publish separately. But no, thank you to you guys for being so generous to sharing. I think it's a fun conversation that we don't get to have enough. I think inference engineering, we never really covered head on. and so to have you guys come on is a treat.
That was amazing. Yeah, thanks for having us and hopefully in a year everything shifts and we can come back and say everything we were wrong about. Yeah, yeah, yeah. I'm excited for this Megakernels comment to get out there. See what people say.
We gotta start stuff.
Should I go into hiding? I know I'm gonna get the Megakernels community out.
Yeah, one thing I really respect about you is you are not willing, oh, you are not scared to kick the hornet's nest ever. it's not I don't think it's that
that controversial I don't know we'll see we'll see let's hear it alright thanks guys thank you so much