diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index e7a2fadf4705ee97938f05e7218f65cf324d46a1..bfc3b7c70177b8b45ec328710fadc41e73d69889 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -167,7 +167,9 @@ class ParallelExecutorPrivate { nccl_id = new ncclUniqueId(); PADDLE_ENFORCE_EQ( platform::dynload::ncclGetUniqueId(nccl_id), ncclSuccess, - platform::errors::PreconditionNotMet("Get NCCL unique ID failed.")); + platform::errors::PreconditionNotMet( + "PaddlePaddle failed to get NCCL unique ID. It may due to your " + "system settings or NCCL library error, please debug on NCCL")); VLOG(10) << "can't find nccl_id_var:" << var_name << ", nccl_id:" << nccl_id; } diff --git a/paddle/fluid/operators/controlflow/conditional_block_op.cc b/paddle/fluid/operators/controlflow/conditional_block_op.cc index 2713b7fd59a78b2a91b76b6dddaada769a2dc86c..eeb410eba2b4c21389efbb5196944d40673aa840 100644 --- a/paddle/fluid/operators/controlflow/conditional_block_op.cc +++ b/paddle/fluid/operators/controlflow/conditional_block_op.cc @@ -57,8 +57,10 @@ class ConditionalBlockOp : public ConditionalOp { if (need_run) { auto *scope_var = scope.FindVar(Output(ConditionalOp::kScope)); PADDLE_ENFORCE_NOT_NULL( - scope_var, platform::errors::PreconditionNotMet( - "Scope must be set in conditional_block_op.")); + scope_var, + platform::errors::PreconditionNotMet( + "Expect Scope variable to be set in conditional_block_op, but " + "got a null Scope variable. Please set the Scope variable.")); auto *scopes = scope_var->GetMutable>(); scopes->resize(1); scopes->front() = &scope.NewScope(); @@ -119,12 +121,16 @@ class ConditionalBlockGradOp : public ConditionalOp { auto *scope_var = scope.FindVar(Input(ConditionalOp::kScope)); PADDLE_ENFORCE_NOT_NULL( - scope_var, platform::errors::PreconditionNotMet( - "Scope must be set in conditional block op.")); + scope_var, + platform::errors::PreconditionNotMet( + "Expect Scope variable to be set in conditional_block_op, but " + "got a null Scope variable. Please set the Scope variable.")); auto &scopes = scope_var->Get>(); - PADDLE_ENFORCE_GT(scopes.size(), 0, - platform::errors::InvalidArgument( - "Scope must be set in conditional block op.")); + PADDLE_ENFORCE_GT( + scopes.size(), 0, + platform::errors::InvalidArgument( + "Expect Scope variable contains at least 1 scope, but got: %d", + scopes.size())); framework::Scope &cur_scope = *scopes[0]; framework::Executor exec(dev_place); diff --git a/paddle/fluid/operators/recurrent_op.cc b/paddle/fluid/operators/recurrent_op.cc index 35f52ffa522f4c497a493b7e93736f9f522beb19..231fb38da272a81ad65efa6d86a51e7182076807 100644 --- a/paddle/fluid/operators/recurrent_op.cc +++ b/paddle/fluid/operators/recurrent_op.cc @@ -161,7 +161,9 @@ int64_t RecurrentBase::GetSequenceLength(const framework::Scope &scope) const { } PADDLE_ENFORCE_GE(seq_len, 0, platform::errors::InvalidArgument( - "RecurrentOp gets invalid sequence length.")); + "RecurrentOp gets invalid sequence length. Expected " + "seq_len >= 0. Received seq_len = %d", + seq_len)); return seq_len; }