Skip to content

Commit

Permalink
sent_neighbors => sent_neighbor
Browse files Browse the repository at this point in the history
  • Loading branch information
bichengying committed May 26, 2020
1 parent 0eb4bec commit 0994a83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/pytorch_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def forward(self, x):

def dynamic_topology_update(batch_idx):
num_out_neighbors = len(bf.out_neighbor_ranks())
sent_neighbors = bf.out_neighbor_ranks()[batch_idx % num_out_neighbors]
optimizer.dst_weights = {sent_neighbors: 1.0}
sent_neighbor = bf.out_neighbor_ranks()[batch_idx % num_out_neighbors]
optimizer.dst_weights = {sent_neighbor: 1.0}


def benchmark_step():
Expand Down
4 changes: 2 additions & 2 deletions examples/pytorch_cifar10_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ def dynamic_topology_update(epoch, batch_idx):
if epoch < 3:
return
num_out_neighbors = len(bf.out_neighbor_ranks())
sent_neighbors = bf.out_neighbor_ranks()[batch_idx % num_out_neighbors]
optimizer.dst_weights = {sent_neighbors: 1.0}
sent_neighbor = bf.out_neighbor_ranks()[batch_idx % num_out_neighbors]
optimizer.dst_weights = {sent_neighbor: 1.0}
if batch_idx % 10 == 0:
optimizer.force_barrier = True
else:
Expand Down

0 comments on commit 0994a83

Please sign in to comment.