TensorRace: Verifying Data-Race Freedom of Modern GPU Kernels
GPU kernels are the computational core of modern AI, yet a single data race can silently violate the integrity of training and inference. Formal verification promises data-race freedom, but no existing automated verifier handles asynchronous operations across general kernel inputs. We present TensorRace, the first automated framework to verify data-race freedom of modern GPU kernels. TensorRace builds a happens-before graph of the kernel to capture both synchronous and asynchronous operations as nodes and their orderings as edges. To build the graph soundly and efficiently, TensorRace proposes five well-formedness conditions for kernels. When a kernel satisfies them, TensorRace can soundly order asynchronous operations by comparing their static occurrence counts, without directly reasoning about runtime barrier phases and thread interleavings. TensorRace then proves a kernel race-free by checking with SMT solvers that the happens-before graph orders every pair of conflicting memory operations. We also introduce a series of optimizations for SMT solving precision and efficiency. We mechanize soundness proofs in Rocq and evaluate TensorRace on 345 real-world GPU kernels from four…
- arXiv
- 2612.03145
- Authors
- Ganxiang Yang, Yi Rong, Wei Qiang, Ronghui Gu
- Categories
- cs.PL