Reiner Pope(MatX CEO)在 Dwarkesh 的黑板课式访谈里,从几条 roofline 方程一路推到:
Reiner Pope(MatX CEO)在 Dwarkesh 的黑板课式访谈里,从几条 roofline 方程一路推到: 最优 batch size = 300 × sparsity、20ms 的"火车"调度、MoE 必须挤进一个 rack、 Ilya 为什么说 pipelining 不智、RL 时代模型被过度训练 100 倍、Gemini API 价格如…
两个常数 + 几个模型参数,就能算出最优 batch size、最优 context length
为什么 MoE 必须挤进一个 rack?为什么 pipelining "不智"?
Gemini 涨价点 = KV cache 大小;输入便宜 5× = decode 是 memory-bound
为什么 GPT-5 时代模型被"过度训练" 100 倍?三项成本要等
50% 的 CapEx 砸在内存上,可 context length 还是卡在 200K
都靠"搅拌",但目标相反:一个要意义,一个要熵
取 memory bandwidth 和 compute throughput 的 max。
t ≥ max( t_mem , t_compute )
哪边大,就是 bottleneck。
t_mem = N_total/BW + B·L·bytes/BW
t_compute = B·N_active / FLOPs
"We're not perfect here. We can't exactly predict the time, so instead we're going to approximate. We're going to say that the time must be greater than or equal to a certain quantity." — Reiner
把上一页的两个时间都除以 B:
cost-per-token 最终被 compute floor 抠住。
"Eventually the compute time ends up driving the cost. So there is a limiting lower bound on cost." — Reiner
让 weight memory time = compute time:
N_total / BW = B · N_active / FLOPs
整理出 hardware-only 的常数:
FLOPs / BW · (bytes/FLOP) ≈ 300
(A100 → H100 → B100 几乎不变)
B ≥ 300 × (N_active / N_total)
= 300 × sparsity
DeepSeek V3:32/256 个专家激活 → sparsity = 8
B ≥ 300 × 8 ≈ 2,400
实际跑 2–3× 大一点,留余量。
"In DeepSeek I activate 32 out of 256 experts, so this would be 8 for DeepSeek." — Reiner
反直觉:B 只跟 sparsity 走,跟模型大小、跟硬件代际无关。
batch size 是个 model-shape 常数,不是 hardware-scaling 数字。
把 batch size 翻译成时间:选定 B 之后,每 20 ms 发一班车。
最坏情况延迟 = 40 ms
(最多等 20 ms 上车 + 20 ms 跑完)
"The way to think about this is: when does the train depart, as a model?" — Reiner
HBM 容量 ÷ HBM 带宽
= bytes ÷ (bytes/s)
= seconds
Rubin 代:288 GB ÷ 20 TB/s ≈ 15 ms
跨多个 HBM 代际,这个数字一直在 15–20 ms。
一次 forward pass 把整张 HBM "读完一遍"。
权重是只读的,KV 也几乎只读 → HBM 几乎全是 reads
B ≥ 300 × sparsity,配上 20 ms 的训练发车间隔 → 系统单 rack 大约 2,000 × 64 ≈ 128,000 tokens/s
"Gemini is big. One-thousandth of Gemini is a lot. To actually be competitive at scale, you need to be able to serve at least one-thousandth of Gemini."
Traffic pattern = all-to-all
任意 GPU 可能要把 token 发给任意其它 GPU。
NVLink 的 full-mesh 拓扑刚好长得就像 all-to-all。一个 rack 是 MoE 的天然容器。
MoE 跨 rack 灾难:
如果 256 个 expert 摊到 2 个 rack 上,一半 token 想跨 rack → 用慢 8× 的网络 → all-to-all 直接 bottleneck。
结论:一个 rack 限定了一层 MoE 能做多大。
Hopper → Blackwell 主要是 tray → rack 的产品决策。
Blackwell → Rubin 才是真的 4× 物理设计升级。
作者概括: rack 不是"再大一点就行"的问题,是工程上六个变量同时被压到极限。
"Modern racks are pushing all of those to very extreme physical limits." — Reiner
Google 的 TPU 早就有更大的 scale-up domain,所以更大的 sparse 模型早就能装下并 inference 出去。
DeepSeek 的"更细粒度专家"也压低了对 rack 大小的需求。
"You finally have a scale-up on the order of 10-20 terabytes, which is enough for a 5T model plus KV cache."
不同 layer 放到不同 rack 上:
rack 0 → rack 1 → rack 2 → rack 3 → loop。
每个 rack 一直在处理"上一个 batch 留下的中间结果",pipeline 不停。
关键发现:micro-batch 数 = pipeline 阶段数。在 4-rack pipeline 里,至少需要 4 个 micro-batch 才能填满。
inference 里 micro-batch 是"自由参数"。training 里它和全局 batch 不一样,因为得攒够再做 backward。
forward 排完之后必须停下来做 backward
→ 几个 rack 闲置 → "pipeline bubble"。
文献里发明各种调度技巧填这个洞:zero-bubble、one-forward-one-backward 之类。
"You can mine Bitcoin in that bubble."
Reiner 回敬:
"More usefully, you can do the weight gradient step, but you can also mine Bitcoin."
Inference 里没有 bubble:纯 forward,没必要存中间状态等 backward。Pipeline 对 inference 是 capacity 工具,对 latency 完全中性。
每多一阶段,per-GPU 的 weight memory 摊薄一倍。
理论上 4 阶段 → 权重需求降 4×。
每多一阶段,必须同时跑更多 sequence 才能保持 rack 不闲。
"那些 sequence 又各自带自己的 KV cache" → 总量不变。
"First, we established you can't amortize KV caches across batch size. Now we're saying you also can't shard it across pipeline stages. It sucks from both of those points of view." — Reiner
结论:inference 不应该用 pipeline。优先把 scale-up domain 撑大、做 expert parallelism。
如果 pipeline 已经"解决"了容量问题,为什么还要把 rack 越做越大?
答案:带宽。
t_weight = N_total / (k · BW_per_GPU)
↑
k = scale-up size
"It's interesting to me that the best parallelism strategy in practice ends up being one which physically resembles the actual architecture. It's not some galaxy brain thing." — Dwarkesh
"The cutting matches the model architecture." — Reiner
"Hyperscalers are spending 50% of their CapEx this year on memory. … That's high hundreds of billions, maybe a trillion, and they're spending half of that on memory? That is a huge constraint. That's why we're not going to get new laptops and phones this year."
Reiner 给出的解释:rack 大不是为了装得下,是为了读得快。
heuristic: cost = A + B is minimized when A ≈ B.
把训练 / RL / inference 三项 compute 拉平:
6 · N · D_pre ≈ α · 6 · N · D_rl ≈ 2 · N · D_inf
N 全消掉,剩下:
D_pre ≈ D_rl ≈ D_inf
模型生成的总 token 数 ≈ 预训练 token 数。
over-trained relative to Chinchilla
"This is why you should just approximate everywhere, because there are big error bars on this. But it's kind of empowering to just set A equal to B and figure it out." — Reiner
"So for GPT to be trained optimally, every single user who uses GPT-5, the total amount of tokens that they stream should equal the total amount that has gone into pre-training. And the total amount of tokens that have gone into pre-training is the sum of all human knowledge. Each model should generate the sum of human knowledge on the output that it gets on the input."
作者概括:每发布一代旗舰模型,它在被淘汰之前生成的 token 总量大约 = 人类历史上所有文本。
修正项:实际还要打折,因为有 model-family(蒸馏出多个尺寸)+ 失败率(万一不是 frontier 就扔了)。
"Gemini 3.1 is 50% more expensive if you go over 200k tokens than if you're below 200k tokens."
200k 这个折点 = compute time 和 KV-memory time 交叉的位置。
设 200k 是临界点,用前面的 roofline:
bytes/token = N_active / (300 · L_ctx)
≈ 100B / (300 · 200k)
≈ 1,667 bytes ≈ 2 KB
"It's funny that they would leak so much information through their API pricing."
"I mean, you are incentivized to price close to your costs because otherwise someone could scoop you." — Reiner
"The result we want to work towards is that prefill is compute-limited and decode is memory bandwidth-limited." — Reiner
含义:5× 这个数字直接告诉你 decode 离 memory wall 有多近。整个推理经济本质上是被 HBM 带宽勒住的。
为什么 cache hit 便宜 10×?
因为 KV 不需要从 token id 重算,而是已经在某个 memory tier 里坐着。
OpenAI 的 5 分钟 vs 1 小时两档:
"Drain time" = 这层 memory 全跑完一遍要多久。
"I'm kind of shocked to see spinning disk being used at all, because it's such an old technology." — Reiner, 看到 1 小时档时
不是大家不想做,是经济上不划算。
作者概括:sparse attention 已经被 priced in 到当前的 200K,再往上还需要新东西。
"It's because there is no solution to the memory wall here. Going too sparse just means you're attending to a very small subset of the tokens, and the quality will get worse." — Reiner
"There's this idea that Dario said on the podcast, and others have said, which is, 'We don't need continual learning for AGI, in-context learning is enough.' If you believe that, then you have to think that we have to get to a hundred-million-token context length to have an employee that is the equivalent of working with you for a month."
— Dwarkesh
Reiner 的反应:HBM 不会忽然变好。如果 in-context learning 真要替代 continual learning,就需要 100M+ token context,但 memory wall 没有清晰的破解路径。Sparse attention 帮了大忙但远远不够。
→ 这条 AGI 路径上有个实际工程瓶颈,不是研究品味问题。
Reiner 一篇 blog 的核心观察:
两边都在"把信息搅匀"。
但目标完全相反:
small Δinput → small, useful Δoutput
residual + LayerNorm 都是为了"让微分有用"。
field = ℝ(连续)
small Δinput → huge Δoutput
整个 cipher 设计的目标就是抗微分。这就是 differential cryptanalysis 攻击的反面。
field = GF(2)(binary)
Adversarial examples 是两条曲线的交点:图像分类里"加一点点噪声就完全改类"——正是 cipher 想要的 avalanche 在 NN 上变成了 bug。
给定一个不可逆函数 f,用两路输入做成可逆操作:
(x, y) → (x, y + f(x))
反向:y = z − f(x),因为 x 直接读出。
是 DES / Twofish 等几十年密码学的基础组件。
把这个 trick 套到 transformer layer 上 → 整个网络可逆。
RevNets 用 compute 换 memory;KV cache 用 memory 换 compute。下一页把这类权衡都摆出来。
"Spending more memory to save compute is generally profitable given where hardwares are." — Reiner
→ 在 2026 年的硬件比例下,memory 一直是 cheaper side of the trade.
"It's shocking how much you can deduce about what the labs are doing from a handful of equations, public API prices, and some chalk."
"If you do not batch together many users, the cost and the economics you get can be a thousand times worse than if you do batch many users together."
"Pipelining is a massive hassle, but it does give you some benefits. … We're just moving the memory time from one chip to another chip. There's no actual benefit in runtime."
"Pipelining totally solves the capacity problem, but scale-up size helps solve the bandwidth problem."
"Billions of dollars worth of compute just flowed in the other direction."
"It's kind of empowering to just set A equal to B and figure it out."
"You are incentivized to price close to your costs because otherwise someone could scoop you."
"There is no solution to the memory wall here."
Reiner Pope · MatX CEO · ex-Google TPU
Dwarkesh Podcast · "How GPT, Claude, and Gemini are actually trained and served"