Chiosa
Machine Learning

Racer checks whether GPU kernel rewrites preserve their function

2 min
Updated

In plain words

GPU kernels are small programs that run calculations on a graphics processor. When developers rewrite one to make it faster, ordinary tests compare outputs for selected inputs, so they can miss unusual cases, hidden memory values, or wrong answers that fall within a tolerance.

The paper introduces Racer, which compares two kernels using expressions that represent possible inputs instead of just trying samples. In a study of 2,408 production kernels, the authors found 82 bugs; Racer automatically exposed 76, while six required manual inspection.

The research

When developers rewrite GPU kernels for speed, how can they check that the new code still computes the same function? Sampled tests compare outputs only for selected inputs and can miss rare cases, hidden memory state, extra writes, or logical errors small enough to fall within a tolerance.

Racer symbolically compares GPU kernels with their references to check whether they compute the same function across possible inputs.

To check that a GPU-kernel rewrite preserves its function, the authors introduce Racer, an engine that symbolically compares a kernel with a reference.

It compares output expressions across possible inputs and tracks memory writes, addressing blind spots in tests that sample inputs and compare declared outputs within a tolerance.

In a study of 2,408 production kernels, the authors found 82 distinct bugs. Racer automatically exposed 76 through diagnostics or output refutations, evidence that the approach can find real defects in this collection, including defects conventional tests missed.

The study covers the collected kernels and tested launch configurations. Racer refused execution for 499 of the 2,408 kernels, and a proof applies only to the outputs and index assignments checked at that configuration.

Analysis

Deep

Next paperHarnessPro improves agent success at lower cost