From 227e0c4518901f1ece25db76dbcef384583cf8af Mon Sep 17 00:00:00 2001 From: Wu Yi Date: Wed, 2 Jan 2019 13:18:45 +0800 Subject: [PATCH] fix nccl2 mode startup test=develop (#15132) --- paddle/fluid/framework/details/build_strategy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/build_strategy.cc b/paddle/fluid/framework/details/build_strategy.cc index 389366a8a98..7edbe596bee 100644 --- a/paddle/fluid/framework/details/build_strategy.cc +++ b/paddle/fluid/framework/details/build_strategy.cc @@ -67,7 +67,7 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder { context->endpoints_ = strategy_.trainers_endpoints_; context->trainer_id_ = strategy_.trainer_id_; PADDLE_ENFORCE(strategy_.trainer_id_ >= 0, "trainer_id_ >= 0"); - if (strategy_.trainer_id_ > 0) { + if (strategy_.trainer_id_ > 0 && strategy_.trainers_endpoints_.size() > 0) { PADDLE_ENFORCE((unsigned)(strategy_.trainer_id_) < strategy_.trainers_endpoints_.size(), "trainer_id_ < endpoints_ size"); -- GitLab