From 8d04d0e2a372e2914530f852b1dafa8f1adc093d Mon Sep 17 00:00:00 2001 From: "yi.wu" Date: Tue, 26 Jun 2018 20:30:16 +0800 Subject: [PATCH] update --- paddle/fluid/framework/parallel_executor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 485d89aa5..b53a6f43f 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -166,7 +166,7 @@ void ParallelExecutor::BCastParamsToGPUs( void *buffer; if ((initializing && i == 0) || - (!initializing && i == static_cast(var_dev_id))) { + (!initializing && static_cast(i) == var_dev_id)) { buffer = const_cast(main_tensor.data()); } else { auto local_scope = member_->local_scopes_[i]; @@ -187,7 +187,7 @@ void ParallelExecutor::BCastParamsToGPUs( platform::dynload::ncclBcast(buffers[i], numel, data_type, 0, nccl_ctx.comm_, nccl_ctx.stream()); } else { - if (static_cast(var_dev_id)) { + if (var_dev_id >= 0) { platform::dynload::ncclBcast(buffers[i], numel, data_type, var_dev_id, nccl_ctx.comm_, nccl_ctx.stream()); -- GitLab