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
c77fa461
"driver/include/conv_common.hpp" did not exist on "8d4607403e42ae0289efc98a392c6964501bc9cf"
Unverified
Commit
c77fa461
authored
May 23, 2023
by
Lintang Sutawika
Committed by
GitHub
May 23, 2023
Browse files
Merge branch 'multigpu-feature' into multigpu-feature-minor-edits
parents
bc103ce2
650d3c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+3
-4
No files found.
lm_eval/models/gpt2.py
View file @
c77fa461
...
...
@@ -72,7 +72,6 @@ class HFLM(LM):
# multigpu support with accelerate
if
gpus
>
1
:
# accelerator = Accelerator(device_placement=False)
accelerator
=
Accelerator
()
if
gpus
>
accelerator
.
num_processes
:
warning
=
(
...
...
@@ -82,9 +81,9 @@ class HFLM(LM):
f
"Current run will proceed with
{
accelerator
.
num_processes
}
devices."
)
print
(
warning
)
self
.
_rank
=
self
.
accelerator
.
local_process_index
self
.
_world_size
=
self
.
accelerator
.
num_processes
self
.
_rank
=
accelerator
.
local_process_index
self
.
_world_size
=
accelerator
.
num_processes
else
:
self
.
gpt2
=
accelerator
.
prepare
(
self
.
gpt2
)
self
.
_device
=
torch
.
device
(
f
"cuda:
{
accelerator
.
local_process_index
}
"
)
...
...
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