Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different batch sizes give different results #1645

Closed
sedrick-keh-tri opened this issue Mar 27, 2024 · 1 comment
Closed

Different batch sizes give different results #1645

sedrick-keh-tri opened this issue Mar 27, 2024 · 1 comment

Comments

@sedrick-keh-tri
Copy link

accelerate launch -m lm_eval --model hf --model_args pretrained=mistralai/Mistral-7B-v0.1 --tasks hellaswag --batch_size 1

gives

hf (pretrained=mistralai/Mistral-7B-v0.1), gen_kwargs: (None), limit: None, num_fewshot: None, batch_size: 1
|  Tasks  |Version|Filter|n-shot| Metric |Value |   |Stderr|
|---------|------:|------|-----:|--------|-----:|---|-----:|
|hellaswag|      1|none  |     0|acc     |0.6128|±  |0.0049|
|         |       |none  |     0|acc_norm|0.8110|±  |0.0039|

while

accelerate launch -m lm_eval --model hf --model_args pretrained=mistralai/Mistral-7B-v0.1 --tasks hellaswag --batch_size 16

gives

hf (pretrained=mistralai/Mistral-7B-v0.1), gen_kwargs: (None), limit: None, num_fewshot: None, batch_size: 16
|  Tasks  |Version|Filter|n-shot| Metric |Value |   |Stderr|
|---------|------:|------|-----:|--------|-----:|---|-----:|
|hellaswag|      1|none  |     0|acc     |0.6124|±  |0.0049|
|         |       |none  |     0|acc_norm|0.8106|±  |0.0039|

Here the difference is quite small, but I remember trying some other cases there before where the difference is somewhat big. Why do different batch sizes give different results? Is this the intended behavior?

@haileyschoelkopf
Copy link
Contributor

#1625 has some related discussion!

TL;DR: full determinism on GPUs can be hard! If you see differences in score greater than this or greater than the stderrs, definitely file another issue.

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

No branches or pull requests

2 participants