Skip to content

Commit

Permalink
batch_size with auto defaults to 1 if `No executable batch size f…
Browse files Browse the repository at this point in the history
  • Loading branch information
pminervini authored and wx-zhang committed Mar 13, 2024
1 parent a041c68 commit 14a28ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lm_eval/models/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,13 @@ def forward_batch(batch_size):

return batch_size

batch_size = forward_batch()
try:
batch_size = forward_batch()
except RuntimeError as e:
if "No executable batch size found" in str(e):
batch_size = 1
else:
raise

if self.world_size > 1:
# if multi-GPU, always take minimum over all selected batch sizes
Expand Down

0 comments on commit 14a28ab

Please sign in to comment.