Finally wrote a blog post about this! Normal LLM inference isn't deterministic across devices, but…
Nathan Barry
Visit on X@nathanrs3.6K followers
16,745 views
Finally wrote a blog post about this! Normal LLM inference isn't deterministic across devices, but this can be fixed.
Floating-point addition isn't associative, (a + b) + c ≠ a + (b + c), and accumulation order changes with the hardware and kernel used, leading to different outputs on the same prompt.
Integer addition is associative, so doing every op in integers (including softmax and norms) gives bit-identical outputs across GPUs and CPUs.
Github repo and post listed in the comments
Comments
Comments from the original post on X (Twitter)
No comments yet
