Skip to content

Commit 83dc689

Browse files
committed
Merge remote-tracking branch 'ups/develop' into refine/jit/gru
test=develop
2 parents 640e789 + 5d6783f commit 83dc689

File tree

13 files changed

+280
-208
lines changed

13 files changed

+280
-208
lines changed

cmake/generic.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ function(cc_library TARGET_NAME)
261261
add_dependencies(${TARGET_NAME} mklml)
262262
target_link_libraries(${TARGET_NAME} "-L${MKLML_LIB_DIR} -liomp5 -Wl,--as-needed")
263263
endif()
264+
# remove link to python, see notes at:
265+
# https://github.com/pybind/pybind11/blob/master/docs/compiling.rst#building-manually
266+
if("${cc_library_DEPS};" MATCHES "python;")
267+
list(REMOVE_ITEM cc_library_DEPS python)
268+
add_dependencies(${TARGET_NAME} python)
269+
target_link_libraries(${TARGET_NAME} "-Wl,-undefined,dynamic_lookup")
270+
endif()
264271
target_link_libraries(${TARGET_NAME} ${cc_library_DEPS})
265272
add_dependencies(${TARGET_NAME} ${cc_library_DEPS})
266273
endif()

paddle/fluid/framework/details/var_handle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct VarHandleBase {
4949

5050
void AddOutput(OpHandleBase* out, ir::Node* node) {
5151
if (pending_ops_.find(out) == pending_ops_.end()) {
52+
PADDLE_ENFORCE(out != nullptr, "The output of %s should not be nullptr",
53+
this->Node()->Name());
5254
pending_ops_.insert(out);
5355
node_->outputs.push_back(node);
5456
}

paddle/fluid/framework/parallel_executor.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ void ParallelExecutor::FeedAndSplitTensorIntoLocalScopes(
299299
}
300300

301301
ParallelExecutor::~ParallelExecutor() {
302+
const auto dev_ctxs =
303+
platform::DeviceContextPool::Instance().GetAllDeviceContexts();
304+
for (auto &dev_ctx : dev_ctxs) {
305+
dev_ctx->Wait();
306+
}
307+
302308
if (member_->own_local_scope_) {
303309
for (size_t i = 1; i < member_->local_scopes_.size(); ++i) {
304310
Scope *local_scope = member_->local_scopes_[i];

0 commit comments

Comments
 (0)