Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
8a89b30c
Commit
8a89b30c
authored
Mar 16, 2023
by
Benjamin Fattori
Browse files
empty cuda cache after determing largest possible batch size
parent
97f936be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lm_eval/base.py
lm_eval/base.py
+4
-2
No files found.
lm_eval/base.py
View file @
8a89b30c
...
@@ -268,12 +268,14 @@ class BaseLM(LM):
...
@@ -268,12 +268,14 @@ class BaseLM(LM):
return
batch_size
return
batch_size
batch_size
=
forward_batch
()
batch_size
=
forward_batch
()
print
(
f
"Determined
L
argest batch size:
{
batch_size
}
"
)
print
(
f
"Determined
l
argest batch size:
{
batch_size
}
"
)
adaptive_batch_size
=
batch_size
adaptive_batch_size
=
batch_size
else
:
else
:
adaptive_batch_size
=
override_bs
adaptive_batch_size
=
override_bs
torch
.
cuda
.
empty_cache
()
# empty cache after determining batch size
for
chunk
in
utils
.
chunks
(
for
chunk
in
utils
.
chunks
(
tqdm
(
re_ord
.
get_reordered
(),
disable
=
disable_tqdm
),
self
.
batch_size
if
self
.
batch_size
!=
"auto"
else
adaptive_batch_size
tqdm
(
re_ord
.
get_reordered
(),
disable
=
disable_tqdm
),
self
.
batch_size
if
self
.
batch_size
!=
"auto"
else
adaptive_batch_size
):
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment