Skip to content

Batched and distributed eval (without full determinism feature) #12

Open
TonyChen06 wants to merge 1 commit intoELM-Research:mainfrom
TonyChen06:batchedeval
Open

Batched and distributed eval (without full determinism feature) #12
TonyChen06 wants to merge 1 commit intoELM-Research:mainfrom
TonyChen06:batchedeval

Conversation

@TonyChen06
Copy link
Copy Markdown
Contributor

Adds batched eval and distributed eval options.

Both the process of batching and distributing across GPUs themselves are fully deterministic and produces identical results as single GPU non-batched inferencing. (This is tested for 1-2 gpus, 1-8 batch size, and for ptbqa and instuct45k).

The two sources of nondeterminism are confirmed to be 1. RNG conditions changing when batching which leads to different logit choices for do_sample, and 2. slight bfloat16 calculation imprecisions that become apparent when batching and distributing are done since the GPU conditions slightly change.

The other version of the PR contains a flag called --full_determinism that allows for fully deterministic inference (as in the results across gpu count and batch size will be identical when the flag is enabled). What it does is simply cast bfloat16 into float64 and set do_sample=false. This is not really too efficient for actual use because of the memory costs for float64 but may be nice if you want to confirm the problem is really there yourself.

This version of the same PR doesn't contain this flag and is much simpler. Choose whichever one is preferable.

@willxxy willxxy self-requested a review March 15, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant