Hacker News new | ask | show | jobs
by Eggpants 44 days ago
I don’t understand what “floating-point math is non-associative” has to do with the random selection of possible result token set after the soft max operation. The weights of the model are set and don’t change during the many matrix operations(which is deterministic regardless of the floating point encoding scheme).
2 comments

The reason GPUs are used for NN computation is that they are massively parallel. You have hundreds or thousands of cores that perform the same operation on different parts of the network.

Tiny variations in the computational environment, such as slightly different set of processes running on the system as well as tiny differences in core temperature or voltage - among many other factors, can cause computations to complete in non deterministic order relative to each other.

This meaning one run eventually calculates a+b+c, whereas another does a+c+b, yielding slightly different results. Those cascade down the chain, resulting, finally, in a different set of produced logits.

Notably, similar effects can and do affect pure CPU calculations on multi core machines, and as a matter of fact even on a single core depending on the architecture when considering eg pipelining, branch prediction etc.

Thus, real world matrix operations are not, in fact, deterministic.

Now, one could argue that all of these are negligible, but that is an empirical claim dependent on the problem at hand.

It depends on the execution order. Model computations can be scheduled differently depending on what else is going on. You need extra effort to guarantee the same order of execution. For example if addition saturates at 8, then 4+5-2 is non-associative.