summaryrefslogtreecommitdiff
path: root/caffe2/contrib/nccl
diff options
context:
space:
mode:
authorRick Ratmansky <rratmansky@fb.com>2018-10-01 12:09:39 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-10-01 12:22:36 -0700
commit3010dc4208df1d2bd8058cfafeffe645f454595c (patch)
treee5e087f875dd07d5c959f6edda3162862134d5ce /caffe2/contrib/nccl
parentecb3835387e4f5b7f8bfacc1b4d14aeaf687aecd (diff)
downloadpytorch-3010dc4208df1d2bd8058cfafeffe645f454595c.tar.gz
pytorch-3010dc4208df1d2bd8058cfafeffe645f454595c.tar.bz2
pytorch-3010dc4208df1d2bd8058cfafeffe645f454595c.zip
Revert D10123245: Back out "codemod cuda_gpu_id to device_id"
Differential Revision: D10123245 Original commit changeset: d83da8e00a12 fbshipit-source-id: fca91fea58b7df208edc2e218a1d514f9821ec7b
Diffstat (limited to 'caffe2/contrib/nccl')
-rw-r--r--caffe2/contrib/nccl/cuda_nccl_op_gpu.cc4
-rw-r--r--caffe2/contrib/nccl/nccl_ops_test.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/caffe2/contrib/nccl/cuda_nccl_op_gpu.cc b/caffe2/contrib/nccl/cuda_nccl_op_gpu.cc
index ea8b3494c6..4c5313ff4b 100644
--- a/caffe2/contrib/nccl/cuda_nccl_op_gpu.cc
+++ b/caffe2/contrib/nccl/cuda_nccl_op_gpu.cc
@@ -11,7 +11,7 @@ nccl::NCCLExecution getNCCLElements(
// We either do an N-N op, or an N-1 op.
CAFFE_ENFORCE(op->InputSize() == op->OutputSize() || op->OutputSize() == 1);
nccl::NCCLExecution ex;
- ex.stream_gpu_id = context.cuda_gpu_id();
+ ex.stream_gpu_id = context.device_id();
ex.stream = context.cuda_stream();
ex.root = op->template GetSingleArgument<int>("root", 0);
ex.elements.resize(op->InputSize());
@@ -204,7 +204,7 @@ std::pair<std::vector<DeviceOption>, std::vector<DeviceOption>> ncclOpDevInfer(
for (int i = 0; i < def.input().size(); ++i) {
DeviceOption dev;
dev.set_device_type(1);
- dev.set_cuda_gpu_id(i);
+ dev.set_device_id(i);
opt.push_back(dev);
}
return std::make_pair(opt, opt);
diff --git a/caffe2/contrib/nccl/nccl_ops_test.py b/caffe2/contrib/nccl/nccl_ops_test.py
index 7e8a61e9de..f6c22a7d75 100644
--- a/caffe2/contrib/nccl/nccl_ops_test.py
+++ b/caffe2/contrib/nccl/nccl_ops_test.py
@@ -21,7 +21,7 @@ dyndep.InitOpsLibrary('@/caffe2/caffe2/contrib/nccl:nccl_ops')
def gpu_device(i):
device_option = caffe2_pb2.DeviceOption()
device_option.device_type = caffe2_pb2.CUDA
- device_option.cuda_gpu_id = i
+ device_option.device_id = i
return device_option