Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Efficient bucketing #49

Merged
merged 8 commits into from
Sep 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
One more check
  • Loading branch information
definitelynotmcarilli committed Sep 29, 2018
commit eb697be4aea1762c5e396f3c13cffb8e788e72c9
7 changes: 6 additions & 1 deletion apex/parallel/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,15 @@ def allreduce_params():
def overlapping_backward_epilogue():
torch.cuda.current_stream().wait_stream(self.reduction_stream)

# Sanity check that all the buckets were kicked off
# Sanity checks that all the buckets were kicked off
if self.next_bucket != self.num_buckets:
raise RuntimeError("In epilogue, next_bucket != num_buckets. This probably indicates ")
"some buckets were not allreduced.")

for actual, expected in zip(self.buckets_ready_size, self.bucket_sizes):
if actual != expected:
raise RuntimeError("Some param buckets were not allreduced.")


self.grad_accs = []
for param in self.module.parameters():
Expand Down
2 changes: 1 addition & 1 deletion examples/imagenet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def train(train_loader, model, criterion, optimizer, epoch):
adjust_learning_rate(optimizer, epoch, i, len(train_loader))

if args.prof:
if i > 100:
if i > 10:
break
# measure data loading time
data_time.update(time.time() - end)
Expand Down