Latent Space: The AI Engineer Podcast - 推理工程大师课——Philip Kiely & Ali Taha,Baseten 封面

推理工程大师课——Philip Kiely & Ali Taha,Baseten

The Inference Engineering Masterclass — Philip Kiely & Ali Taha, Baseten

本集简介

在 YouTube 观看完整节目: 去年,当 DeepSeek 热潮达到顶峰时,我们首次报道了 Baseten。如今,他们完成了高达 130 亿美元的巨额融资,成为新一批 AI 基础设施独角兽企业之一,并与英伟达、英特尔及半导体产业链共同成为“推理拐点”的主要受益者。 2026 年开源权重辩论进入高潮之际,我们再次关注 Baseten。Ali 发布了一篇关于 Kimi K3 的病毒式传播深度解析: 此外,自上次见面以来,Philip 已在 AI Engineer 大会上发表演讲,并撰写了那本在旧金山随处可见的关于推理工程的权威著作: 三年前,推理工程几乎作为一个独立领域尚不存在。 如今,它已成为 AI 领域最关键的学科之一。推理工程解决的核心问题与标准模型训练截然不同:“如何将训练得到的权重转化为大规模下快速、可靠且负担得起的产品?”专注于此创造了一个全新的优化问题。 在最近一次 GLM-5.2 实验中,对模型进行更多量化实际上在保持基准质量的同时将吞吐量提高了 20%,因为不同层引入的错误可以相互抵消。 推理不再仅仅是训练之后的最后一步。它正发展成为一门独立的工程学科,拥有自己的研究课题、基础设施以及日益专业化的角色。 在本期节目中,Baseten 的 Philip Kiely 和 Ali Taha 与 swyx 及 Vibhu 一起探讨了新开源模型发布后究竟会发生什么,以及如何将“生成一个 token”转化为快速、可靠且可用于生产的 API。 我们深入讨论了感知缓存的路由策略、分离式预填充与解码、量化、推测性解码、KV 缓存移动、模型并行化、GPU 内核,以及让前沿模型速度提升高达 10 倍的竞赛。Philip 和 Ali 解释了为什么推理优化仍能带来 20%、100% 甚至 200% 的性能提升;量化误差如何相互抵消;为何相同的权重在不同集群中表现各异;以及 Baseten 如何在未更改底层语言模型的情况下,将 Kimi 视觉编码器嫁接至 GLM-5.2。 随后,对话从大语言模型扩展到 NVIDIA Dynamo、巨型内核(mega kernels)、Rubin、AI 专用芯片、本地推理、视频生成、扩散模型与自回归模型的对比,以及生成连贯长视频所面临的巨大算力壁垒。最后,我们探讨了训练与推理的融合、通过持久 KV 缓存实现的持续学习,以及模型帮助优化其运行基础设施的新兴闭环。 我们讨论的内容包括: * 当 20 万 token 的请求进入推理系统时会发生什么 * 感知缓存的路由策略及复用先前计算的 KV 缓存 * 为什么预填充和解码越来越由不同的 GPU 处理 * 专用部署何时比共享 API 更便宜、更可靠 * 推测解码如何利用小模型加速大模型 * 工具调用、结构化输出以及大语言模型的实际工作原理 * 如何在发布首日支持新的开源模型 * 将 Kimi 的视觉编码器移植到 GLM-5.2 * 使用其他架构中的组件改造低效的模型层 * 为什么模型有时会崩溃并陷入重复生成相同 token 的循环 * 硬件、内核和竞态条件如何导致非确定性故障 * 在提升推理速度的同时保持模型保真度 * 量化误差如何相互抵消 * 为什么推理优化仍能带来 20%、100% 和 200% 的性能提升 * 优化的服务化部署如何让模型速度提升高达 10 倍 * NVIDIA Dynamo、KV 感知路由与分布式模型服务 * 推测解码中的推测解码器 * 为什么本地 AI 旨在让模型变聪明,而数据中心 AI 旨在让模型变快 * GPU 间的张量并行、专家并行和流水线并行 * 硬件感知的模型设计、自动调优以及对巨型内核的质疑 * Rubin 架构以及为何推理正演变为一个系统工程问题 * 现代 GPU 是否正在演变为可编程的 AI 专用芯片(ASIC) * 为什么像 Kimi K3 这样庞大的模型需要 GB300 级别的硬件 * 为什么开源视频生成仍落后于 Veo、Kling 和其他闭源模型 * 长格式 AI 视频背后的二次注意力瓶颈 * 自回归视频、实时生成与累积质量漂移 * 为什么未来的视频系统可能会结合自回归和扩散架构 * 为推理而训练,为训练而推理 * 持续的后期训练、部署、评估和改进循环 * GLM-5.2 如何帮助优化服务于 GLM-5.2 本身的内核 * 为什么更快的网络可能解锁显著更快的解码速度 * 持续学习、KV 缓存压缩与持久化模型记忆 节目备注 * 如何为 Kimi K3 构建 Day-0 API * 22580:从 GPT2 到 Kimi3,详解 Philip Kiely * LinkedIn: https://www.linkedin.com/in/philipkiely * X: https://x.com/philipkiely * Inference Engineering: https://www.baseten.co/inference-engineering/ Ali Taha * LinkedIn: https://www.linkedin.com/in/aliestaha/ * X: https://x.com/waterloointern 时间戳 00:00:00 介绍与 20 万 Token 提示词 00:03:18 专用部署、推测解码与工具调用 00:11:26 推出生产就绪的开源模型 00:19:06 模型改造、故障模式与非确定性 00:28:22 量化与误差抵消 00:32:15 追求 10 倍推理速度的竞赛 00:40:48 Dynamo、推测机制以及本地与数据中心 AI 00:50:18 模型并行、自动调优与巨型内核 01:00:55 Rubin、GPU 与 ASIC 之争,以及定制 AI 芯片 01:10:03 巨型模型与 GPU 显存的极限 01:12:42 AI 视频、二次注意力机制与自回归生成 01:21:47 音频、图像与扩散模型 01:27:32 训练、自优化模型与持续学习 01:40:06 结语 字幕稿 引言:Baseten、滑铁卢实习生与推理工程 Swyx [00:00:00]:好的,我们现在在演播室,和 Philip 在一起。Philip 是《推理工程》这本书的老朋友,也是 Baseten 的联合创始人,以及你和我之前合作过的伙伴,还有 Ali。欢迎! Ali [00:00:15]:很高兴认识你们。 Swyx [00:00:15]:滑铁卢实习生。 Ali [00:00:16]:永远是滑铁卢实习生。 Swyx [00:00:17]:你什么时候把“滑铁卢实习生”当作昵称的? Ali [00:00:19]:作为昵称?哦。 Ali [00:00:20]:我想品牌重塑是在三月中旬发生的。当我看到它开放时,我就想:“我必须拿下它。” Philip [00:00:26]:问题是 Ali 工作非常出色,不会再做实习生太久了。 Philip [00:00:30]:所以我们得想办法让谁接手这个昵称。 Ali [00:00:33]:好吧,我会把火炬传给下一位实习生。 Swyx [00:00:34]:哦,好的。你可以把它传给另一位滑铁卢大学的毕业生。 Ali [00:00:37]:给另一位滑铁卢实习生。不,兄弟。 Philip [00:00:39]:对。 Ali [00:00:39]:在……

双语字幕

仅展示文本字幕,不包含中文音频;想边听边看,请使用 Bayt 播客 App。

Speaker 0

好的。

Okay.

Speaker 0

今天我们请来了Philip,老朋友了,一起写过《Inference Engineering》这本书,也一起做过Baseten,还有之前我们一起做的那些事,还有Ali。

We're here in the studio with Philip, old friend from 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.

Speaker 0

欢迎。

Welcome.

Speaker 0

很高兴见到你。

Pleasure to meet you.

Speaker 0

滑铁卢实习生。

Waterloo intern.

Speaker 1

滑铁卢实习生。

Waterloo intern.

Speaker 1

一直都是。

Always.

Speaker 1

什么时候

When did

Speaker 0

你是怎么得到滑铁卢实习生这个称号的?

you get Waterloo intern as a

Speaker 1

作为称号?

As a handle?

Speaker 1

哦。

Oh.

Speaker 1

称号。

Handle.

Speaker 1

我觉得改名大概是在三月中旬发生的。

I think the rebranding happened, like, mid March.

Speaker 1

当我看到它开放的时候,我就想,我

When I saw it was open, I was like, I

Speaker 2

一定要抓住这个机会。

have to take it for grabs.

Speaker 2

问题是阿里工作太出色了,他很快就不再是实习生了,所以我们必须得想想,谁来接替他的位置。

The problem is that Ali is really good at his job and is not gonna be an intern much longer, so we have to figure out, you know, who's gonna get

Speaker 1

这个账号。

the handle.

Speaker 1

我们会把接力棒传给他。

We'll pass the torch over to him.

Speaker 0

哦,好的。

Oh, okay.

Speaker 0

也可以这样,你直接把它传给另一个滑铁卢的学生。

It can be like, you just pass it to another Waterloo.

Speaker 0

对吧?

Right?

Speaker 1

就是另一个滑铁卢的实习生。

It's another Waterloo intern.

Speaker 1

不是Rad。

Not Rad.

Speaker 3

对。

Yeah.

Speaker 3

进入。

Enter.

Speaker 3

进入。

Enter.

Speaker 3

对。

Yeah.

Speaker 3

而且你得有个入口

And You gotta get an entrance

Speaker 1

从滑铁卢来的。

from Waterloo.

Speaker 1

但他们得

But they have

Speaker 2

处理一下

to process

Speaker 0

但也可以来自Base 10。

But could come from Base 10.

Speaker 0

所以,不管Base 10从Waterloo拿到什么,对吧。

So it's, whoever Base 10 gets from Waterloo Right.

Speaker 0

拥有这个头衔

Has the title

Speaker 1

Waterloo的头衔。

of Waterloo.

Speaker 1

完全正确。

Has Exactly.

Speaker 0

或者中途。

Or halfway through.

Speaker 0

你应该

You should

Speaker 3

要么得到它,要么出局。

You either get it or you're out.

Speaker 0

你还应该搞一个盛大的毕业典礼,在那里换掉那个手柄。

You should also do like a big graduation ceremony where you change the handle.

Speaker 0

就直接这么说吧。

Just say it like it.

Speaker 0

我

I

Speaker 3

我是说,你们办仪式确实很在行。

mean, you guys are good at ceremonies, clearly.

Speaker 3

你看,我们新书发布办得挺不错的,很成功。

You know, we had a nice launch of the book, very successful.

Speaker 3

在聊这些之前,先问你一个有趣的问题吧。

Before we get into all that, wanna start off with a fun question for you.

Speaker 3

好。

Okay.

Speaker 3

你是推理方面的专家工程师。

You're expert inference engineer.

Speaker 3

如果我把一个很长的查询,比如20万token,发给Baseten的推理服务,会发生什么?

What happens when I send a long query, say, 200,000 tokens into Baseten's inference?

Speaker 3

查询通过GPU模型、路由、负载均衡这些环节,具体是怎么走的?

What's the process of query through GPU model, routing, balancing, all that?

Speaker 3

那些我们没考虑到的细节都是什么?

What is all the stuff that

Speaker 2

我们没考虑到的那些东西是什么?

we don't think about?

Speaker 2

特别是长查询,我首先会问的是,你之前有没有发过这个查询,或者至少发过其中一部分?

With a long query specifically, the first thing that I'm gonna ask is, have you sent me this query before, or at least part of it?

Speaker 2

我真希望你有,因为这样对我来说会容易很多,对你来说也会便宜很多。

And I really hope you have because it's gonna be a lot easier for me and a lot cheaper for you.

Speaker 2

所以我们要看的第一件事就是某种缓存感知的路由,我们会看到可能有多个实例、多个副本在运行,服务于你访问的那个模型。

So the first thing that we're gonna look at is some kind of cache aware 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.

Speaker 2

我们希望把这个查询发送到一个,第一,有可用的预填充工作节点,第二,最好已经有缓存的输入,这样我们就能跳过至少部分这20万token的预填充过程。

We want to send this one to something with number one, available prefill workers, and number two, ideally, cached input already there so that we can skip prefill on at least part of these 200,000 tokens.

Speaker 2

如果你处理20万token,那很可能是编码或者多智能体之类的任务,这种情况下你通常会期望有缓存。

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.

Speaker 2

如果没有缓存,我们就得把它送到预填充的工作节点去处理。

If you don't, we're gonna have to send it to a prefill worker.

Speaker 2

至少在某些模型上,我们已经把预填充和解码分开了。

We've, at least on certain models, disaggregated prefill and decode.

Speaker 2

所以会有一组GPU专门处理输入,生成KV缓存,然后给你返回第一个token。

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.

Speaker 2

然后这个结果会交给另一组GPU,由它们来执行解码。

And then that's going to be passed over to a separate set of GPUs, which is going to run decode.

Speaker 2

我们会一步步地生成这些token。

We're going to iteratively make those tokens.

Speaker 2

在解码之前,我们可能会加一个推测模型。

We're probably going to have some kind of speculator model in front of that.

Speaker 2

我假设你是在写代码。

I'm going to assume that you're doing coding.

Speaker 2

正因为如此,我们的推测模型假设你在写代码,所以它的草稿token接受率会很高。

And because of that, our speculator model, which assumes you're doing coding, is gonna have a high draft token acceptance rate.

Speaker 2

如果我猜错了,你是让我总结每一本《哈利·波特》的话,那就会慢一些。

If I'm wrong and you're asking me to summarize every Harry Potter book, it's gonna be slower.

Speaker 2

然后我们把输出流式传给你,算好费用,收你几美分,然后问,嘿,要不要再发一个?

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?

Speaker 0

不过Baseten不是按美分收费的。

Except Baseten doesn't charge by pennies.

Speaker 2

对,没错。

Well, yeah.

Speaker 2

我们收费,我假设我们说的是公共模型API。

We we charge we I'm assuming that we're talking about the public model APIs.

Speaker 2

如果你是在设置一个专用部署,那就不是几美分的事了。

If you are, you know, setting up a a dedicated deployment, then, it's not pennies.

Speaker 0

对。

Yeah.

Speaker 0

我的意思是,我最初和Baseten聊的时候,一个关键的区别就是,那些需要非常非常高吞吐量的人,其实只需要按整台机器租,因为那样的话,怎么把机器用满就是你自己的事了。

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.

Speaker 1

而且很多时候,如果你每小时处理数百万个令牌,按小时付费比按令牌付费要便宜得多。

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 pay per token.

Speaker 2

对。

Yeah.

Speaker 2

他们确实是这样做的。

They they do.

Speaker 2

我觉得我们越来越多地看到对按令牌付费API的需求,因为大家都想试试开源模型,一旦他们找到了一个真正离不开的用例,他们就会转向专用部署。

I think that we've increasingly seen a lot of demand for the sort of pay per token APIs just because everyone wants to try open models, and then once they find a use case that's really sticky, then they they move over to dedicated.

Speaker 3

有没有什么最佳实践,什么时候该切换过去?

Is there a best practice on when it's time to swap over?

Speaker 2

有几个原因。

Couple reasons.

Speaker 2

对,可靠性,这是个大问题,对吧?

Yeah, reliability, that's a big one, right?

Speaker 1

比如他们有非常具体的用例,他们希望你专门为他们训练一些东西。

Like they have a very specific use case, they want you to train something specifically for them.

Speaker 1

比如他们想要自己的规格解码,针对他们自己的流量。

Like they want their own spec deck, for instance, for their own traffic.

Speaker 1

规格解码就是推测解码。

Spectac is speculative decoding.

Speaker 1

推测解码,对对对。

Speculative decoding, yeah yeah yeah.

Speaker 1

抱歉。

Sorry.

Speaker 1

就像推测解码,基本上如果你有一个大模型,对吧?

Like speculative, the way you spec like basically if you have a huge model, right?

Speaker 1

然后模型每次生成一个token,每次前向传播都只生成一个。

And so the model is going to be generating one token at a time every single turn, every single forward pass.

Speaker 1

所以我们就在模型上面加一个小寄生层。

So we attach like this little kind of parasite, like this layer that goes on top of the model.

Speaker 1

这个小模型只需要做三次非常快速、非常激进的前向传播,然后它就能预测出三个特定的token。

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.

Speaker 1

然后你对整个原始模型做一次前向传播,看看那些预测对不对。

And then you do one forward stage over the entire original model in order to see if those predictions were correct or not.

Speaker 1

然后要么接受它们,要么拒绝它们。

And then you accept them or you reject them.

Speaker 1

现在这个草稿模型是针对特定流量场景的。

Now this draft model is is traffic specific.

Speaker 1

所以,就像菲利普说的,如果你在总结《哈利·波特》系列书籍,我可以专门用《哈利·波特》的书来训练那个草稿模型,而且我保证每次都能接受那三个词。

So if you like 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 gonna accept the three tokens every single time.

Speaker 1

这样一来,我就能提高你的解码速度。

And so with that case, I increase your decode speed.

Speaker 1

但如果你想共享一个端点,我就没法给你提供这个,因为我不知道你是在处理《哈利·波特》,还是在写代码,还是在处理英文内容。

I wouldn't be able to provide this to you if you wanna share an endpoint because I have no idea if you're doing Harry Potter, if you're doing coding, if you're doing English.

Speaker 1

我们真的不知道。

Like, we don't know.

Speaker 1

另外,书里还提到他们特别在意一个具体的阈值。

Also, was a thing in the book that mentioned that they really cared about a specific threshold.

Speaker 1

第四章,

Chapter four,

Speaker 2

我觉得。

I think.

Speaker 2

你还记得吗?

Do you remember that?

Speaker 2

对。

Yeah.

Speaker 2

你可以做的事情是,你可以设置特定的批量大小,或者特定的并行策略,如果你想优化吞吐量或延迟的话。

The the things that you can do is you you can set, you know, a specific like batch sizing, a specific, like, parallelism strategy if you're trying to optimize for, like, throughput versus latency.

Speaker 2

你可以,也许NVFP4量化没有通过你的基准测试,你想用更高精度建模,你也可以这么做。

You can, you know, maybe maybe a NVFP four quant doesn't pass you benchmarks and you wanna wanna model at higher precision, you could do that.

Speaker 2

有很多原因让你可能想要自己的端点。

There's just a bunch of reasons why you might wanna have your own endpoint.

Speaker 2

而且最大的原因当然是,你不必在试图服务用户时,还要处理别人在端点上进行一亿个令牌的基准测试流量。

And and the the biggest one, of course, just being like, you don't have to deal with someone else doing a 100,000,000 of tokens of benchmarking traffic at the endpoint when you happen to be trying to serve your users.

Speaker 0

对。

Yeah.

Speaker 0

我觉得有一个很经典的历程。

I think one thing that is that is a classic journey.

Speaker 0

你知道,基本上就是Vibhu在问,当你在浏览器里输入Google时会发生什么。

You know, it's basically Vibhu is asking the what happens when you type Google into the browser?

Speaker 0

工具调用,是不是就是生成JSON,还是说背后还有更复杂的东西?

Tool calling, is that just you're generating JSON, or is there more complication beyond that?

Speaker 0

我们的一些客户,

Certain customers that we have,

Speaker 1

他们有自己的微调模型。

they have their own post trained models.

Speaker 1

所以他们需要的工具调用,不只是那种解析文件或者查天气之类的。

And so they they demand tool calling that's not just like, you know, Parsifile or, you know, go find the weather.

Speaker 1

而是非常定制化的,必须得做微调才能实现。

It's it's something that's very specific and you have to do post training on this.

Speaker 1

如果模型的后训练做得不好,或者后训练之后的量化处理不够快,模型在读取JSON文件和工具调用时就会很吃力。

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.

Speaker 1

但这并不需要它自己的沙箱环境。

But it doesn't trick it doesn't require its own, like, sandbox.

Speaker 1

并不是说它会利用工具调用来逃出沙箱,或者需要被隔离起来。

It's not like it's going to use that tool calling to, like, escape a sandbox or, like, it doesn't have to be contained.

Speaker 1

它只需要一个普通的专用部署就行。

It can just be a normal dedicated deployment.

Speaker 1

工具调用面临的挑战越来越多地在于,公司想要特定的工具调用,而这在训练上是非常敏感的。

The challenge with tool calling more and more seems to be that the companies want certain tool calling, which which is a very sensitive thing to train.

Speaker 1

而且因为你要处理所有的JSON输出,如果它没有以某种特定的方式结束请求,你最终会得到一个执行了工具调用和思考的模型。

And because you're dealing with all of the JSON outputs, if it doesn't, like, close the end of the request in a very certain manner, you end up with the model that did the tool calling and, like, the thinking.

Speaker 1

结果就是,它没有看到结果,而是在解码过程中直接幻觉出了结果。

And so as a result of that, it didn't see the result and just hallucinated the result as it decoded.

Speaker 1

这似乎是工具调用中最棘手的问题,而不是沙箱本身。

That seems to be the the most challenging thing with tool calling, not really the sandboxes more.

Speaker 2

对。

Yeah.

Speaker 2

这是训练方面的一个挑战。

That's a challenge on the training side.

Speaker 2

然后在推理方面,你可以做一些工作来限制可能的输出范围。

And then on the influence side, there's work that you can do to scope the possible output.

Speaker 2

所以我们在差不多两年前就发布了这个问题的解决方案,基本上就是做一个状态机,用它来把输出限制在特定格式内。

So we published this actually at this point close to two years ago, the 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.

Speaker 2

这就是结构化输出问题。

So this is the structured output problem.

Speaker 2

如果你还记得之前提到的……对。

If you remember back in Yeah.

Speaker 2

这个特定的语法

This specific grammar

Speaker 0

是的。

is Yeah.

Speaker 0

GLM 也有这个功能。

GLM had this thing.

Speaker 2

对。

Yeah.

Speaker 2

所以这就像老派的做法,比如确保只输出 JSON,只返回 JSON,或者我奶奶会设计类型语法?

So it's it's like the the old school, like, make sure this is only JSON, return only JSON, or my grandma's gonna design type grammar?

Speaker 0

在某个时候,他们发布了一个东西,就像,是的。

At some point in opening, had released a thing that was like, yeah.

Speaker 0

如果你想限制输出,就写 BNF 语法作为规范。

If you wanna constrain your output, write BNF grammar back as nor.

Speaker 2

在我们的推理系统中,它只是一个指定的输出格式,然后你就能保证输出会按照那个格式来结构化。

In our inference system, it's just a, yeah, specified output format, and and you get the the guarantee that your output's gonna be structured along that format.

Speaker 2

所以把它应用到工具调用上,可以帮助减少问题,显然你仍然可以调用长工具或者不调用工具。

And so applying that to to tool calls can, like, help cut down on obviously, you can still call the long tool or call no tool.

Speaker 2

这并不能解决确定性的问题,但至少解决了工具调用中的输出结构化问题。

It doesn't solve the the certainty problem, but it at least solves the output structuring problem within tool calls.

Speaker 0

而MCP只是工具的另一种形式。

And MCP is just another form of tool.

Speaker 0

对吧?

Right?

Speaker 0

是的。

Yeah.

Speaker 0

这里没有什么特别的东西。

There's no special thing there.

Speaker 2

我经常跟人解释的是,LLM实际上并不能做任何事情。

The thing I'm always, like, explaining to people is the LLM is actually not capable of doing anything.

Speaker 2

它只能提出建议,告诉你该做什么。

It's only capable of making suggestions of what to do.

Speaker 2

然后,如果这些建议以某种格式呈现,并应用到知道如何处理它们的系统中,那么行动就会发生。

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.

Speaker 3

对。

Yeah.

Speaker 3

有趣的是,这个问题在工具调用之外也能解决。

Part of the fun stuff is, you know, this is solved outside of tool calling too.

Speaker 3

比如在智能体循环中,如果输出不正确,或者推理中的工具调用出了问题,它就会说,哦,我不知道该怎么办。

Like, in an agent loop, if the output is not correct or you're right, like reasoning tool calling was done in the reasoning, it'll just be like, oh, I don't know what to do.

Speaker 3

让我再试一次。

Let me just try again.

Speaker 3

而且,你知道,试几次之后可能就成功了。

And, you know, it might get there after a few tries.

Speaker 3

关于你提到的训练问题,有时候在小模型上更难,所以当你从大模型换成小模型时,输出质量就不一样了。

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 big model.

Speaker 3

对吧?

Right?

Speaker 0

对。

Yeah.

Speaker 0

我想说,在我们深入推理工程之前,我本来以为会有东西取代JSON,因为JSON流式输出很困难。

I I will say that before we I 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.

Speaker 0

因为JSON必须是完整的,括号什么的都得闭合。

Because JSON must be complete, and you must have opened and closed brackets and everything.

Speaker 0

所以在流式传输的时候,很难去解析或者验证内容。

So it's hard to parse something or validate something while it's being streamed.

Speaker 0

所以人们发明了各种替代方案,比如我忘了那些名字,但基本上就是类似TOML、YAML这样的东西。

So people invented all sorts of things that are, like I I forget the the name of some of these alternatives, but it's basically something like TOML, something like YAML.

Speaker 0

但JSON好像还是主流。

But JSON seems to be dominant still.

Speaker 2

JSON输出其实没那么长。

The JSON outputs aren't that long.

Speaker 2

对吧?

Right?

Speaker 2

虽然理论上可以很长,因为工具调用里包含参数,某些工具可能需要传很长的参数。

Like, I guess you could have a long because tool calls also contain the arguments in them, and and perhaps for a certain tool, you might pass like a very long argument.

Speaker 2

但我觉得一般的工具调用,token数量还是比较少的。

But my impression of the sort of median tool call is that it's a relatively small number of tokens.

Speaker 2

对吧?

Right?

Speaker 2

所以我估计投机采样在处理像JSON这样格式化的内容时,通常表现会相当不错。

So I would expect that speculators are generally fairly good at something as formatted as JSON.

Speaker 2

这样一来,解码步骤就会很快,流式输出的价值就没那么大了,但也许我理解有误。

And so you would have, like, a pretty fast decode step there and and that the streaming wouldn't be as valuable, but may maybe I'm wrong about

Speaker 1

我觉得你还得考虑软件的限制,或者模型要集成的那个系统。如果那个软件是用JSON来做工具调用的,或者你的客户说,我们的软件就是这么工作的,工具接口就是JSON,那你总不能让他们改软件吧,说,这样对模型更好。

I think you're also bounded by the software or that the model is gonna integrate with if the software is built with JSON for the tool calls or if the company that your you know, if your customer says that this is how our software works and our tools are interfaced with JSON, can ask them to, like, you know, change their their software and and say, like, yeah, this is gonna be better for the model.

Speaker 1

但如果是基于网络训练的话,差别应该不会太大。

But, like, with the web training shouldn't be that much of a a difference.

Speaker 1

而且,如果模型输出更多token,可能还更赚钱。

Also, more profitable if it outputs more tokens, probably.

Speaker 0

这取决于你的商业模式。

Depends on your business model.

Speaker 0

你知道,真的要看情况。

You know, it really depends.

Speaker 0

但我要说的是,作为一个经常和AI生成内容打交道的写作者,我确实会尝试从纯文本转向JSON文本,那种非常长的JSON。

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.

Speaker 0

对吧?

Right?

Speaker 0

就像,每个字段里都有段落,因为我是在试着把它结构化。

Like like, there's paragraphs in every field because I'm trying to structure it.

Speaker 0

对吧?

Right?

Speaker 0

我希望你先陈述事实,然后给出观点,再做要点总结,包含日期、实体引用、参考来源,所有这些。

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.

Speaker 0

总之,这些就是我觉得那些真正深入实验结构化输出的人必须关注的事情。

Anyway, so so these are things that, like, I think people who really, really experiment with structural output have to really care about.

Speaker 0

不过,我们还是稍微往上走一层吧。

But let's let's sort of recurs up the stack a little bit.

Speaker 0

在我们开始录音之前,你提到了一件很酷的事情,就是当新的模型提供商发布新模型时,会有很多工程上的推理优化工作要做。

Before we started recording, you actually mentioned something which is really cool, which is that there's a lot of engineering, inference engineering that goes on when a new model provider releases a new model.

Speaker 0

对吧?

Right?

Speaker 0

所以我们叫它GLM 5.2,Kimi K3。

So let's call it GLM 5.2, Kimi K three.

Speaker 0

我之前以为,特别是像GLM 5到5.1再到5.2这种,你们之前已经支持过了。

I had pre previously assumed, especially if it's like, well, g m GLM five to 5.1 to 5.2, like, you know that you've supported them before.

Speaker 0

那工作量还那么大吗?

Is it that much work?

Speaker 1

工作量很大。

It's a lot of work.

Speaker 0

对。

Yeah.

Speaker 0

好的。

Okay.

Speaker 0

所以你看,很多人,你们这些人,每次新模型发布,大家就急着说,哦,Hugging Face支持这个,Fireworks支持这个,Baseten支持这个,我就想,对,当然支持了。

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.

Speaker 0

但这里面到底涉及什么呢?

But what what what goes into that?

Speaker 0

体验是什么样的?

What's the experience?

Speaker 3

我觉得这不仅仅是支持那么简单。

I think it's more than just supported too.

Speaker 3

对吧?

Right?

Speaker 3

这对消费者来说好处很大。

It benefits the consumer a lot.

Speaker 3

比如,我记得在Kimi K 2.5或者GLM-5.2最新版本发布的时候,好像有一场推理速度的竞争。

Like, I think it was with Kimi K 2.5 or GLM-5.2, the latest, there was sort of an inference war.

Speaker 3

对吧?

Right?

Speaker 3

某家服务商每秒能处理90个token。

X provider is at 90 tokens a second.

Speaker 3

第二天就到了150。

The next day we're at 150.

Speaker 3

我,我

I I

Speaker 2

算是用GLM-5.2带起来的。

kinda kick that off with the GLM-five two.

Speaker 2

我写了一篇推文,大概有五十万浏览量。

I wrote a Twitter article about it got like half a million views.

Speaker 2

基于

Based on

Speaker 1

排名第一。

being number one.

Speaker 1

对。

Yeah.

Speaker 1

Artificial Analytics。

Artificial analytics.

Speaker 2

对。

Yeah.

Speaker 2

就是

Which

Speaker 1

天哪。

Oh god.

Speaker 2

让大家都很兴奋,想着,嘿,我们怎么能把基准测试再往前推一点呢?

Got everyone really excited about, hey, how can we, you know, bed bed tracks a little bit further?

Speaker 2

而且,支持一个模型有两种含义:一种是我能用这个模型生成token,另一种是我有这个模型的生产级API。

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.

Speaker 2

做到能用这个模型生成token其实不难。

Getting to the point of I can make a token out of this model is not that hard.

Speaker 2

因为通常开源推理引擎,比如VLM、SGLang这些,维护者或者模型开发者往往会提前收到权重,甚至会合并PR来确保支持。

Because generally the open source influence engines, your VLMs, SGLANGs of the world oftentimes even receive waits ahead of time, maintainers do, or the people making the model merge PRs to ensure support.

Speaker 2

所以大多数情况下,你基本上可以轻松地在标准开源栈上跑起来,不用费太多劲。

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.

Speaker 2

挑战在于,每个推理公司都有自己的专有技术栈。

The challenge is, you know, every influence company is gonna have own proprietary stack.

Speaker 2

有些是开源组件,有些是内部自研的东西。

You know, some open source components, some some in house stuff.

Speaker 2

对于任何特定的模型,总会有一些新的东西需要处理。

And for any arbitrary model, there's going to be some new stuff.

Speaker 2

有时候你运气好,比如从K2.5到K2.6,变化就挺小的。

Sometimes you get lucky, like, k two five to two six was, like, pretty pretty similar.

Speaker 0

对。

Yeah.

Speaker 0

如果我没记错的话,那纯粹是继续预训练。

Was pure continued post train, if I remember correctly.

Speaker 2

即使在这种情况下,还是有一些工作要做。

Even in those cases, there's still stuff you have to do.

Speaker 2

你得重新做量化工作。

You have to redo the quantization work.

Speaker 2

一般来说,这些模型发布时不是NVFP4格式,但我们希望它们能变成NVFP4,以便在Blackwell上达到最佳兼容性。

You're taking the model from generally, these models are not released in NVFP four, and we want them to be in NVFP four for maximum Blackwell compatibility.

Speaker 2

所以我们必须进行量化,并且要校准量化过程,确保不会导致模型智能水平出现任何下降。

So we have to perform that quantization and, you know, calibrate the quantization to make sure that we're not causing any kind of regression in the model's intelligence.

Speaker 2

然后我们还需要训练投机解码器,就像我们之前讨论的那样。

And then we also have to train the speculator as we've talked about.

Speaker 2

一般来说,我们显然有ZDR,也就是模型API上的零数据保留,所以我们并不确切知道用户发送给我们的流量是什么样的。

Generally, we have obviously, we have ZDR, zero data retention on our model API, so we don't know exactly the traffic that people are sending us.

Speaker 2

但我们知道哪些是热门的。

But we know what's popular.

Speaker 2

我们知道编码用例很受欢迎。

We know that coding use cases are popular.

Speaker 2

我们知道智能体用例很受欢迎。

We know that agents agentic use cases are popular.

Speaker 2

所以我们可以获取代表这类流量的公开数据集,并训练通用的投机解码器。

So we can get public datasets that are representative of that kind of traffic and and train general speculators.

Speaker 2

现在说到投机解码器,你需要用基础模型本身来训练它,因为你在用这些特定提示词跑推理时,会从模型里得到隐藏状态,而这些隐藏状态就是用来训练投机解码器的数据。

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.

Speaker 2

所以这个过程需要用到真实的模型权重。

So there's that process which you need the the real model weights for.

Speaker 2

然后当然,还有搭建所有后端基础设施、加载所有东西、进行测试的过程。

And then there's, of course, just the process of, you know, standing up all the infrastructure behind it, loading all the stuff in, testing it.

Speaker 2

而且,当出现一个架构更新的新模型时,我觉得,显然,DeepSeek 的模型通常是最有挑战性的,因为它们有最多新颖的架构设计,模型中的模型。

And then when there's a new model with a newer architecture, I think that, like, obviously, the DeepSeek models tend to be the most challenging as they have, like, the most novel architectural stuff going on, model of a model.

Speaker 2

但每个新模型都有点新东西。

But every new model has something.

Speaker 2

我是说,Kimi K2 有,哦,抱歉。

I mean, Kimi K two had oh, sorry.

Speaker 2

GLM 5.2 有稀疏。

GLM five two had Sparse.

Speaker 2

对。

Yeah.

Speaker 2

那个 DSA。

The the DSA.

Speaker 2

对。

Right.

Speaker 0

那是从 DeepSeek 那边来的。

Which is brought from DeepSeek.

Speaker 2

对。

Yeah.

Speaker 2

对。

Yeah.

Speaker 2

而且,你知道,我们……所以你

And and, you know, we So you

Speaker 0

可以直接复制粘贴到里面。

can copy paste in there.

Speaker 1

知道这是怎么运作的。

Know how this works.

Speaker 2

你知道吗?

You know?

Speaker 2

所以,我们得在运行时里加入对它的支持。

So, like, we had to, like, build support for that into our runtime.

Speaker 2

你说得对。

And and you're right.

Speaker 2

确实,这些开源实验室互相借鉴的方式真的很有意思。

Like, it actually is really interesting the way that all of these open source labs borrow from each other.

Speaker 2

比如,GLM 5.2 没有视觉功能。

For example, like, GLM 5.2 doesn't have vision.

Speaker 2

所以,我们团队有个叫 Hailey 的,如果我们能看看这个,他基本上是把 Kimi 的视觉编码器嫁接到了 GLM 5.2 上。

So something that Hailey, a guy on our team, if if we could take a look at this, he, like, kind of grafted the Kimi vision encoder onto GLM 5.2.

Speaker 1

我们是在训练投影器吗?

Who are we training the projector?

Speaker 2

没错。

Exactly.

Speaker 2

所以你想一下,编码器这部分,它是负责看图像,然后把图像转换成潜在信息的。

So if you think about, like, the encoder, there's the encoder, which is the part that looks at the image and and turns it into latent information.

Speaker 2

然后还有投影器,

And then there's the projector,

Speaker 0

它有点像那种空间映射。

which kind of like spaces.

Speaker 0

好的。

Okay.

Speaker 2

然后投影器负责把信息映射到模型本身,接着就是模型的权重。

And then there's the projector that that maps it onto the the model itself, and then there's the model weights.

Speaker 2

你不想动模型的权重,因为你希望模型在其他方面保持原有能力,只是为了给它加上视觉功能。

You don't wanna mess with the model weights because you want a chance of making the model demo at something else for the purpose of giving it vision.

Speaker 2

所以,Harry 一开始只用了投影器,那只有几百万个参数。

So instead, Harry started with just a projector, which is only a a handful of millions of parameters.

Speaker 1

我觉得也是。

I would say.

Speaker 1

对。

Yeah.

Speaker 1

你能展示一下训练室吗?

And Can you show the the training room?

Speaker 1

就是,它领悟的方式非常非常好。

Like, the way it grokked is very, very nice.

Speaker 2

也许,阿里,你应该从这里开始讲。

And maybe, Ali, you should you should take it from here.

Speaker 2

你对这个的理解比

You've got a better understanding of this than

Speaker 1

我强。

I do.

Speaker 1

对。

Yeah.

Speaker 1

你可以看到,他训练这个的方式真的非常酷。

You can see, like, he the way he trained this is is really, really cool.

Speaker 1

一开始,就是拿一张山的图片来训练它。

At the beginning, was training it using just like, here's a picture of a mountain.

Speaker 1

你能描述一下这座山里有什么吗?

Can you describe what's in this mountain?

Speaker 1

然后这就导致了第一次的学习损失。

And that caused it just like the first the first, you know, learning loss.

Speaker 1

但你看这里,我们其实只是想教它翻译编码后的内容,它已经用了Kimi K的编码器。

But here, you can see this all we're trying to teach it is to translate the encoded like, it's it's already taken the encoder from Kimi K.

Speaker 1

它已经获取了图像。

It's taken the image.

Speaker 0

对。

Yeah.

Speaker 0

冻结了,冻结了。

Frozen, frozen.

Speaker 1

冻结了,冻结了。

Frozen, frozen.

Speaker 1

用适配器。

With adapter.

Speaker 1

所以理解部分的大脑是冻结的,眼睛也是冻结的。

So the understanding the brain is frozen and the eyes are frozen.

Speaker 1

我们只是试图把两者连接起来。

It's just we're trying to A line interconnect.

Speaker 3

眼睛

The eye

Speaker 1

和大脑,对吧?

and the brain, right?

Speaker 1

所以是投影仪。

So the projector.

Speaker 1

然后你拿这些标记,它就像,你描述这张图片里有什么?

And so you take the tokens and he's like, you describe what's in this image?

Speaker 1

它就说,哦,是座山,或者是一个人,或者是个什么,看情况。

He's like, oh, a mountain or it's a person or it's a human, whatever the case is.

Speaker 1

但这并没有带来完全的理解。

But that didn't cause complete understanding.

Speaker 1

所以他改了方法,让每张图片都关联一组问题。

So he changed it such that every image was associated with a data set of questions.

Speaker 1

比如,这张图片里有没有白人男性?

Like, does this image have a white male?

Speaker 1

这张图片的左上角有没有鸟?

Does this image have birds in the top corner?

Speaker 1

这张图片里有没有科学家?

Does this image have a scientist in it?

Speaker 1

诸如此类。

All that stuff.

Speaker 1

它必须正确回答这些问题。

And it would have to answer questions correctly.

Speaker 1

而且不只是训练它描述图片,还要能回答一个接一个的问题,就像持续问答那样。

And using not just training on describing an image, but being able to answer question answer question answer question like question answer over time.

Speaker 1

你可以看到那种顿悟现象,真的挺不可思议的。

Like you can see the grokking, which is like genuinely insane.

Speaker 1

但把视觉能力加进大型语言模型,它能学到那种程度。

But retrofitting vision into a large LLM can learn to that extent.

Speaker 1

而且即使有些图片它识别得不好,比如你给它一张史蒂芬·霍金的照片,问这是谁?

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?

Speaker 1

它可能答不上来,但会说这是阿尔伯特·爱因斯坦。

Maybe it doesn't get it, but it will say something like this is Albert Einstein.

Speaker 1

它还是能理解个大概。

Like it still understands Close enough.

Speaker 1

作为一个科学家,一个男性,你知道,有重大成就的那种。

As a scientist who is a man who has, you know, done significant achievements, all that stuff.

Speaker 1

所以这真的很酷。

So that's, like, really, really cool.

Speaker 0

对。

Yeah.

Speaker 0

我们之前讲过那篇lava论文的作者,那是很久以前做的,我觉得对于任何没做过视觉工作的人来说,那都是非常基础的工作。

So we've covered before who was the author of the lava paper that did this a while ago, and I think that that's very foundational work for anyone who hasn't done vision work before.

Speaker 3

CLIP和Meta CLIP也是一样,从单纯的图像描述到构建关于图像的问题,性能提升非常明显。

Same with clip and meta clip where you go from just captioning to building out questions about the image and how much better you can get performance.

Speaker 3

对。

Right.

Speaker 3

对。

Right.

Speaker 2

是的。

Yeah.

Speaker 2

但最让人兴奋的是,如果你现在看这样的模型,显然这是

But what's what's so exciting about this is if you look at a model like this now, obviously, this is

Speaker 1

更像一个

a little bit more of

Speaker 2

研究项目。

a research project.

Speaker 2

它没有,你知道,它在MMoV Pro上达到了56%,所以还不太理想。

It's not you know, it it got to 56% on MMoV Pro, I think, so not not quite fun to you.

Speaker 2

但如果你运行这个模型,你的GLM 5.2质量没有任何损失。

But if you're running this model, you haven't suffered any loss on your GLM five two quality.

Speaker 2

如果没有图像,它的行为就和以前完全一样。

If you don't have an image, it'll just behave exactly the way it used to.

Speaker 2

而且

And

Speaker 0

最终在推理代码中,你根本不会包含另一部分。

ultimately In the inference code, you literally do not include the other part.

Speaker 0

对吧?

Right?

Speaker 2

对。

Yeah.

Speaker 2

对。

Yeah.

Speaker 2

我的意思是,如果没有图像输入,你直接跳过编码器就行了。

I mean, you would just skip the encoder if you don't have an image input.

Speaker 0

好的。

Okay.

Speaker 0

就是确认一下。

Just confirmation.

Speaker 3

对。

Yeah.

Speaker 3

整体推理方面有很多。

A lot on the overall inference side.

Speaker 3

比如,你增加的东西不多。

Like, you're not adding much.

Speaker 3

你只是加了一个很小的视觉编码器。

You're adding a very small vision encoder.

Speaker 3

这些通常不到十亿参数。

These are typically, like, less than a billion parameters.

展开剩余字幕(还有 480 条)
Speaker 2

对。

Yeah.

Speaker 2

我的意思是,视觉编码器之间的标准化程度要低一些。

It's I mean, there's a little bit less standardization among vision encoders.

Speaker 2

对。

Yeah.

Speaker 2

所以支持矩阵可能会稍微稀疏一些。

So the sort of support matrix can be a little bit sparser.

Speaker 2

但总的来说,对,它只是整个系统中一个很小的部分。

But overall, yeah, it's it's a pretty it's a pretty minor component of the overall system.

Speaker 2

而且最终,你从这个系统中得到的是,突然之间,你有了Kimi视觉、GLM权重和DeepSeek注意力机制,全部集成在一个模型里。

And 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.

Speaker 2

我认为,这正是开源的力量和美妙之处——你可以把所有这些不同的组件组合在一起,形成一个比任何单独组件都更强大的系统。

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 and combine them together into a system that's better than anyone can be individually.

Speaker 0

人们以前常说,你还可以做Franklin合并,就是从每个模型中提取一些层。

People used to say that you would also do Franklin merges, where you would take like layers from each model.

Speaker 0

现在还有人这么做吗?

Does anyone do that anymore?

Speaker 1

嗯,回到你之前提到的,就是新模型刚出来时支持它需要做的工作,比如GLM-5.2或者Max M3之类的,有时候确实得换掉一些东西。

Well, 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 Max M3 or whatever the case is, sometimes you do have to like you do have to switch out some things.

Speaker 1

比如说,Mini Max M3用的是全注意力机制。

Like for instance, Mini Max M3 had uses full attention.

Speaker 1

在全注意力下,你会遇到一个非常严重的瓶颈,因为你在做

And with full attention, you end up with this, like, insane bottleneck inspector because you're

Speaker 0

做

doing

Speaker 1

自回归生成三个token,而且你要对所有序列中的token做O(n²)的计算。

autoregressive token generation for three tokens, and you're doing this, like, like, o n squared over all of the tokens that are in your sequence.

Speaker 1

你的KV缓存会非常大,因为它不是稀疏的,也不是top-k的。

Your KV cache is like very large because it's not sparse, it's not top k.

Speaker 1

所以我们觉得更好的做法是,嗯,把这个层换成另一个模型里用GQA之类的层。

So we find it better to like, okay, we're gonna replace this, you know, we're gonna replace this layer with a layer from another model that's using like GQA for instance.

Speaker 1

然后只要训练得当,就能让它达到同样的接受率。

And then just with the right training, you can get it to have the same acceptance rate.

Speaker 1

所以从其他模型改造层是完全可行的,而且实际上非常必要。

So it is it is very possible to to retrofit layers from other models and very much needed actually.

Speaker 1

如果某一层效率不高,那训练就成了挑战。

If a layer is like inefficient, the training just becomes the challenge.

Speaker 1

比如,怎么确保训练得当呢?

Like how do you ensure that you train it properly?

Speaker 1

这又回到了之前提到的训练和推理之间的衔接问题。

Which again to earlier point is like the the mesh between training and inference.

Speaker 1

也就是说,要想推理速度快,训练必须非常扎实,我觉得这一点越来越明显了。

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.

Speaker 0

对。

Yeah.

Speaker 0

在支持方面,还有别的吗?比如你说要让它完全达到生产就绪的状态。

Anything else on the support side when you say like get it to fully production ready?

Speaker 2

对。

Yeah.

Speaker 2

我觉得还有一个问题就是,你知道,我们可以对模型进行相当广泛的测试,但我们想尽快推出它,然后你会看到很多人测试它,得到一些有趣的结果。

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.

Speaker 2

GLM 曾经短暂出现过一个问题,就是有些模式崩溃,在某些提示和某些温度下,它会一遍又一遍地输出同一个 token。

There was an issue with 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.

Speaker 2

一旦你把一个接口暴露给真实世界,就会有更多各种各样的输入,这样你就能发现并修复问题。

Like, once you expose an endpoint to to the real world, there's going to be, you know, so many more varieties of of things given to it that that you're able to, you know, discover and and patch things.

Speaker 2

所以这不仅仅是一个上线当天的事情。

So it's not just a, you know, day zero process.

Speaker 2

然后,比如第一周、第一个月,如果模型仍然受欢迎,你既要修复 bug,又要继续推动性能提升,这怎么平衡?

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?

Speaker 2

你是什么意思,你

What do you mean you

Speaker 1

不想让你的模型输出 SSSS 吗?

don't want your model outputting SSSS?

Speaker 1

是

Is

Speaker 0

顺便问一下,那个东西有循环检测吗?

there loop detection on that stuff, by the way?

Speaker 0

这种情况还是经常发生,挺让人意外的。

It still happens, like, quite a lot, which is surprising.

Speaker 1

我们在我们的接口里做了处理,如果模型连续输出完全相同的标记四次以上,我们就直接截断生成,然后说,抱歉,这个应该重试一下。

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 cut the generation and we say like, oh, sorry, this should like try again.

Speaker 1

或者重新处理一下请求。

Or like you reprocess the request.

Speaker 1

因为我们知道,如果连续四次都是同一个标记,那很可能是模型崩溃了。

Because we know then like if it like if it It's four times the same token, it's probably collapsed.

Speaker 0

对。

Yeah.

Speaker 0

有没有办法选择退出,万一我真的想要那种输出呢?

Is there a way to opt out in case I really actually want that?

Speaker 1

没有。

No.

Speaker 1

其实我觉得我们是有办法处理这个的。

Actually think I there's a way that we have to handle it.

Speaker 1

不过我不太确定。

I'm not exactly certain.

Speaker 1

我觉得在某些模型里,比如它们输出表格之类的东西时,会想画12条横线,再画12条横线。

I feel like in certain models, like when they output something like, you can imagine a table for instance, and so they want they want to draw like 12 dashes and 12 dashes.

Speaker 1

对,我觉得这种情况是有办法处理的。

Yeah, I think there's a way for that to happen.

Speaker 1

我觉得我们只对某些特定的标记做这个限制。

I think we only do it on certain tokens.

Speaker 1

比如我们会排除一些特殊字符。

Like we exclude certain special characters.

Speaker 1

对。

Yeah.

Speaker 1

所以我们只在某些特定的情况下这么做,比如最常见的,GLM-5.2。

So we only do it on like certain like like s is the most common almost, GLM-5.2.

Speaker 1

哦。

Oh.

Speaker 1

我觉得DSV4也是这样的吧?

And I think it was d s v four as well?

Speaker 1

就像,你会遇到循环问题,比如它只会输出类似这样的东西。

Like, you'd just have like looping issues where like it would be just something like

Speaker 3

有没有

Is there

Speaker 0

关于s有什么特别的吗?

special something special about s?

Speaker 0

没有。

No.

Speaker 0

只是随机的。

Just so It that's random

Speaker 1

看起来就是它在说话。

seems to be the one talking.

Speaker 1

对。

Yeah.

Speaker 0

而且它只在温度为零的时候,甚至

And it's and it's only temperature zero or even

Speaker 1

在其他温度下呢?

at other temperatures?

Speaker 1

0.9或者别的什么,它还是会崩溃。

Point nine or whatever, it will still it will still collapse.

Speaker 0

那真奇怪。

That's weird.

Speaker 1

说实话,这其实是个推理问题。

It's it's an inference it's an inference problem to be honest.

Speaker 1

就像软件问题一样,比如你用的镜像,NVIDIA有时候会发布一个镜像。

Like a software problem, like oftentimes the image you're on will like NVIDIA will release an image for instance.

Speaker 1

如果我们把他们最新的STLM镜像中的改动合并到我们的技术栈里,就会发现这个问题被修复了。

And if we will upstream the changes from their latest STLM image into our stack, we'll find that it it fixes it.

Speaker 1

或者这种情况经常只出现在你使用的推理引擎里,比如SGLAN。

Or oftentimes this will only happen in an inference engine that you're using like SGLAN.

Speaker 1

但如果你换成VLM,就不会这样。

But if you were to switch to VLM, that isn't the case.

Speaker 1

所以这看起来更像是一个极其不确定的软性问题,而不是模型本身的问题。

So it seems to be like an extremely like nondeterministic kind of soft ratio and not really a model issue.

Speaker 1

不是权重的问题。

It's not like a weights problem.

Speaker 1

比如可以说,这是量化的问题。

Like, be able to say like, it's problem with the quant.

Speaker 1

我们做PTQ的时候搞错了。

We did PTQ wrong.

Speaker 1

对吧?

Right?

Speaker 1

但这说不通,因为同样的权重,用不同的推理引擎,问题就不会重复出现。

But that isn't that doesn't make sense because the same exact weights used with a different inference engine does not repeat the problem.

Speaker 1

有时候是后端用的内核有很细微的竞态条件,如果你把模型部署在一个集群上,可能永远不会遇到这个问题。

And sometimes it's the kernels that are being used in the back end have like these very subtle, sometimes race conditions where if you were to use this model hosted on one cluster, you will never get this problem.

Speaker 0

天哪。

Oh my god.

Speaker 1

但如果你部署在另一个集群上,就会遇到。

But if you host it on a different cluster, you will.

Speaker 1

原因是一个集群里节点间传输KV缓存用的是更慢的互联,而另一个集群的节点间互联更快,所以前者暴露了竞态,后者没有。

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.

Speaker 1

所以最后你就只能想,好吧,这个模型不能部署在这个集群上。

So then you end up just like, okay, this model is not gonna be hosted on this cluster.

Speaker 1

我们会把它部署在另一个集群上,因为那个集群暴露了这个问题。

We're gonna host it on, you know, another cluster because that cluster exposed that problem.

Speaker 1

但最后又会想,那到底是软件的问题吗?

But then it ends up with, okay, is it the software?

Speaker 1

是模型权重的问题吗?

Is it the model weights?

Speaker 1

还是硬件的问题?

Or is it the hardware?

Speaker 3

有个问题,即使温度设为零,结果也不是确定性的。

There is a thing about this with temperature zero still not being deterministic.

Speaker 3

对吧?

Right?

Speaker 3

对。

Right.

Speaker 3

比如说因为硬件的原因。

Let's say because of hardware.

Speaker 3

即使温度为零,嗯。

Even at temperature zero Mhmm.

Speaker 3

同一个模型,你也不总是能得到相同的输出。

Same model, you won't always get the same output.

Speaker 0

对。

Mhmm.

Speaker 0

不过我对那个竞态条件的问题感到惊讶,因为我以为PyTorch是一个图,能保证至少按正确的顺序执行。

Even but I'm surprised by the race condition one because I thought PyTorch was a graph that, like, guarantees that you at least execute things in the right order.

Speaker 1

嗯,那就别这么干。

Well, don't do it.

Speaker 1

我不是说这不好,比如有PDI优化,可以在前一个内核结束之前启动下一个内核。

I guess guess I'm not saying that this is well, have things like PDI optimizations where you can start a kernel before the end of the previous kernel.

Speaker 1

这样做是有原因的,因为确实需要。

And that's because you want to do that because Exactly.

Speaker 1

但执行得不够干净。

But you don't do it cleanly.

Speaker 1

比如,你会让执行过程有一点重叠。

Like, you overlap a little bit of the execution.

Speaker 1

不。

No.

Speaker 1

我觉得很有可能内核本身,就是那个应该在这个时间点运行的块,那个内核本身就有竞态条件。

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.

Speaker 1

比如,缺少一个屏障。

For instance, like a missing barrier.

Speaker 1

通常在设计内核时,如果你想让它非常快,如果没有进行充分的测试,某些线程可能会在数据被其他线程写入之前就从寄存器中读取数据,因为你的屏障或同步机制有问题。

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, for Because like your barrier is wrong or your synchronization is wrong.

Speaker 1

但确实,测试本身在很多情况下都非常困难。

But yeah, like the testing itself is very, very difficult in most like

Speaker 0

而且也没有像借用检查器那样的东西。

And there's no like borrow checker for

Speaker 1

那是什么意思?

What does that mean?

Speaker 0

就像Rust。

Like Rust.

Speaker 0

就像如果你想要内存安全,这听起来是一个类似的问题。

Like that if you're trying to have like memory safety, it sounds like a comparable problem.

Speaker 1

是的,没错。

Well, yes.

Speaker 1

但你现在用的是CUDA,对吧?

But you're working in CUDA, right?

Speaker 1

NVIDIA的GPU就像……

NVIDIA GPU is like

Speaker 0

你只需要一个更高级的语言。

you just need a higher level language.

Speaker 0

就像Modular那样。

It's like modular.

Speaker 0

也许这就是Modular想做的事情。

Maybe that's what modular is supposed to do.

Speaker 0

我不太清楚。

I don't know.

Speaker 3

你觉得怎么保持模型的质量?

How do you see keeping quality of the model?

Speaker 3

你刚才提到了所有这些步骤,比如要做量化、训练自己的投机解码器、在不同硬件上运行。

So you talked about all these steps of, okay, you gotta do quantization, train your own speculative decoder, run on different hardware.

Speaker 3

再看看其他模型提供商,你在消费端掀起了一场推理速度竞赛,那在保持质量不变方面,需要做些什么呢?

Looking at other model providers, okay, you kicked off a inference speed race on the consumer end, what goes into keeping quality the same across them?

Speaker 3

当然。

Sure.

Speaker 3

可以跑基准测试,但你怎么确定量化的标准是多少呢?

Can run benchmarks, but, like, how do you determine how much quantization are the standards?

Speaker 3

实际上,这涉及到什么?

What actually goes into

Speaker 2

关于质量,有几个方面。

There's a few things on quality.

Speaker 2

大多数推理优化都是无损的。

Most inference optimizations are lossless.

Speaker 2

比如KV缓存。

KV caching, for example.

Speaker 2

你只是在避免重复计算相同的值。

You are just recomputing preventing recomputing the same values.

Speaker 2

推测解码当然,如果草稿标记错了,就会被拒绝。

Speculation, of course, if a draft token is wrong, it gets rejected.

Speaker 2

主要的损失性优化是量化。

The main lossy optimization is quantization.

Speaker 2

这真的归结为,第一,数据格式。

And that really comes down to, number one, data format.

Speaker 2

第二,你选择量化模型的哪些部分,哪些层。

Number two, which parts of the model you choose to quantize, which layers.

Speaker 2

第三,对量化后的权重做大量校准,确保你保留了所有的异常值。

And number three, like, doing a lot of calibration on the quantized weights to ensure that you're sort of preserving all the outliers.

Speaker 2

不过还有其他一些技巧。

There's other sort of tricks that you can do though.

Speaker 2

一个重要的就是长上下文。

A big one is long context.

Speaker 2

因为你一开始问的那个问题,就是如果我发送一个20万token的请求会怎么样。

Because one thing you asked at right at the beginning is, oh, what's gonna happen if I send a 200,000 token request in?

Speaker 2

所以很明显,输入序列很长的话,你需要存储更多的信息,处理更多的token。

So obviously, with a long input sequence, you need to, you know, store a lot more information, you need to process a lot more tokens.

Speaker 2

所以即使一个模型有特定长度的上下文,作为推理服务提供商,你可能会选择构建一个上下文更短的API,当然也会有一个完整长度的。

And so even if a model has a context of a certain length, you might, as an inference provider, choose to build an API with a shorter context length, and of course, a full length one as well.

Speaker 2

因为如果用户不需要完整的百万token上下文,比如,你可以给他们提供更好的性能。

Because if someone doesn't need the full million token context, for example, you can get them better performance.

Speaker 2

不确定这算不算模型质量的问题。

Don't know if that's exactly like quality of the model.

Speaker 2

我对质量的理解是,我们多大程度上忠实地还原了原始模型。

The the way that I think about quality is to what degree are we faithfully serving the original model.

Speaker 2

如果你想象一个模型的黄金实现,它完全按照模型设计的方式运行,那么质量就是我们离那个100%保真度有多近。

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.

Speaker 2

当然,你也可以从训练的角度来考虑质量,以及如何超越100%。

You can also, of course, think about quality from the training side and how do you push yourself past a 100%.

Speaker 2

但当我纯粹考虑推理优化时,就是在保持尽可能接近100%保真度的同时,让速度更快。

But when I think about purely influence optimizations, it's getting faster while staying as close to that 100% fidelity mark as as possible.

Speaker 2

当然,我们内部的标准就是,你应该分辨不出我们的API和官方API有什么区别。

And certainly our standard internally is that, like, you should not be able to tell the difference between our API and a, you know, sort of official API.

Speaker 2

我觉得Kimi在这方面做得特别好,他们做了很好的供应商基准测试。

I think Kimi in particular does a good job of vendor benchmarking here.

Speaker 0

对。

Yes.

Speaker 0

他们发布了一个实际的

They released an actual

Speaker 2

供应商基准测试。没错。

vendor Exactly.

Speaker 0

因为他们指责了一些人。

Because they accused some people.

Speaker 0

亚马逊,有个供应商在Kimi的基准测试上表现不太好。

Amazon, there was some provider that was not doing it very well on Kimi's benchmark.

Speaker 1

对。

Yeah.

Speaker 1

所以对于Reflective,它会反映我们……

So with Reflective, would reflect what we

Speaker 3

这是很久以前的事了。

This was a long time ago.

Speaker 3

对吧?

Right?

Speaker 0

不。

No.

Speaker 0

大概三四,

Like like three four,

Speaker 1

五个月前。

five months ago.

Speaker 3

这事也发生在某个模型上,我不记得是哪个了,但他们撤下了不少,然后还专门做了个图表来说明这件事。

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.

Speaker 3

可能是

It might

Speaker 0

吉米供应商验证器。

have been Jimmy Vendor Verifier.

Speaker 1

对。

Yeah.

Speaker 1

因为你会很生气,对吧?

Because you'd be pissed, right?

Speaker 1

比如如果你是……对。

Like if you're Yeah.

Speaker 1

比如如果我是消费者,我用亚马逊的接口,用Kimi,然后我会觉得,天哪,这太糟糕了。

If like if I'm a consumer and I'm using Amazon's endpoint for instance, and I'm using Kimi and I'm like, oh my god, like this is bad.

Speaker 1

我不会说,哦,亚马逊量化模型的方式有问题。

I'm not gonna say, oh, Amazon quantized the model in a bad way.

Speaker 1

我会说,哦,Kimi真差劲。

I'm gonna say, oh, Kimi sucks.

Speaker 1

对吧?

Right?

Speaker 1

所以看起来就是这样。

So it seems like that.

Speaker 0

是的。

Yeah.

Speaker 0

小心点。

Take care.

Speaker 0

小

Take

Speaker 3

心。

care.

Speaker 3

有道理。

Justifiably.

Speaker 0

这可能是个愚蠢的问题,但只是确认一下。

This is probably a stupid question, but just checking.

Speaker 0

量化之后有什么改善吗?

Has anything improved from being quantization?

Speaker 0

比如,量化是不是总是更差?

Like, is quantization always strictly worse?

Speaker 1

嗯,从技术上讲,不是的。

Well, technically, no.

Speaker 1

它是有损的。

It's it's a loss.

Speaker 1

量化是一种有损的实现方式。

Quantization is is a lossy it's it's a lossy implementation.

Speaker 3

速度提升了。

Speed improves.

Speaker 1

显然,第八点,

It obviously, number eight,

Speaker 0

我一直在寻找逆缩放定律。

I always look for inverse scaling laws.

Speaker 0

这是我从Nom Brown那里学到的,就是那些通常朝一个方向起作用的东西,有时候它们会……

This is something I learned from Nom Brown, where, like, things that normally act in one direction, sometimes they

Speaker 2

嗯,严格来说,当你跑基准测试的时候,因为这些模型是非确定性的,有时候你的MPFD四量化版本,你知道的,会比这个版本高出两个基点。是的。

Well, technically, when you run a benchmark, because these models are nondeterministic, sometimes your, you know, m p f d four quant is, like, you know, two basis points higher than your this this one's Yeah.

Speaker 2

没错。

Exactly.

Speaker 2

对。

Yeah.

Speaker 2

这就是为什么我总说在误差范围内。

It's it's it's within that's why I always say within margin of error.

Speaker 2

我其实已经不再这么说了,因为大家都以为我的意思是,在某个误差范围内,我们勉强在最差的那一边。

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.

Speaker 2

所以我们会说,是的,有时候它只是给你一个更高的分数,但就像Ali说的,那是噪音。

So we're saying yeah, sometimes it's just like gives you a higher output score, but like like Ali said, that's noise.

Speaker 2

据我所知,你并不一定能让结果变得更好。

To my knowledge, you're not necessarily making the results better.

Speaker 2

你只是再次尝试,尽量让保真度接近原始模型的百分之百。

You're just trying to, again, like, keep your fidelity as close to a 100% to the original model.

Speaker 1

关于你提到的这一点,我们在MP上做过研究。

There is, to your point, research that we did on MP.

Speaker 1

不知道你能不能找到我们研究实习生Joshua发的一条推文。

I don't know if you are able to pull a tweet with one of our research interns, Joshua.

Speaker 1

我记得那条推文是关于我们量化后的GLM五点二比NVIDIA的好百分之二十。

I think it's a tweet on on how we have 20% better quantized GLM-five point two than NVIDIA.

Speaker 1

基本上,我们在这两个月的研究中发现的是,好吧。

Essentially, what we found throughout, like, this two month research is okay.

Speaker 1

量化是有损的,就是把数据从16位压缩到4位,比如说。

Quantization is is a lossy it's it's you're compressing the data from, you know, occupying 16 bits to occupying, you know, four bits, for instance.

Speaker 1

所以显然会丢失一些信息,你要尽量把损失降到最低。

And so you're obviously losing some information and you're trying to minimize that.

Speaker 1

所以当我说要量化模型时,任务就变成了怎么找到可以量化的层,以及哪些层不能量化。

And so when I say that I'm gonna quantize the model, job becomes how do I find the layers that I can quantize and how to find layers to not.

Speaker 1

比如说,对于图像模型,我不会量化调制层,也不会量化输出投影层,因为这两个层,输出投影是用户看到的,调制层是模型看到或理解的。

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.

Speaker 1

对。

Right.

Speaker 1

没错。

Exact.

Speaker 1

所以我想,关于他的论文,你有没有……我想它没有那个,是的。

And so I guess to his his paper, do you have the I guess it doesn't have the yeah.

Speaker 1

这是一篇很长的论文。

It's a long paper.

Speaker 1

我不知道能不能找到。

I don't know if I can find

Speaker 3

如果有搜索的部分,或者它可能在讨论串里。

If there's a part to search or it's probably in the thread.

Speaker 1

它可能在讨论串里。

It's probably in the thread.

Speaker 1

对。

Yeah.

Speaker 1

但基本上,长话短说就是,量化更多层很可能会让结果更好。比如我有一个模型,量化了第1、5、10层,另一个模型只量化了第1和第2层,那么量化更多信息的那个模型可能表现更好,因为量化误差相互抵消了。

But basically the long and the short is it is very possible that quantizing more of the model makes the results 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 quantize more information is going to perform better because the quantization errors have canceled out.

Speaker 1

所以Joshua在他的数学证明中,用了一个验证器,展示了你可以预测哪些层的量化误差会相互抵消,然后选择量化那些层。

And so what Joshua showed in his mathematic 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.

Speaker 1

这样做的结果是,通过这种数学量化方法,你最终得到的模型比其他提供商的模型量化程度高出20%。

And so the result of doing this mathematical quantization is you end up with a model that's 20% more quantized than another provider.

Speaker 1

所以你能获得20%的额外吞吐量,因为量化的层数更多,比之前运行MDF时更多。

So you get 20% more throughput of it because there's more layers than running an MDF before.

Speaker 1

而且质量也比其他量化模型更好,因为你选择的那些层的误差相互抵消了。

And your quality is better than that other quant because the layers that you chose to quantize have their errors cancel out.

Speaker 1

比如一层偏右,一层偏左,一层又偏右。

Like one layer is skewed to the right, one layer is skewed to the left, one layer is skewed to the right.

Speaker 1

你最终的logit分布更接近模型的原始分布,所以保真度更高。

Your final logit distribution is more similar to the original distribution of the model, so you have better fidelity.

Speaker 1

所以我们是通过KL散度来证明这一点的。

And so the way we proved this was with KL diversions.

Speaker 1

我们不只是看基准测试的分数,而是比较量化模型和原始全精度模型在逻辑分布上的KL散度。

So instead of just scoring on the benchmarks, we scored the KL diversions between the logic distribution of the quantized model and the logic distribution of the original full precision model.

Speaker 1

我们证明了,用这种技术,如果你在逻辑上选择下一个词的概率分布和原始模型更接近,那么你很可能保持对原始模型的忠实度。

And we showed that with this technique, we get if your probability distribution on the logic switch token it wants to select is more of the same as the original model, you're probably gonna end up staying true to the original model.

Speaker 1

所以,对。

So, yeah.

Speaker 1

所以看起来在这之前,行业里的看法是,量化越多,效果越差,因为引入的损失越多。

So it seems like previously before this, it seemed like the industry was, well, the more you quantize, the worse it's gonna be because the more loss you introduce.

Speaker 1

这不一定完全正确。

That's not exactly not necessarily true.

Speaker 1

所以,对,它不会改善,但可以相互抵消。

So, yeah, it doesn't improve it, but can cancel out.

Speaker 3

我觉得这有点像剪枝,你可以剪掉某些层。

I think it might be this, but reminds me a good bit about pruning actually, where you can prune off certain layers.

Speaker 0

对。

Mhmm.

Speaker 3

但非常有意思。

But very interesting.

Speaker 3

没想到你们还专门发了篇论文。

Didn't know this was a whole paper you guys put on.

Speaker 1

这确实是个有趣的事实。

It's a fun fact.

Speaker 1

这篇论文原本有72页,后来我们觉得实在没法……我们真的坐不住。

It was originally 72 pages, this paper, and then we decided we can't We couldn't really sit.

Speaker 1

所以现在变成了45页。

So it's now 45.

Speaker 0

虽然还有39页,但内容非常充实。

Still still 39 pages, but very very substantive.

Speaker 0

我们聊了评估和其他各种事情。

We talked about evals and and all these things.

Speaker 0

那,在提速方面,能做到什么程度呢?

And, like, what's possible in terms of speed up?

Speaker 0

我觉得这可能是大家最关心的问题,而且你在文章里也写了这个。

I guess, like, it's, like, probably, like, the number one thing that people do wanna care about, and it's something that you wrote about in your post.

Speaker 0

比如,官方API是每秒70个token,你把它提升到了90。

Like, official API is 70 tokens per second, and you push it up to 90.

Speaker 0

这是很常见的情况吗?

Is that, like, a normal thing?

Speaker 0

所以,在Influence工作的好处是——

So what's cool about

Speaker 2

我觉得Influence会是一个长期适合做工程的地方,原因是,如果你看看那些高度优化的领域,比如金融,在金融行业,你会用基点来衡量你进步了多少。

working in Influence, the reason that I think Influence 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.

Speaker 2

就像,哦,我进步了5个基点,也就是0.05%。

It's like, oh, I got five basis points better, like, twentieth of 1% better.

Speaker 2

这已经是很大的新闻了,因为一切都优化得很好了。

That's huge news because everything is is so optimized.

Speaker 2

我们发布优化成果时,提升幅度是20%。

When we publish optimizations, it's it's 20%.

Speaker 2

有时是100%。

It's a 100%.

Speaker 0

有时是200%。

It's 200%.

Speaker 2

所以老实说,可能还有很大的提升空间。

So there's still probably, like, a lot further to go, honestly.

Speaker 2

当研究人员开始发表关于某个方面提速1%的成果时,你就会知道这个领域已经基本被研究透了。

Like, you'll you'll know that influence is pretty much solved when researchers start publishing about how they got 1% faster at at something.

Speaker 0

顺便说一句,因为我来自金融背景,在七十年代,做量化金融研究时,那就是当时的利润率。

Which by the way, because I am from the finance background, in the seventies, that was the margin at the time when you did quantitative finance research, you would find

Speaker 1

那20%呢?

And, like, with 20%?

Speaker 1

百分之零点几?

Tens of a percent?

Speaker 1

是的。

Yes.

Speaker 0

对。

Yeah.

Speaker 0

现在呢,

And now it's

Speaker 2

先从小处说起。

tiny first.

Speaker 0

有兴趣的朋友可以去看看安德鲁·洛的论文。

For for those those people interested, look up Andrew Lowe's paper.

Speaker 0

他有一个很有意思的展示,讲的是量化统计套利的收益分布,从七十年代那种20%的差距,一路收窄到今天几乎为零,非常有意思。

He had a really interesting illustration of quant statarb distribution, narrowing down from, like, those kinds of 20% differences in the seventies down to nothing today, which is very cool.

Speaker 0

没错。

Exactly.

Speaker 2

而这正是同类趋势的开端。

And and what the beginning of of the same type of of of thing.

Speaker 2

现在做基准测试很难。

Now benchmarking is hard.

Speaker 2

我想任何人都会这么告诉你。

I think any anyone will tell you that.

Speaker 2

而且,对服务提供商的速度做基准测试也很难,因为涉及太多变量了。

And and benchmarking provider speeds is hard because there's so many variables that go into it.

Speaker 2

你用什么硬件?

What hardware are you using?

Speaker 2

系统负载有多大?

How much load do you have on the system?

Speaker 2

提示词、输入输出序列的具体情况等等,所有这些因素。

What's the exact nature of the prompts and input and output sequence links, all that kind of stuff.

Speaker 2

但总的来说,当你把这些改进叠加起来,你看到的是成倍的提升。

But overall, when you start stacking these improvements, you're looking at multiples.

Speaker 2

最常见的衡量方式当然是TPS,也就是每秒处理的令牌数,这其实是我们行业里一个不太好的叫法,因为实际上有两种每秒令牌数。

You can look at it the 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.

Speaker 2

每秒的吞吐量token数和延迟的token数是两回事,对吧。

There's tokens per second of the throughput number and and the latency Yeah.

Speaker 2

比如,从GPU输出的总每秒token数,这是一个吞吐量指标。

To like, total tokens per second out of the out of the GPU as a throughput number.

Speaker 2

大多数人只关心作为延迟指标的每秒token数,这个我们应该叫ITL,也就是token间延迟,但我们没这么叫。

Most people only care about tokens per second as the latency number, which we should call ITL into token latency, but we don't.

Speaker 2

总之,你可以想象一个标准的API,没有太多优化,针对一万亿参数的模型,在合理的流量下,大概每秒30到50个token。

Anyway, so you can imagine a sort of standard API without many optimizations for 1,000,000,000,000 parameter model operating somewhere in the 30 to 50 tokens per second range for for a reasonable traffic profile.

Speaker 2

我们通常的目标是,你知道的,把它提升10倍。

And we generally see the goal of, you know, pushing to 10 x that.

Speaker 2

但,不一定是一开始就能达到,而是通过叠加足够的优化。

But, you know, not necessarily day zero, but by stacking enough optimizations.

Speaker 2

如果你有,比如说,四个优化,每个都能让性能翻倍——哦,抱歉,是三个优化,每个都能让性能翻倍,然后你把这些叠加起来。

If you have, say, like, four optimizations, each of which doubles performance oh, sorry, three optimizations, each of which doubles performance, then you you stack that up.

Speaker 2

那就是8倍的提升。

That's an eight x gain.

Speaker 2

这就是我们在这个领域里努力达到的数量级。

That's kind of the the order of magnitude that we're working with in this in this space.

Speaker 2

我们追求的是大幅提升性能,而不只是从70提升到90。

We're trying to make things substantially faster, not just go from, like, 70 to 90.

Speaker 0

你是说你们已经做到了吗?

Are you saying you've you you have done that?

Speaker 2

假设一个合理的基准是每秒30到40个token。

So let's say you have, as a reasonable baseline, 30 or 40 tokens per second.

Speaker 2

你可以实现10倍的提升。

You can you can achieve 10 x that.

Speaker 2

比如在GLM 5.2上,如果你想用未量化的模型,甚至是在Hoppers上,而且只是用现成的推理引擎,没有特别的优化,没有投机采样,没有KV路由,也没有分离式推理,那你可能就只能达到每秒30到40个token。

So, like, on GLM 5.2, if you wanna get unquantized, perhaps on hoppers even, and you're just using an off the shelf inference engine with no particular optimizations, no no speculator, nothing nothing extra around, like, KV routing, no disaggregation, you you're probably, yeah, looking at that, like, 30 to 40.

Speaker 2

你觉得这个基准合理吗?

Do you think that's, like, a reasonable baseline?

Speaker 2

对。

Right.

Speaker 2

对。

Right.

Speaker 2

要达到十倍的速度,需要做出很多取舍。

To get to something like 10 x, there's a lot of trade offs that you're making.

Speaker 2

如果我们运行在每秒300到400个token的范围,显然你用的是最好的硬件。

If we're running at sort of more like a 300, 400 tokens per second range, obviously, you are using the best hardware possible.

Speaker 2

你有一个优化过的投机解码器。

You have a optimized speculator.

Speaker 2

你完成了所有的量化工作。

You have done all of your quantization work.

Speaker 2

你的缓存命中率很高。

You are seeing a pretty high cache hit rate.

Speaker 2

你用的是较小的批次大小,并且并行配置是针对延迟和吞吐量调优的,但这是可行的。

You are running with a reasonably small batch size and a parallelism configuration that is tuned for latency versus throughput, but it is possible.

Speaker 2

所以,如果你去 artificial analysis 或者 OpenRouter 上看,从最差的提供商到最好的提供商,往往能达到那个范围。

So these spreads that you see if you, like, go on artificial analysis or you go on OpenRouter and you look at, you know, the the worst provider to the best provider oftentimes can can hit that kind of range.

Speaker 2

十倍当然是非常激进的。

10 x is, of course, very aggressive.

Speaker 2

通常可能只是四到六倍的提升,但真正让我们兴奋的是能获得这些巨大的收益,而不只是从每秒70个token提高到90个。

It's oftentimes maybe more of a four to six times improvement, but that's the 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.

Speaker 1

这也跟硬件有关。

It's also like hardware dependent.

Speaker 1

比如,如果你只是在一个H100节点上提供服务,然后你把模型分片到四个B200节点上。

Like, if you if you obviously have a thing where you're serving it on just like a node of h one hundreds and then you throw like, you you shard the model across like four nodes of b two hundreds.

Speaker 1

你肯定可以通过增加硬件来提升速度,但如果硬件相同、GPU数量相同,那就另说了。

Like 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.

Speaker 2

对。

Yeah.

Speaker 2

那就要看推理优化了,通常能有两到四倍的提升。

Then you're looking at like a two to four x improvement depending on the influence optimizations.

Speaker 2

所以,是的,一部分取决于怎么调用,一部分取决于谁在驱动。

So, yeah, it's some of it's, you know, what's the call, and some of it's who's the driver.

Speaker 3

如果把两到四倍的提升拆开来看,比如说在B200单节点上跑GLM-5-2这个例子。

If you break down the two to four x, say say the example is run GLM-five-two on b two hundreds, single node.

Speaker 3

对吧?

Right?

Speaker 3

为了榨出最后那点性能,投入的精力跟成本相比,到底值不值?大家应该怎么看待这个问题?

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.

Speaker 1

对。

Right?

Speaker 1

光谱量化。

Spectre quantization.

Speaker 3

光谱量化。

Spectre quantization.

Speaker 1

那大概能占到95%的效果。

That's that's like 95%.

Speaker 3

那这能带来多大的提升?

And how far does that get you?

Speaker 3

那对普通人来说,做这件事有多容易呢?

And how how easy is that for the average person to do?

Speaker 3

比如说现在,我想把GLM-5.2的权重放到一个B200的节点上。

So say right now, I wanna throw the weights of GLM-five two on a node of B-two hundreds.

Speaker 3

找到投机解码模型或者已经量化好的模型,有多容易?

How easy is it to find speculative decoder decoder model or already quantized model?

Speaker 3

需要做多少工作?

How much work goes into it?

Speaker 2

如果你从头开始做,那工作量相当大。

If you're doing it upfront, it's quite a lot of work.

Speaker 2

如果现在做的话,已经有人发布过相关的东西,你可以直接拿一些NVFP4的权重。

If you're doing it today, there's going to be people who have published things that you can just you can just grab some NVFP four weights.

Speaker 2

你可以直接拿一个投机模型。

You can grab a speculator.

Speaker 2

对。

Yeah.

Speaker 2

如果我们想想,我们叠加的两个两倍是什么,从BF16到NVFP4,其实不完全是两倍。

If we're thinking about, like, what are the two x's we're stacking, going from b f 16 to NVFP four is it's not quite a two x.

Speaker 2

对吧?

Right?

Speaker 2

我觉得大概是从16位到8位能省30%到40%,然后从8位到4位再省30%到40%。

It's like, I think it's about, like, thirty thirty to 40% from 16 to eight and then another 30 to 40% multiplied from eight to four.

Speaker 2

所以加起来不完全是两倍,但差不多是两倍。

So that doesn't quite get you a two x, but, like, roughly a two x.

Speaker 2

投机解码也差不多是两倍。

Speculate a roughly a two x.

Speaker 2

如果硬件够多,流量也够大,再加上去,又是差不多两倍。

Disag on top of that if you're able to get enough hardware and and put enough traffic through it, another roughly a two x.

Speaker 2

然后再加上一些,你知道的,两位数百分比的提升,因为用了最新的内核之类的,运行效率更好。

And then you add in some, you know, double digit percent increase from having just a a better run time with, you know, the the latest kernels and stuff behind it.

Speaker 2

大概就是这么叠加起来的。

And that that's kind of how it stacks up.

Speaker 2

对。

Yeah.

Speaker 2

所以,构建这些每一个,比如构建量化权重,对于真正懂行的人来说,是几小时到几天的工作,构建投机模型,同样也是几小时到几天,而分布式设置,也是几小时到几天。

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 disag setup, hours to days.

Speaker 2

好吧。

Well, okay.

Speaker 2

一旦你有了它,一旦设置好了。

Once once you have it Once it's set up.

Speaker 2

第一次让分布式工作跑起来,当然,我说的是,确实非常困难。

Once it's Getting disag working for the first time, I'm saying, of course, is is very difficult.

Speaker 1

但是,嗯。

But Mhmm.

Speaker 2

边际实现是,如果你……

The the the marginal implementation is If you're

Speaker 1

只是拿,比如,如果你是一个普通消费者,手头有比如两百张B200,你想知道怎么自己托管,你不需要自己量化模型,对吧?

just grabbing like, if you are a person, just a normal consumer who has access to, like, a note of b two hundreds and you're wondering how can I just host it myself, you don't need to quantize the model yourself?

Speaker 1

总会有开源的量化检查点,如果没人做的话,NVIDIA也会推一个出来。

There's always gonna be, like, an open source quantized checkpoint, and NVIDIA's gonna push one out if no one else does.

Speaker 1

通常,服务提供商会自己训练好的投机模型。

You usually, the providers will have their own spectacle that they've trained as well.

Speaker 1

你不需要自己训练投机模型,直接用他们的就行。

You don't need to train your own SPECT deck, you can just use that as well.

Speaker 2

对。

Yeah.

Speaker 2

比如Kimi,GLM-5.2就有自己的MTP。

Like like Kimi, GLM-five two has its own MTP.

Speaker 2

对。

Right.

Speaker 2

对。

Right.

Speaker 2

很多银行。

Many banks.

Speaker 2

多词预测。

Multi token prediction.

Speaker 0

对。

Yes.

Speaker 0

我就直接用这个,万一我说错了,你懂的。

I'm just gonna use it you in case I get it wrong, you know?

Speaker 3

其实,如果我没记错的话,他们的多词预测可以用于自推测解码。

Actually, you should correct if I'm wrong, their multi token prediction can be used for self speculative decoding.

Speaker 1

这个我还真不确定。

I'm actually not sure.

Speaker 1

我不太

I'm not

Speaker 3

我大概有把握,但可以让人再确认一下。

exactly I'm semi confident in that, but someone can check.

Speaker 3

不过,你知道,这有助于讲清楚一个场景:不只是普通人,比如一家公司想从无服务器推理切换到,我想把这个部署上去,我想租一些GPU,直接跑起来。

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 wanna this up on, I wanna rent some GPUs, throw it up.

Speaker 3

这些步骤能让你比直接放在Veo后面快得多。

These are the steps you take to do significantly faster than just put it behind Veo.

Speaker 3

我是说

I mean

Speaker 0

对。

Right.

Speaker 0

我一直在等有人提到Dynamo。

I was waiting for a mention of Dynamo.

Speaker 0

我觉得那应该是你用来对比的基准。

I feel like that's supposed to be the baseline that you measure against.

Speaker 2

我觉得Dynamo与其说是一个开箱即用的系统,不如说是一个用来构建的工具包。

I would think of Dynamo as less of a sort of out of box system and more of a toolkit for building with.

Speaker 2

所以当我们讨论KV感知路由、KV卸载、PD分离这些话题时,Dynamo基本上——顺便说一下,Dynamo是NVIDIA的一个开源库。

So when we talk about doing KV aware routing, when we talk about doing KV out offloading, when we talk about doing PD disaggregation, Dynamo fundamentally is by the way, Dynamo is an an open source library from NVIDIA.

Speaker 0

我们和Kiely已经完成了那部分。

We we've done that part with Kiely.

Speaker 0

Kiely。

Kiely.

Speaker 2

不错。

Cool.

Speaker 2

所以,这样你的听众就知道了,它支持所有不同的推理框架,而且实际上它支持多种硬件,这挺有意思的。

So so then your your listeners know then that it supports all the different inference frameworks, and it actually is kind of multi hardware, which is interesting.

Speaker 2

但是

But

Speaker 1

它只是一个路由器。

it's just a router.

Speaker 1

它并不是一个优化层。

It's not like an optimizer layer.

Speaker 2

对。

Yeah.

Speaker 2

它所做的就是,Dynamo擅长的是,它是一个库,用于在你的集群和硬件之间移动信息。

All it does like, what Dynamo is good at, it is a library for moving information around your cluster, around your hardware.

Speaker 2

所以如果你有KV缓存放在一个地方,需要把它移到另一个地方,Dynamo会帮你协调Nixle来完成这个移动。

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 to move that around.

Speaker 2

但这并不意味着你直接pip install Dynamo,就能立刻获得巨大的性能提升。

That doesn't mean that, like, out of the box, you just say, you know, PIP install Dynamo, and then you get, like, a massive performance speed up.

Speaker 2

它更像是一个开发者工具包。

It's it's more of a developer toolkit.

Speaker 0

对。

Yeah.

Speaker 0

我觉得它自带一套默认配置,你可以替换掉。

I would have said it would it it comes with a set of defaults that you can then swap out.

Speaker 2

确实。

It does.

Speaker 2

如果整个行业都标准化地部署这些,那它应该算是一个可信的基准。

If the industry at large, I think, was, like, rolling out all of these deployments standard, then I think it would be, like, a a credible baseline.

Speaker 2

但我们有我们自己的基准,对比的是实际运行中的情况。

But we've got a we've got a benchmark against, like, what we're seeing in the wild.

Speaker 0

我还想再多聊一点关于PD分离的内容,因为那可能排在量化之后,位列第三,仅次于量化和投机解码。

I did wanna talk a little bit more about PD dis disag because that's probably, like, number three after quantized and speculative decoding.

Speaker 0

在你的书里,我本来想直接翻到那本书的。

In your book, though I was just gonna pull out the book.

Speaker 0

对。

Yeah.

Speaker 0

比如,5.2.2讲的是美杜莎,5.2.3讲的是鹰。对。

Like, five two two on Medusa, five two three on Eagle Yeah.

Speaker 0

5.2.4讲的是NNI。

Five two four on n n I

Speaker 2

我想5.5应该就是讲分离了。

guess it's five five would be would be disaggregation.

Speaker 0

嗯,不是。

Well, no.

Speaker 0

我只是想多谈谈另一个话题。

I just wanted to dwell a little bit on the other.

Speaker 0

那你选择收录哪些内容呢?

Like, so what do you choose to include?

Speaker 0

哪些内容你又选择不收录?

What do you choose to not include?

Speaker 0

因为我觉得还有其他很多技术吧。

Because there was all these other techniques, I guess.

Speaker 0

对。

Yeah.

Speaker 0

这些技术现在还适用吗?

Are these still relevant?

Speaker 0

因为我觉得它们大概是差不多一年半前出来的。

Because I think they came out, like, a year and a half ago maybe.

Speaker 0

Medusa已经挺老的了。

Medusa is quite old.

Speaker 2

是的。

Yeah.

Speaker 2

美杜莎确实很老了。

Medusa is old.

Speaker 3

但书里有没有把它当作一个基准,就是标准模型的基线?

But is it in the book as a good, here's the baseline for vanilla.

Speaker 3

就像,

Like,

Speaker 0

你应该知道这个。

you should know this.

Speaker 3

比如,去读那篇论文。

Like, read the paper.

Speaker 3

我就说,对。

I'm like, yeah.

Speaker 3

非常有道理。

Makes so much sense.

Speaker 2

是的。

Yeah.

Speaker 2

所以写这本书的时候,我有几个目标。

So with with the book, I had a couple goals.

Speaker 2

一个是给大家提供整个领域的基础词汇,另一个是让大家对每种技术的工作原理有一些直观的理解。

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.

Speaker 2

正如我在AI工程师演讲中提到的,那算是这本书的第一个公开补充,推测这个领域的发展速度比其他所有领域都要快得多。

As I mentioned in 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.

Speaker 2

所以,是的,即使在我写这本书的时候,梅杜莎,我很大程度上是把它作为一种方式,让大家理解这个领域是如何演变的,而不是什么是最现代的技术。

So, yeah, even at the time that I wrote the book Medusa, I very much included as a way for people to understand how the how the space evolved rather than what the most modern technique is.

Speaker 2

现在当然有了deflash、despark。

And now, of course, there's deflash, despark.

Speaker 2

还有比Eagle更新的技术,虽然Eagle仍然很常用。

There's there's newer techniques even than than Eagle, although Eagle is still very commonly used.

Speaker 2

Spec specta?

Spec specta?

Speaker 2

是的。

Yes.

Speaker 2

投机解码。

Speculative decoding.

Speaker 0

什么?

What?

Speaker 0

能

Can

Speaker 1

这是基于一篇论文的,基本上就是在做投机解码。

It's you it's based it's a paper by and it's like it's basically doing speculative decoding.

Speaker 0

嗯哼。

Uh-huh.

Speaker 0

对于投机解码来说。

For the speculative decoding.

Speaker 0

天哪。

Oh my god.

Speaker 1

这其实就是另一种方式,对,这是最重要的解释方式。

It's it's literally just another it's like, yeah, it's the most important way to explain it.

Speaker 1

而且看起来他在那里确实获得了不小的加速,但训练的复杂度,至少在我们看来,几乎和训练Ganzle一样复杂。

And it seems like he got nontrivial speed ups there, but it seems that the complexity with training it's almost like like in our mind at least, it's almost as complex as training Ganzle.

Speaker 1

这就像是一个非常微妙的平衡,而且很多时候你只是稍微调整一下,但这实际上就是投机解码套投机解码。

It's like a very delicate balance, and oftentimes you it's just a little bit, but it's literally speculative decoding on speculative decoding.

Speaker 3

投机。

Speculative.

Speaker 3

对。

Yeah.

Speaker 1

我们看过这篇论文。

We we saw this paper.

Speaker 3

挺有意思的。

It's interesting.

Speaker 3

对吧?

Right?

Speaker 3

我甚至没想到现在训练它会特别有针对性。

I wouldn't even expect it to be very particular to train now.

Speaker 3

对。

Right.

Speaker 3

对。

Right.

Speaker 3

我天真地想,好吧,训练一个投机解码器。

The naive part of me is like, okay, train speculative decoder.

Speaker 1

有道理。

It makes sense.

Speaker 1

投机解码的核心思想就像是,嗯,有点像iPhone的自动更正版,但用在普通模型上。

Like, the whole idea of speculative decoding is you you it's like almost like the iPhone auto protected version but for a normal model.

Speaker 1

对吧?

Right?

Speaker 1

就像你生成三个token,然后说,好,对它们做预填充。

Like, you're just you're just, you know, generating three tokens and you're like, okay, do prefill on them.

Speaker 1

这样你就为原始模型省下了那三个步骤。

And so you save those three turns for your original model.

Speaker 1

现在你的投机解码器要做三轮自回归了。

Now your speculative decoder is doing three turns of autoregression.

Speaker 1

那为什么不干脆用一个更小的模型呢?

So why not just have an even smaller model?

Speaker 0

我觉得吧

I guess

Speaker 3

另一个问题是,投机解码器的规模是多大?

the the other question there is, what are the size of speculators?

Speaker 3

比如说对于GLM——对。

So say for GLM- Right.

Speaker 2

大概十亿到十亿参数左右。

It's like a billion to a billion foot Amadeus.

Speaker 1

比如对于MiniMax,是的。

Like for min max it's it's yeah.

Speaker 1

对。

Yeah.

Speaker 1

就像一层。

It's like one layer.

Speaker 2

通常是原模型的十六分之一。

It's like one sixteenth of the original model, usually.

Speaker 2

对。

Yeah.

Speaker 2

其实我觉得我们回办公室后应该写篇论文。

Actually, I think we should do a paper when we get back to the office.

Speaker 2

投机,投机,投机。

Speculative, speculative, speculative.

Speaker 2

不。

No.

Speaker 1

这看起来像是,什么时候停下来?

It does seem like like how when do you stop?

Speaker 1

但这也像是,比如说,如果你能训练投机解码,对吧,如果你能有一个小模型,它能准确预测中间投机者会预测什么,也能预测原始目标模型会预测什么,那为什么不直接用那个最小的模型呢?

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 is accurately predicts what the intermediate speculator is gonna predict, that is able to predict what the original target model is gonna predict, then why not just use that smallest model directly?

Speaker 1

对吧?

Right?

Speaker 0

这跟路由问题很接近。

This is adjacent to the routing problem.

Speaker 0

对。

Right.

Speaker 0

是的。

Yeah.

Speaker 2

对。

Right.

Speaker 2

关于投机解码,实际使用中的一个限制是,你必须在运行大模型的同一台硬件上运行一个小模型。

The thing with speculators 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.

Speaker 2

这本身就存在一个编排和资源竞争的问题,这也是投机解码普遍面临的一个约束:生成草稿token需要消耗资源,管理起来也增加软件复杂度。

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.

Speaker 2

所以如果你有无限递归的投机解码器,你不仅在训练过程中,在推理引擎的实际实现中也会增加不少这样的复杂度。

And so if you have sort of like infinitely recursive speculators, you add in quite a bit of that complexity on the actual implementation within the inference engine as well, not just in the training process.

Speaker 3

我正想说,不知道能不能做类似的蒸馏和剪枝,你知道的,这其实是一回事。

I was gonna say, would wonder if you could do similar, like, distillation and pruning of you know, it's the same thing.

Speaker 3

它就是个模型。

It's just a model.

Speaker 3

我们能不能直接蒸馏很多权重,量化投机模型,但这超出我的专业范围了。

Can we not just distill a lot of the weights, quantize the speculator, but out of my domain?

Speaker 3

我猜还有个问题,这些都是针对大型服务器工作负载的。

I guess the the question that also comes up is this is all for big server workloads.

Speaker 3

对吧?

Right?

Speaker 3

这些有多少适用于,比如说,这台MacBook?

How much of this applies to, say, have this MacBook.

Speaker 3

我想高效地运行Gemma。

I wanna run Gemma really efficiently.

Speaker 3

是不是类似的问题?

Similar problems?

Speaker 3

不一样吗?

Not the same?

Speaker 2

差别挺大的。

Pretty different.

Speaker 2

几周前我在他的播客上聊过这个话题。

I talked to about this on on his podcast a couple weeks ago.

Speaker 2

数据中心和生产负载的推理工程与本地AI的推理工程之间的区别在于,我们一开始就有根本不同的约束条件和目标。

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, like, different constraints and different goals.

Speaker 2

对于本地AI,问题是:如何把这个模型塞进我的硬件里,然后让它不那么笨?

With local AI, it's how do I fit this model onto my hardware and then make it less dumb?

Speaker 2

而对于数据中心推理,问题是:如何加载这个模型,然后让它不那么慢?

And with data center influence, it's how do I load this model and then make it less slow?

Speaker 2

显然,我们关心的是别太笨,他们关心的是别太慢。

And obviously, you know, we care about less dumb and they care about less slow.

Speaker 2

但我觉得,本地AI的推理工程生态系统,其实有很多地方是数据中心领域可以借鉴的。

But the local AI influence engineering ecosystem, I think, actually has a lot for us to learn from in the data center space.

Speaker 2

他们是各种量化技术的专家,包括动态量化,这些我们在剪枝、蒸馏和层移除方面基本上都不碰。

They are experts in various forms of quantization, including dynamic quantization that we just kind of don't touch in the pruning and the distillation and the, you know, layer removal.

Speaker 1

他们的移除影响不大。

There's Their removal matters less.

Speaker 1

对。

Yeah.

Speaker 1

不。

No.

Speaker 1

那些剪枝,确实。

Those pruning, really.

Speaker 2

对。

Yeah.

Speaker 2

但是,但是,但是有一个令人惊讶的方式,

But but but there's surprising way,

Speaker 0

但那只是为了

but that's to just to

Speaker 2

把东西塞进笔记本电脑里。

fit something on the laptop.

Speaker 2

对。

Right.

Speaker 2

对。

Right.

Speaker 2

是的,我是说,这确实是个有趣的领域。

Yeah, I mean, it's it's a it's an interesting it's an interesting space.

Speaker 2

倒不是说他们的技术对我们数据中心来说一定适用,因为我们显然有不同的资源和目标,但更重要的是,那个领域的过程和开放性确实值得敬佩。

Not not necessarily that, like, 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 the process as well as the openness of that field is is something to, you know, admire.

Speaker 1

是的。

Yeah.

Speaker 1

就像你说的,有些优化技术,比如Turbo Quantum,你肯定听说过,它在网上引起了很大的轰动。

Like, to your point, like, certain optimizations that would like, for instance, turbo quantum sure you've heard, like, it made such huge hype on that.

Speaker 1

然后我们在Twitter上深入讨论了一番,大家都在问,这到底是什么?

And we we did, a whole deep dive on Twitter and they said, what is it?

Speaker 1

它是怎么工作的?

How does it work?

Speaker 1

它到底好不好?

Why is it good or not?

Speaker 1

然后它就火了,而且被用在了本地设备上,因为比如在MacBook上,内存带宽太慢了。

And it took off, and it was implemented on local devices because your memory bandwidth is so slow on like a MacBook for instance.

Speaker 1

但要是把同样的东西放到NVIDIA的B200 GPU上试试。

But try putting the same thing on like an NVIDIA GPU on a B200.

Speaker 1

TurboQuant就不会被用到了。

Turbo quant would not be like it would not be used.

Speaker 1

就像NVIDIA明确表示的那样,这不是一个好的优化。我们亲眼见过,在TurboCon内核里做反量化和量化的开销,实际上比省下的带宽时间要慢得多。

Like NVIDIA made it clear that this is not a good optimization, we've seen it firsthand where the overhead of doing de quantization, quantization of, you know, in the kernel itself, the TurboCon kernel, each into and is actually much, much slower than the time that you save from doing the bandwidth.

Speaker 1

因为在B200上,带宽有每秒3.5TB。

Because on the B200s, you have like 3.5 terabytes per second.

Speaker 1

你根本不需要把存储压缩得那么厉害。

You don't need to decrease the storage that much.

关于 Bayt 播客

Bayt 提供中文+原文双语音频和字幕,帮助你打破语言障碍,轻松听懂全球优质播客。

继续浏览更多播客