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
OpenDAS
fairscale
Commits
d9e6ceaa
Unverified
Commit
d9e6ceaa
authored
Aug 07, 2020
by
Min Xu
Committed by
GitHub
Aug 07, 2020
Browse files
[fix] fix test_oss.py when host have 2 GPUs (#26)
Co-authored-by:
Min Xu
<
m1n@fb.com
>
parent
525e709b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
tests/optim/test_oss.py
tests/optim/test_oss.py
+4
-2
No files found.
tests/optim/test_oss.py
View file @
d9e6ceaa
...
...
@@ -125,7 +125,7 @@ def run_test_step(rank, world_size):
@
skip_if_no_cuda
def
test_step
():
world_size
=
2
world_size
=
min
(
2
,
torch
.
cuda
.
device_count
())
mp
.
spawn
(
run_test_step
,
args
=
(
world_size
,),
nprocs
=
world_size
,
join
=
True
)
...
...
@@ -169,7 +169,7 @@ def run_test_step_with_closure(rank, world_size, optimizer=None):
@
skip_if_no_cuda
def
test_step_with_closure
():
world_size
=
2
world_size
=
min
(
2
,
torch
.
cuda
.
device_count
())
mp
.
spawn
(
run_test_step_with_closure
,
args
=
(
world_size
,),
nprocs
=
world_size
,
join
=
True
)
...
...
@@ -236,6 +236,8 @@ def run_test_collect_shards(rank, world_size, reference_rank):
def
test_collect_shards
():
world_size
=
3
if
torch
.
cuda
.
is_available
():
world_size
=
min
(
world_size
,
torch
.
cuda
.
device_count
())
reference_rank
=
0
mp
.
spawn
(
...
...
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