Graphics processors run specialized small programs called kernels. Tests check only selected inputs, so they can miss bugs in code that appears to work.
LARK uses Lean, a tool that checks mathematical proofs, to show that a kernel matches its reference implementation in PyTorch, a machine-learning software framework. Software agents split the proof into smaller parts, and Lean checks each part against a model of the hardware and operations prepared in advance.
LARK verified nine of ten production kernels and found a data race in the remaining one, where concurrent threads access shared data unsafely. This offers stronger assurance than sampled tests, though the proofs assume exact arithmetic and do not cover real-world rounding.
