TPU top-k 检索基准:官方 approx_max_k 比手写 Pallas 内核快约 11 倍
petrusenko_max · x · 2026-11-24
作者发布了 tpu-retrieval-bench 开源基准,比较 TPU 上精确 top-k 向量检索的多种实现:NumPy float64 参照、jax.jit matmul + lax.topk、blockwise topk、多种 Pallas 融合内核等。
- 基准在免费 Colab TPU v5e-1 上可复现,一条命令跑全部:bash scripts/reproduceall.sh <dir>,检查 recall 并给出 95% 置信区间。
- 在 v5e-1 上的反直觉结论:内置 approxmaxk 在 QPS 上反而比作者手写的最优 Pallas 内核快约 11 倍(sift-128-euclidean N=100 万 D=128 k=10 bf16,approxmaxk 中位 QPS 约 5.6×10⁵,精确内核约 2-4×10⁴)。
- 回答的问题是:手写 Pallas 内核何时能胜过 XLA,何时 XLA 已经够快。方法与规范文档齐备,Apache-2.0 开源。
所属事件:TPU top-k 检索基准实测:XLA 自带内核比手写 Pallas 快 11 倍(2 条相关)→
「Infra」频道最新
- Weaviate 播客 #138:Booking.com 的向量搜索与旅行 Agent 实践 — CShorten30 · 2026-11-24
- Stas Bekman 开源 gpu-straggler-finder:自动揪出拖慢训练的掉队 GPU — StasBekman · 2026-11-24
- 博士生写指南申请欧洲免费算力:两周写作换来 10 万+ GPU 小时 — niloofar_mire · 2026-11-24
- GKE 正式推出 Ambient Networking:无 sidecar 服务网格进入生产 — rseroter · 2026-11-24
- Boom 首次点火原型发动机核心:AI 数据中心涡轮机反哺超音速客机 — ycombinator · 2026-11-24
- 以色列开发者弃 Vercel 迁 Cloudflare:DDoS 打趴全部站点 — aloncarmel · 2026-11-24