From 1f423f84ace49e8377e3fc4dee44679fdf33954e Mon Sep 17 00:00:00 2001 From: peizhilin Date: Sat, 29 Dec 2018 16:46:19 +0800 Subject: [PATCH 1/3] fix the huber loss compile issue on windows test=develop --- paddle/fluid/operators/huber_loss_op.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/huber_loss_op.h b/paddle/fluid/operators/huber_loss_op.h index 9efda3dfc9..fa21bd01cb 100644 --- a/paddle/fluid/operators/huber_loss_op.h +++ b/paddle/fluid/operators/huber_loss_op.h @@ -105,14 +105,16 @@ class HuberLossGradKernel : public framework::OpKernel { out0->mutable_data(context.GetPlace()); auto x_grad = EigenVector::Flatten(*out0); x_grad.device(place) = - out_grad * residual.unaryExpr(HuberLossBackward(delta, -1.0)); + residual.unaryExpr(HuberLossBackward(delta, -1.0)); + x_grad.device(place) = out_grad * x_grad; } if (out1) { out1->mutable_data(context.GetPlace()); auto y_grad = EigenVector::Flatten(*out1); y_grad.device(place) = - out_grad * residual.unaryExpr(HuberLossBackward(delta, 1.0)); + residual.unaryExpr(HuberLossBackward(delta, 1.0)); + y_grad.device(place) = out_grad * y_grad; } } }; From cd2d60b4c822db2bc0fba5eec8163b90888a9e6f Mon Sep 17 00:00:00 2001 From: peizhilin Date: Sat, 29 Dec 2018 17:18:26 +0800 Subject: [PATCH 2/3] fix build issue for density prior box op on windows test=develop --- paddle/fluid/operators/detection/density_prior_box_op.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/detection/density_prior_box_op.cu b/paddle/fluid/operators/detection/density_prior_box_op.cu index acd5993154..6337a4837a 100644 --- a/paddle/fluid/operators/detection/density_prior_box_op.cu +++ b/paddle/fluid/operators/detection/density_prior_box_op.cu @@ -148,7 +148,7 @@ class DensityPriorBoxOpCUDAKernel : public framework::OpKernel { // blockx is multiple of 32. int blockx = std::min( static_cast(((feature_width * num_priors + 31) >> 5) << 5), - 512L); + static_cast(512L)); int gridx = (feature_width * num_priors + blockx - 1) / blockx; dim3 threads(blockx, 1); dim3 grids(gridx, feature_height); From dba009dbbf1edeb7513505a17508cb1e294e68a3 Mon Sep 17 00:00:00 2001 From: peizhilin Date: Sat, 29 Dec 2018 19:15:43 +0800 Subject: [PATCH 3/3] fix script issue test=develop --- paddle/fluid/operators/CMakeLists.txt | 2 +- python/paddle/fluid/tests/unittests/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index ee15420775..e53a6a562a 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -53,7 +53,7 @@ if (WITH_GPU) op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale) endif() # conv_fusion_op needs cudnn 7 above - if (NOT ${CUDNN_MAJOR_VERSION} VERSION_LESS 7) + if (NOT ${CUDNN_VERSION} VERSION_LESS 7100) op_library(conv_fusion_op) file(APPEND ${pybind_file} "USE_CUDA_ONLY_OP(conv2d_fusion);\n") endif() diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 6d6fe245d8..3441304995 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -25,7 +25,7 @@ endif(NOT WITH_DISTRIBUTE) if (NOT ${WITH_GPU}) LIST(REMOVE_ITEM TEST_OPS test_conv2d_fusion_op) -elseif(${CUDNN_MAJOR_VERSION} VERSION_LESS 7) +elseif(${CUDNN_VERSION} VERSION_LESS 7100) LIST(REMOVE_ITEM TEST_OPS test_conv2d_fusion_op) endif()