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
e2c39426
Unverified
Commit
e2c39426
authored
Jun 28, 2021
by
Mehdi Mirzazadeh
Committed by
GitHub
Jun 28, 2021
Browse files
Fixing memory leak in distributed pipeline (#724)
* Fixing memory lead in distributed pipeline * fix mypy error
parent
681606f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
fairscale/experimental/nn/distributed_pipeline/partition_handler.py
...experimental/nn/distributed_pipeline/partition_handler.py
+10
-5
No files found.
fairscale/experimental/nn/distributed_pipeline/partition_handler.py
View file @
e2c39426
...
...
@@ -273,14 +273,19 @@ class PartitionHandler:
pipeline_record
=
pipeline_record_rref
.
local_value
()
self
.
run
(
pipeline_record
)
result
:
Optional
[
Tensor
]
=
None
if
not
pipeline_record
.
consumers
:
result
=
microbatch
.
gather
(
pipeline_record
.
batches
)
assert
len
(
result
)
==
1
result
=
result
[
0
]
gather_
result
=
microbatch
.
gather
(
pipeline_record
.
batches
)
assert
len
(
gather_
result
)
==
1
result
=
gather_
result
[
0
]
s0
=
current_stream
(
result
.
device
)
if
is_cuda
(
s0
):
# TODO. Investigate why this is needed and remove it if possible.
as_cuda
(
s0
).
synchronize
()
return
result
return
None
# TODO: There seems to be a memory leak that is solved by following line.
# Investigate why is it needed.
del
pipeline_record
.
batches
return
result
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