Independent Researcher Makes TPU Pallas top-k Bitwise Correct and 1.67x Faster
Francis_YAO_ · x · 2026-10-11
Independent researcher Muhan Zhong published a preprint showing that a known Pallas TPU bug — kept on purpose because a fix was deemed too expensive — is both cheap to fix and beatable on speed.
- The bug: calling jax.lax.topk inside a Pallas kernel on TPU returns duplicate indices when inputs contain -inf. Errors go beyond duplicates: 70,706 of 197,592 inputs with special values produce wrong results.
- Cost of correctness: defining correctness via IEEE 754 totalOrder, a bitwise-correct formulation takes only 4.7% more cycles for top-8 of f32[8,128] — the "too expensive" trade-off doesn't hold.
- Going faster: modeling runtime via XLU round-trip latency, issue interval, and elementwise vector instruction count, the author picks formulations per shape — faster than official Pallas on 20 of 25 shapes (geometric-mean 1.67x speedup) and faster than native XLA on all tested shapes.
- For remaining shapes, two algorithms (fold-and-rank and loser-tree merge after full transpose) push coverage to 24 shapes, using instructions not currently reachable from Pallas.
More from Infra
- Amazon Ergo takes open-weights crown: 38 on AA Index, 1.1T params (55B active) — ArtificialAnlys · 2026-12-02
- Jensen Huang warns the US risks repeating its "5G mistake" and losing the AI race to China — TinfoilTricorn · 2026-12-02
- Hyperscaler capex consensus keeps being redrawn upward, now at $1.2T — peterwildeford · 2026-12-02
- Netlify served 54B requests over Black Friday weekend, peaking at 249K rps — thisiskp_ · 2026-12-02
- Rumor: Tencent and ByteDance may have snapped up Envision's Xinghe Phase I, leaving DeepSeek no Huawei 950DT capacity — teortaxesTex · 2026-12-02
- RightNow Mini open-sourced: 729 tok/s on one GPU and 92/100 SWE-bench, zero weight changes — victormustar · 2026-12-02