TPU top-k retrieval benchmark: stock approx_max_k beats hand-written Pallas kernels ~11x
petrusenko_max · x · 2026-11-24
The author open-sourced tpu-retrieval-bench, comparing exact top-k embedding retrieval on TPU across variants: a float64 NumPy oracle, jax.jit matmul + lax.topk, blockwise topk, and fused Pallas kernels.
- Fully reproducible on a free Colab TPU v5e-1 with one command (bash scripts/reproduceall.sh <dir>), with recall checks and 95% CIs.
- Counterintuitive result: on v5e-1, stock approxmaxk beat the author's best hand-written kernel by 11x on QPS (sift-128-euclidean, N=1M, D=128, k=10, bf16; approxmaxk 5.6×10⁵ QPS vs 2-4×10⁴ for exact kernels).
- The repo addresses when hand-written Pallas kernels beat XLA and when XLA is already fast enough, with spec and methodology docs, Apache-2.0 licensed.
More from Infra
- FT op-ed: Jensen Huang's return should not stop tighter US chip controls — Gregory_C_Allen · 2026-11-24
- Startups shift from token maxing to spend optimization as execs lock down pricier models — ditzikow · 2026-11-24
- llama.cpp can now run multiple models at once; dev builds a local 3-model support inbox on Mac — ggerganov · 2026-11-24
- Garry Tan: Ramp card data suggests Jevon's Paradox just broke for AI — usage isn't spiking — garrytan · 2026-11-24
- Dev benchmarks 6 CI runners: GitHub trails on disk speed, Depot queues fastest — DanielLockyer · 2026-11-24
- Config AI claims FPGA compiler runs 'Kimi K3 Nano' at 48,000 tokens/sec — wavefnx · 2026-11-24