广告公司为什么要做 kernel 优化?
它和 offline infra 有什么关系?
先弄清楚:每个概念是什么
- GPU-hour
- GPU 张数乘以小时数,GPU 的成本按它算。
- Batch inference
- 离线对一大批数据跑模型。没有用户在等结果,只看 throughput,也就是每秒处理多少样本。
- 时间占比
- 这个 kernel 占整个 job 的 GPU time 的比例。kernel 快了能省多少,要先乘上它(见 Amdahl's law)。
- Production trace
- 从生产里录下来的真实输入。
看图:kernel 快一点,怎么变成成本
30 秒回答
Ads models are retrained and run batch inference every day, so a faster kernel turns directly into fewer GPU-hours. Meta's KernelEvolve raised inference throughput of its Andromeda ads model by over 60%, and AlphaEvolve cut Gemini's training time by 1%. Unity's own FlashVector reports 1.1 to 2 times higher throughput on six production models. Offline, I'd optimize throughput, not request latency, take shapes from production traces, gate every kernel swap with regression tests, and re-tune when the GPU generation changes. The gain is the kernel's share of the job times its speedup, so I'd profile first.
四条证据,各自能说明什么
| 来源 | 数字或原话 | 能说明什么 |
|---|---|---|
| Meta KernelEvolve(2026-04 blog) | Andromeda 广告模型的 inference throughput 提升 60% 以上;MTIA 上一个广告模型的训练 throughput 提升 25% 以上。都是自报 | baseline 已经用了 torch.compile 和厂商库,kernel 仍有空间,训练侧也有 |
| AlphaEvolve(DeepMind,2025-05) | matmul 的 tiling heuristic 让 kernel 平均快 23%,Gemini 的训练时间少 1% | 时间占比决定收益。按 1% ÷ 23% 粗算,占比约 4% 到 5%,论文没有给 |
| FlashVector(Unity Vector,2026-09) | 6 个生产模型的 latency speedup 是 1.30–1.98×,throughput 是 1.10–2.00× | Unity 自己在做,范围是整个 serving stack。摘要原话 "Model serving is one of the largest cost drivers in production recommender systems" |
| Unity Q3 2026 earnings call(2026-11-05,第三方文字稿) | CFO 说 Vector 超预期靠三件事,其中一件是 "Major advancements in infrastructure efficiency",还说 gross margin 的提高主要来自 cloud costs 上的 leverage | call 里没有提 agent,把它归因于 FlashVector 是推断 |
前三条讲的是 serving 或别家的训练,Unity 的 offline 训练和 batch inference 用多少 GPU-hour 没有公开数字。
搬到 offline,有四个特点
- 目标是 throughput:没有单次请求的 latency SLO,看 samples/s 和 GPU-hour
- shape 取自 production trace:AlphaEvolve 从 kernel 的用户那里收集真实 shape,一半用来搜索,一半留作评测
- 换 kernel 前过回归测试:先对 reference 查正确性,再看 job 的提升(见 kernel 正确性)
- 换代 GPU 要重新优化:KernelEvolve 同时覆盖 NVIDIA、AMD、MTIA 和 CPU
图里的 kernel 占 GPU time 的 30%,快 2 倍每天省 150 GPU-hour。如果只占 3%,快 2 倍只省 1.5%,很可能分不出它和噪声。
这个循环怎么搬到 data 和 training pipeline,见 offline pipeline 优化。
必答点
- 广告模型每天训练、跑 batch inference,kernel 快了直接省 GPU-hour
- 别家的生产数字:Meta KernelEvolve 60% 以上,AlphaEvolve 训练时间少 1%
- Unity 自己的数字:FlashVector 6 个生产模型 throughput 1.10–2.00×
- 收益等于时间占比乘以提速,先 profile 看占比
- offline 四点:throughput、production trace 的 shape、回归测试、换代 GPU 重新优化
- earnings call 那句不能说成 FlashVector 的功劳
追问
怎么用它回答 "why Unity"?
可以说 "FlashVector already runs this loop in production on serving. I'd like to bring the same loop to offline training and data pipelines, where it saves GPU-hours every day, and I've designed verifiers for RL environments, the hard part of that loop." 公开材料没写 Offline 组已经在做,所以用 I'd like to,不说 you already。
Offline 组和 kernel 有直接的证据吗?
只有一条 JD 线索。一个已关闭的旧版 Offline 岗在要求里列了 "Torch Compilation, Quantization, CUDA, GPU kernel optimization"。本岗的 JD 没有写 kernel 或 agent。
来源Meta Engineering:KernelEvolve(arXiv 2512.23236)· AlphaEvolve · FlashVector(Table 1)· earnings call 文字稿:singjupost、roic.ai · hitmarker:已关闭的旧版 Offline 岗 · ml-八股 08 第 25 题 · 文献笔记 2.3、2.6 节和第 7 节 Q10 · Unity 的证据和同类对照 2.4、3.2 节