For context, I’m working on SKaiNET, a Kotlin Multiplatform ML/AI framework, meaning we’re implementing the lower-level machinery ourselves: tensor operations, dtypes, automatic differentiation/gradients and execution across different backends, rather than just building models on top of an existing framework.
For validation, we currently use Pytorch as the reference implementation: tensor results and gradients are calculated there and compared against the Kotlin implementation.
That raised a surprisingly difficult question: how do we decide scientifically whether two numerical results are “the same enough”?
A tiny local difference may be irrelevant, or it may propagate through a computation graph and become significant in the gradients.
This problem is what led me to create NumCrux — an attempt to explore numerical accuracy more systematically than just “pass/fail within epsilon”:
github.com/numcrux
I’d really value feedback from people with numerical/scientific computing experience: what would you measure, and what would make an accuracy model convincing to you?
ULPs, relative/absolute error, conditioning, gradient sensitivity, statistical approaches, reproducibility across hardware or something else?