Skip to content

Commit e06f2f3

Browse files
committed
Merge branch 'release/1.0.0' of https://github.com/PaddlePaddle/Paddle into release/1.0.0
2 parents 3023ecc + 627bea4 commit e06f2f3

File tree

14 files changed

+220
-831
lines changed

14 files changed

+220
-831
lines changed

cmake/flags.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,17 @@ if (APPLE)
138138
# On Mac OS X build fat binaries with x86_64 architectures by default.
139139
set (CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
140140
endif()
141-
else()
141+
# On Mac OS X register class specifier is deprecated and will cause warning error on latest clang 10.0
142+
set (COMMON_FLAGS -Wno-deprecated-register)
143+
endif(APPLE)
144+
145+
if(LINUX)
142146
set(GPU_COMMON_FLAGS
143147
-Wall
144148
-Wextra
145149
-Werror
146150
${GPU_COMMON_FLAGS})
147-
endif()
151+
endif(LINUX)
148152

149153
if(UNIX AND NOT APPLE)
150154
# except apple from nix*Os family

paddle/fluid/framework/details/reference_count_pass.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ std::unique_ptr<ir::Graph> ReferenceCountPass::ApplyImpl(
8080
// This is weird but there is really some variables without var_desc
8181
// in computation_op
8282
if (var_desc == nullptr) {
83-
if (compute_op->Node()->Op()->Block()->FindVar(var_name) == nullptr)
84-
continue;
85-
} else {
86-
if (var_desc->Persistable()) continue;
87-
auto var_type = var_desc->Proto()->type().type();
88-
if (var_type != proto::VarType::LOD_TENSOR &&
89-
var_type != proto::VarType::SELECTED_ROWS) {
90-
continue;
91-
}
83+
var_desc = compute_op->Node()->Op()->Block()->FindVar(var_name);
84+
if (var_desc == nullptr) continue;
85+
}
86+
87+
if (var_desc->Persistable()) continue;
88+
auto var_type = var_desc->Proto()->type().type();
89+
if (var_type != proto::VarType::LOD_TENSOR &&
90+
var_type != proto::VarType::SELECTED_ROWS) {
91+
continue;
9292
}
9393

9494
// compute op only runs in one device

paddle/fluid/framework/parallel_executor.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
319319
#ifdef PADDLE_WITH_CUDA
320320
if (!gcs_.empty()) {
321321
ResetReferenceCount();
322+
for (auto &pair : cur_ref_cnts_) {
323+
auto &name_map = *(pair.second);
324+
for (auto &fetch_name : fetch_tensors) {
325+
name_map.erase(fetch_name);
326+
}
327+
name_map.erase(fetched_var_name);
328+
}
322329
}
323330
#endif
324331
auto fetch_data = member_->executor_->Run(fetch_tensors);

paddle/fluid/operators/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ op_library(fusion_lstm_op DEPS cpu_lstm_compute)
301301
if (WITH_GPU)
302302
op_library(conv_op DEPS vol2col depthwise_conv im2col)
303303
op_library(layer_norm_op DEPS cub)
304-
op_library(reduce_mean_op DEPS cub)
305304
else()
306305
op_library(conv_op DEPS vol2col im2col)
307306
endif()

paddle/fluid/operators/conv_op.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,7 @@ class DepthwiseConvKernel : public framework::OpKernel<T> {
380380
math::DepthwiseConvFunctor<DeviceContext, T> depthwiseConv;
381381

382382
auto& dev_ctx = context.template device_context<DeviceContext>();
383-
depthwiseConv(dev_ctx, *input, filter, strides, paddings, dilations,
384-
output);
383+
depthwiseConv(dev_ctx, *input, filter, strides, paddings, output);
385384
}
386385
};
387386

@@ -416,14 +415,14 @@ class DepthwiseConvGradKernel : public framework::OpKernel<T> {
416415
input_grad->mutable_data<T>(context.GetPlace());
417416
set_zero(dev_ctx, input_grad, static_cast<T>(0));
418417
depthwiseConvInputGrad(dev_ctx, *input, filter, *output_grad, strides,
419-
paddings, dilations, input_grad);
418+
paddings, input_grad);
420419
}
421420

422421
if (filter_grad) {
423422
filter_grad->mutable_data<T>(context.GetPlace());
424423
set_zero(dev_ctx, filter_grad, static_cast<T>(0));
425424
depthwiseConvFilterGrad(dev_ctx, *input, *output_grad, strides, paddings,
426-
dilations, filter_grad);
425+
filter_grad);
427426
}
428427
}
429428
};

paddle/fluid/operators/conv_transpose_op.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class DepthwiseConvTransposeKernel : public framework::OpKernel<T> {
345345
math::DepthwiseConvInputGradFunctor<DeviceContext, T>
346346
depthwiseConvInputGrad;
347347
depthwiseConvInputGrad(dev_ctx, *output, filter, *input, strides, paddings,
348-
dilations, output);
348+
output);
349349
}
350350
};
351351

@@ -367,11 +367,10 @@ class DepthwiseConvTransposeGradKernel : public framework::OpKernel<T> {
367367
auto& dev_ctx = context.template device_context<DeviceContext>();
368368
std::vector<int> strides = context.Attr<std::vector<int>>("strides");
369369
std::vector<int> paddings = context.Attr<std::vector<int>>("paddings");
370-
std::vector<int> dilations = context.Attr<std::vector<int>>("dilations");
371370

372371
if (input_grad) {
373372
math::DepthwiseConvFunctor<DeviceContext, T> depthwiseConv;
374-
depthwiseConv(dev_ctx, *output_grad, filter, strides, paddings, dilations,
373+
depthwiseConv(dev_ctx, *output_grad, filter, strides, paddings,
375374
input_grad);
376375
}
377376

@@ -383,7 +382,7 @@ class DepthwiseConvTransposeGradKernel : public framework::OpKernel<T> {
383382
math::DepthwiseConvFilterGradFunctor<DeviceContext, T>
384383
depthwiseConvFilterGrad;
385384
depthwiseConvFilterGrad(dev_ctx, *output_grad, *input, strides, paddings,
386-
dilations, filter_grad);
385+
filter_grad);
387386
}
388387
}
389388
};

0 commit comments

Comments
 (0)