diff --git a/paddle/fluid/operators/distributed/proto_encoder_helper.h b/paddle/fluid/operators/distributed/proto_encoder_helper.h index 2fab02e32fe18ee04f86a69bb5bae1cbe7c6762c..45f9e4a6505d0db0e066666b8cc779aa42088410 100644 --- a/paddle/fluid/operators/distributed/proto_encoder_helper.h +++ b/paddle/fluid/operators/distributed/proto_encoder_helper.h @@ -83,7 +83,9 @@ class ProtoEncodeHelper { ~ProtoEncodeHelper() { // Make sure callers didn't do operations that went over max_size promised - PADDLE_ENFORCE_LE(p_, limit_); +#define REPLACE_ENFORCE_GLOG 1 + paddle::platform::throw_on_error(p_ <= limit_); +#undef REPLACE_ENFORCE_GLOG } const char* data() const { return base_; } diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index 966d78b84130c172c41e8049bf6bb1dc659d7d48..13358e5f99679001c212af0dac5c8815f90cb788 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -60,7 +60,7 @@ static void ParallelExecuteBlocks( std::vector> fs; for (size_t idx : parallel_blkids) { fs.push_back( - framework::Async([&executor, &prepared, &program, &scope, idx]() { + framework::Async([&executor, &prepared, &scope, idx]() { int run_block = idx; // thread local try { VLOG(3) << "running server block: " << run_block