-
Notifications
You must be signed in to change notification settings - Fork 363
Deterministic generations #27
Comments
A lofty goal! Be aware that under the hood llama (and indeed most ANNs) use floating-point, and floating-point determinism is a rabbit hole with no bottom. Some particular issues that come to mind:
See also e.g. rust-lang/unsafe-code-guidelines#237. All told: it's doable, with a fair bit of effort, and has been done before (look up lockstep networking for games - much the same issue). Just be aware that it's not a trivial task, especially if you demand determinism between different machines, not just between different compiles on the same machine. |
I would say, for the time being, determinism given the same hardware and compiler version is a good enough goal. Going beyond that and trying to make things deterministic across different kinds of hardware is probably going to negatively affect performance. |
Aye, agreed with setzer - the primary thing I want is to be able to specify the same parameters on the same machine and get the same results. We can think about offering a "fully deterministic" mode later, but as you've mentioned madness lies that way. |
I think this can be closed since the rest of the work to get determinism is out-of-scope for now 👍 |
Given the same seed and prompt, the same text should be generated. This will require us to implement a deterministic PRNG (instead of using thread_rng), and to allow specifying a seed. This should also assist in benchmarking.
The text was updated successfully, but these errors were encountered: