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
apex
Commits
7aad54f7
Commit
7aad54f7
authored
Apr 24, 2019
by
Michael Carilli
Browse files
Updating explanation for record_stream
parent
25ac9897
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
apex/parallel/distributed.py
apex/parallel/distributed.py
+3
-4
No files found.
apex/parallel/distributed.py
View file @
7aad54f7
...
@@ -458,10 +458,9 @@ class DistributedDataParallel(Module):
...
@@ -458,10 +458,9 @@ class DistributedDataParallel(Module):
for
buf
,
synced
in
zip
(
bucket
,
unflatten
(
tensor
,
bucket
)):
for
buf
,
synced
in
zip
(
bucket
,
unflatten
(
tensor
,
bucket
)):
buf
.
copy_
(
synced
)
buf
.
copy_
(
synced
)
# Any subsequent operations that we do on tensor after allreduce_bucket returns must
# I think we actually do need this here. After allreduce_bucket returns, tensor will
# be synced on bucket_stream anyway.
# eventually go out of scope and die, at which point it could otherwise be freed for
# Also, we maintain a live reference to the returned tensor in allreduce_buffers.
# further reuse by the main stream while the allreduce/div/unflatten are underway in bucket_stream.
# But this doesn't hurt.
tensor
.
record_stream
(
bucket_stream
)
tensor
.
record_stream
(
bucket_stream
)
# torch.cuda.synchronize()
# torch.cuda.synchronize()
...
...
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