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
e4f1dfb6
Commit
e4f1dfb6
authored
May 20, 2023
by
Benjamin Fattori
Browse files
improved warning message for processes < total gpus
parent
80fe11d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+4
-4
No files found.
lm_eval/models/gpt2.py
View file @
e4f1dfb6
...
...
@@ -72,13 +72,13 @@ class HFLM(LM):
if
gpus
>
1
:
accelerator
=
Accelerator
(
device_placement
=
False
)
if
gpus
>
accelerator
.
num_processes
:
warning
=
(
"WARNING: The number of total GPUs does not match the number of spawned processes. "
warning
=
(
"WARNING: The number of total
system
GPUs does not match the number of spawned processes. "
"If you would like to use data parallelism, please launch the script "
"with 'accelerate launch *script*'. "
"Current run will proceed with
single
device."
)
f
"Current run will proceed with
{
accelerator
.
num_processes
}
device
s
."
)
print
(
warning
)
self
.
_rank
=
0
self
.
_world_size
=
1
self
.
_rank
=
self
.
accelerator
.
local_process_index
self
.
_world_size
=
self
.
accelerator
.
num_processes
else
:
self
.
gpt2
=
accelerator
.
prepare
(
self
.
gpt2
)
...
...
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