Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions deepspeed/runtime/zero/stage_1_and_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,9 @@ def reduce_independent_p_g_buckets_and_remove_grads(self, param, i):
self.report_ipg_memory_usage("In ipg_remove_grads before reduce_ipg_grads", param.numel(), param.dtype)
self.reduce_ipg_grads()
if self.contiguous_gradients and self.overlap_comm:
if not get_accelerator().resolves_data_dependency():
self.reduction_stream.wait_stream(get_accelerator().current_stream())
Comment thread
tjruwase marked this conversation as resolved.
get_accelerator().current_stream().wait_stream(self.reduction_stream)
# Swap index between 0 and 1
bucket.index = 1 - bucket.index
self.report_ipg_memory_usage("In ipg_remove_grads after reduce_ipg_grads", param.numel(), param.dtype)
Expand Down