Google 用模糊测试和智能体集群验证 XLA:TPU 编译器正确性
XLA from the Trenches: Correctness on TPU Workloads at Scale
Google 公开了怎么给 XLA 编译器找 bug:模糊测试加智能体集群自动写测试、复现、修,已抓出 142 个 bug,做 TPU 训练的值得看。
arXiv 论文介绍 Google 验证 XLA:TPU 编译器的方法论,针对多层级优化可能引发的数值退化与内存损坏问题。团队结合合成程序生成与真实生产 trace 进行模糊测试,并用 AI 智能体集群自主生成压力测试、复现故障和起草修复。配套的分层差分管线可将大图二分定位到融合内核内的单个出错算子。该框架已在生产环境解决超过 142 个编译器 bug,另有 103 个发现待审。
XLA from the Trenches: Correctness on TPU Workloads at Scale
Accelerating modern foundational models has pushed domain-specific compilers toward increasingly complex, multi-tiered optimization pipelines. However, this heavy optimization focus introduces delicate tradeoffs between peak execution performance and correctness. Subtle codegen defects can trigger numerical degradation and memory or buffer corruption, invalidating multi-million-dollar training runs and degrading live serving quality without raising obvious compiler errors. In this paper, we present a battle-tested methodology for verifying and triaging Google's XLA:TPU compiler at hyperscale. We leverage fuzzing techniques, combining synthetic program generation with real production traces, while orchestrating AI agent swarms to autonomously generate stress tests, reproduce failures, and draft fixes. To pinpoint root causes in full workloads, we pair this with a hierarchical differential pipeline that bisects large graphs down to individual failing operations inside fused kernels. Deployed in production, our framework has already driven the resolution of over 142 compiler bugs (with 103 additional findings under review), from which we distill pragmatic lessons learned.