Skip to content

Commit

Permalink
Fixed movement of tensors across devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Masahiro Tanaka committed Sep 7, 2021
1 parent 5afb3c0 commit 4b44949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/comm/MPIUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
#include <torch/torch.h>

#include "Common.h"
#include "graph/ir.h"
#include "MPIUtil.h"

namespace {
const int RANNC_TAG_UB = 30000;
}

namespace mpi {
auto logger = spdlog::stdout_color_mt("mpi");

int getRank() {
int rank;
Expand Down Expand Up @@ -59,7 +57,7 @@ int getTagUB() {
//// The above returns different values in different ranks.

return RANNC_TAG_UB;
};
}

void checkMPIResult(int code) {
if (code == MPI_SUCCESS)
Expand Down
2 changes: 1 addition & 1 deletion src/comp/GraphConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ std::unordered_map<std::string, IValueMap> GraphConnector::forward(
// Make sure that copy to cpu has finished
copy_to_cpu_events_[id][first_split].block(stream);

inputs_[id][0] =
inputs_[id][first_split] =
toCUDAIfAvailable(inputs_[id][first_split], true, true);
copy_to_gpu_events_[id][first_split].record(stream);
}
Expand Down

0 comments on commit 4b44949

Please sign in to comment.