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
cf631de0
"vscode:/vscode.git/clone" did not exist on "0c8e8cce072900d5d29b1ed1a0b43b6dcfbe2bec"
Unverified
Commit
cf631de0
authored
Jul 14, 2025
by
Ankit Gola
Committed by
GitHub
Jul 14, 2025
Browse files
Fix for hang due to mp.Pool in bootstrap_stderr (#3135)
parent
31895e5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
lm_eval/api/metrics.py
lm_eval/api/metrics.py
+10
-12
No files found.
lm_eval/api/metrics.py
View file @
cf631de0
...
...
@@ -505,7 +505,6 @@ def bootstrap_stderr(
if
not
os
.
getenv
(
"DISABLE_MULTIPROC"
):
import
multiprocessing
as
mp
pool
=
mp
.
Pool
(
mp
.
cpu_count
())
# this gives a biased estimate of the stderr (i.e w/ the mean, it gives something
# equivalent to stderr calculated without Bessel's correction in the stddev.
# Unfortunately, I haven't been able to figure out what the right correction is
...
...
@@ -517,17 +516,16 @@ def bootstrap_stderr(
from
tqdm
import
tqdm
print
(
"bootstrapping for stddev:"
,
f
.
__name__
)
for
bootstrap
in
tqdm
(
pool
.
imap
(
_bootstrap_internal
(
f
,
chunk_size
),
[(
i
,
xs
)
for
i
in
range
(
iters
//
chunk_size
)],
),
total
=
iters
//
chunk_size
,
):
# sample w replacement
res
.
extend
(
bootstrap
)
pool
.
close
()
with
mp
.
Pool
(
mp
.
cpu_count
())
as
pool
:
for
bootstrap
in
tqdm
(
pool
.
imap
(
_bootstrap_internal
(
f
,
chunk_size
),
[(
i
,
xs
)
for
i
in
range
(
iters
//
chunk_size
)],
),
total
=
iters
//
chunk_size
,
):
# sample w replacement
res
.
extend
(
bootstrap
)
else
:
res
=
_bootstrap_internal_no_mp
(
f
,
xs
,
iters
)
...
...
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