TensorRace: Verifying Data-Race Freedom of Modern GPU Kernels
Abstract
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 libraries, including components of frontier models such as DeepSeek V4 and Kimi Linear, and common machine learning operators. TensorRace verifies each GPU kernel for NVIDIA Hopper and Blackwell architectures. In verification, we find 12 new harmful races, all confirmed by developers and fixed.
Create a lesson
Related papers
Nothing Is Shared Until You Synchronise: Reinterpreting Java for Data-Race Freedom
Shared title terminologycs.PLLuke Cheeseman, Elias Castegren, David Black-Schaffer et al.
SALTyRN: An End-to-End Tool for Verified and Optimized Neon-to-RVV Kernel Translation
Shared title terminologycs.PLKeagan Chern, Charles Hong, Yakun Sophia Shao et al.
Teal: Verifiable Kernel Compilation through Instruction-Centric Lifting
Shared title terminologycs.PLShriram Chandran, Alexandru Calotoiu, Marcin Copik et al.
Keel: A Verified In-Kernel Proof Checker for Proof Carrying BPF
Shared title terminologycs.PLYalu Cai, Tung-Che Chang, Santosh Nagarakatte
Probabilistic Loop Kernels: Exact Inference and Equivalence
Shared title terminologycs.PLBohan Ma, Mingqi Yang, Mingshuai Chen et al.
ConstraintFlow: Specifying, Verifying, and Executing DNN Certifiers
Shared title terminologycs.PLAvaljot Singh, Yasmin Chandini Sarita, Qiuhan Gu et al.