We present Hawkeye, a system for analyzing and reproducing GPU-level arithmetic operations. Using our framework, anyone can re-execute on a CPU the exact matrix multiplication operations underlying a machine learning model training or inference workflow that was executed on an NVIDIA GPU, without any precision loss. This is in stark contrast to prior approaches to verifiable machine learning, which either introduce significant computation overhead to the original model owner, or suffer from non-robustness and quality degradation. The main technical contribution of Hawkeye is a systematic sequence of carefully crafted tests that study rounding direction, subnormal number handling, and order of (non-associative) accumulation during matrix multiplication on NVIDIA's Tensor Cores. We test and evaluate our framework on multiple NVIDIA GPU architectures ( Ampere, Hopper, and Lovelace) and precision types (FP16, BFP16, FP8). In all test cases, Hawkeye enables perfect reproduction of matrix multiplication on a CPU, paving the way for efficient and trustworthy third-party auditing of ML model training and inference. We provide source code for Hawkeye at https://github.com/badasherez/gpu-simulator.
Figures & tables
Figure 1: Computational graph of the two-stage tensor core accumulation in a pyramid structure. The initial accumulator Ci,j and the first 8 products are summed into an intermediate result, which is then summed with the last 8 products.
Figure 2: Computational graph of Hopper Tensor Core accumulation in a pyramid structure. The initial accumulator Ci,j and the 16 products are summed into the final result
D←C+A⋅B
Algorithm 10 Handling Out-of-Range in BF16
Precision
Architecture
Time (sec.)
std (sec.)
FP16
Ampere
50.8
3.2
FP16
Hopper
47.2
2.5
BF16
Ampere
52.5
2.9
BF16
Hopper
48.2
2.6
FP8
Hopper
40.6
0.6
Table 1: Average execution time (in seconds) and standard deviatation for 4096×4096 matrix multiplication on an Apple M4 Pro CPU, calculated over 10 independent runs.