Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
ba367d39
Unverified
Commit
ba367d39
authored
Nov 18, 2020
by
Benjamin Lefaudeux
Committed by
GitHub
Nov 18, 2020
Browse files
[fix] Reverting a change which slipped in #188 (#198)
* reverting a change which slipped in #188
parent
a842a927
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
benchmarks/pipe.py
benchmarks/pipe.py
+1
-2
fairscale/nn/pipe/pipe.py
fairscale/nn/pipe/pipe.py
+4
-1
No files found.
benchmarks/pipe.py
View file @
ba367d39
...
@@ -685,8 +685,7 @@ parser.set_defaults(pipelined_backward=True)
...
@@ -685,8 +685,7 @@ parser.set_defaults(pipelined_backward=True)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
bench_multi_process
(
args
,
all_at_once
=
True
)
# bench_multi_process(args, all_at_once=True)
if
args
.
no_mpi
or
"OMPI_COMM_WORLD_RANK"
not
in
os
.
environ
:
if
args
.
no_mpi
or
"OMPI_COMM_WORLD_RANK"
not
in
os
.
environ
:
print
(
f
"Running benchmark with args:
{
args
}
"
)
print
(
f
"Running benchmark with args:
{
args
}
"
)
bench_single_process
(
args
)
bench_single_process
(
args
)
...
...
fairscale/nn/pipe/pipe.py
View file @
ba367d39
...
@@ -736,7 +736,10 @@ class Pipe(Module):
...
@@ -736,7 +736,10 @@ class Pipe(Module):
from
.phony
import
get_phony
from
.phony
import
get_phony
phony
=
get_phony
(
torch
.
device
(
torch
.
cuda
.
current_device
()
if
torch
.
cuda
.
is_available
()
else
"cpu"
),
requires_grad
=
True
)
phony
=
get_phony
(
torch
.
device
(
torch
.
cuda
.
current_device
()
if
torch
.
cuda
.
is_available
()
else
"cpu"
),
requires_grad
=
True
,
)
output
=
PipelinedBackwardPass
.
apply
(
output
,
batches
,
phony
,
True
)
# self.retain_graph)
output
=
PipelinedBackwardPass
.
apply
(
output
,
batches
,
phony
,
True
)
# self.retain_graph)
else
:
else
:
output
=
microbatch
.
gather
(
batches
)
output
=
microbatch
.
gather
(
batches
)
...
...
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