Skip to content

Commit

Permalink
Revert "Add environment variable to control max win sent length"
Browse files Browse the repository at this point in the history
This reverts commit 833eb3f.
  • Loading branch information
bichengying committed May 18, 2020
1 parent 833eb3f commit a62d785
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
7 changes: 1 addition & 6 deletions bluefog/common/mpi_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <algorithm>
#include <cassert>
#include <thread>
#include <stdio.h>

#include "cuda_util.h"
#include "operations.h"
Expand All @@ -35,11 +34,7 @@ namespace common {
// Due to unclear reason that mpi_put/get/accumlate under the
// mpi_lock epoch cannot send too long vector in one time, we
// define this number as the maximum size of win_ops can send.
static const char* BLUEFOG_MAX_WIN_SENT = std::getenv("BLUEFOG_MAX_WIN_SENT_LENGTH");
static const int MAX_WIN_SENT =
BLUEFOG_MAX_WIN_SENT == nullptr
? 2000
: std::strtol(BLUEFOG_MAX_WIN_SENT, nullptr, 10);
constexpr int MAX_WIN_SENT = 2000;

// MPIController
void MPIController::Initialize() {
Expand Down
3 changes: 0 additions & 3 deletions examples/pytorch_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import torch.utils.data.distributed
from torchvision import models
import bluefog.torch as bf
from bluefog.common import topology_util


# Benchmark settings
Expand Down Expand Up @@ -108,14 +107,12 @@ def forward(self, x):
if args.no_rma:
print("Use neighbor collective")
# This distributed optimizer uses neighbor communication.
bf.set_topology(topology_util.RingGraph(bf.size(), connect_style=1))
optimizer = bf.DistributedNeighborAllreduceOptimizer(
optimizer, named_parameters=model.named_parameters()
)
else:
# This distributed optimizer uses one-sided communication
print("Use win_put ops.")
bf.set_topology(topology_util.RingGraph(bf.size(), connect_style=1))
optimizer = bf.DistributedBluefogOptimizer(
optimizer, named_parameters=model.named_parameters()
)
Expand Down

0 comments on commit a62d785

Please sign in to comment.