fix allReduce bug

wangkuiyi-patch-1
chengduoZH 8 years ago
parent a57e8a4338
commit d24e046c1e

@ -107,7 +107,7 @@ void AllReduceOpHandle::RunImpl() {
auto &trg = *this->local_scopes_[0] auto &trg = *this->local_scopes_[0]
->FindVar(kLocalExecScopeName) ->FindVar(kLocalExecScopeName)
->Get<Scope *>() ->Get<Scope *>()
->Var() ->FindVar(in_var_handles[0]->name_)
->GetMutable<framework::LoDTensor>(); ->GetMutable<framework::LoDTensor>();
// Reduce All Tensor to trg in CPU // Reduce All Tensor to trg in CPU

@ -121,8 +121,9 @@ class ParallelExecutor(object):
# performance. Worth tunning for other models in the future. # performance. Worth tunning for other models in the future.
exec_strategy.num_threads = len(self._places) * 4 exec_strategy.num_threads = len(self._places) * 4
else: else:
# Currently num_threads must be 1. cpu_num = int(
exec_strategy.num_threads = 1 os.environ.get('CPU_NUM', multiprocessing.cpu_count()))
exec_strategy.num_threads = cpu_num
if build_strategy is None: if build_strategy is None:
build_strategy = BuildStrategy() build_strategy = BuildStrategy()

Loading…
Cancel
Save