Skip to content- Sources: primary
- Summary: Drakeford rebuilt about nine nondeterministic functions in llama2.c, mainly reductions, linear algebra and transcendental math, on a fixed canonical block-dyadic expression tree shared by reduce and scan. Hashed observers matched bit for bit across 13 configurations, and the deterministic AVX-512 build ran about 630 tokens per second on one thread against 133 for the baseline. Correctly rounded math functions and fixed-order FMA chains for matrix multiply kept results identical across CPUs and GPU.
- Why it matters: Reproducible model output across hardware and thread counts is achievable without a speed penalty if you specify the summation order instead of leaving it to the library.
- Background: Floating-point addition is not associative, so parallel or vectorized reductions that regroup terms give results that differ in the low bits. Standard library reduce and transform_reduce allow any grouping, which is why output changes with thread count or SIMD width. Correctly rounded math functions return the infinitely precise result rounded once, so every conforming implementation agrees.