From 0c45eab7fffd94169ddda0d61e0613524dbcd8e6 Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Sun, 11 Feb 2018 05:43:55 +0000 Subject: [PATCH] no getmutable nccl_com --- paddle/fluid/framework/executor.cc | 7 +++---- python/paddle/v2/fluid/tests/test_parallel_op.py | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/executor.cc b/paddle/fluid/framework/executor.cc index 5e1358ab0e9..254df564e2f 100644 --- a/paddle/fluid/framework/executor.cc +++ b/paddle/fluid/framework/executor.cc @@ -23,7 +23,6 @@ limitations under the License. */ #include "paddle/fluid/framework/lod_tensor_array.h" #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/reader.h" -#include "paddle/fluid/operators/nccl/nccl_gpu_common.h" // platform::Communicator #include "paddle/fluid/platform/place.h" #include "paddle/fluid/platform/profiler.h" @@ -54,15 +53,15 @@ static void CreateTensor(Variable* var, proto::VarDesc::VarType var_type) { var->GetMutable(); } else if (var_type == proto::VarDesc::PLACE_LIST) { var->GetMutable(); - } else if (var_type == proto::VarDesc::NCCL_COM) { - var->GetMutable(); } else if (var_type == proto::VarDesc::READER) { var->GetMutable(); + } else if (var_type == proto::VarDesc::NCCL_COM) { + // GetMutable will be called in ncclInit } else { PADDLE_THROW( "Variable type %d is not in " "[LOD_TENSOR, SELECTED_ROWS, FEED_MINIBATCH, FETCH_LIST, " - "LOD_RANK_TABLE, PLACE_LIST, READER]", + "LOD_RANK_TABLE, PLACE_LIST, READER, NCCL_COM]", var_type); } } diff --git a/python/paddle/v2/fluid/tests/test_parallel_op.py b/python/paddle/v2/fluid/tests/test_parallel_op.py index 66bb6442af9..7f6d0b8d32e 100644 --- a/python/paddle/v2/fluid/tests/test_parallel_op.py +++ b/python/paddle/v2/fluid/tests/test_parallel_op.py @@ -212,5 +212,5 @@ class ParallelOpTestMultipleInput(BaseParallelForTest): fetch=['fc1.w@GRAD', 'fc2.w@GRAD', 'fc3.w@GRAD']) -#if __name__ == '__main__': -# unittest.main() +if __name__ == '__main__': + unittest.main() -- GitLab