Skip to content

Commit e9fc61d

Browse files
committed
Merge branch 'release/1.0.0' of https://github.com/PaddlePaddle/Paddle into 10_fix_mac_14_py3_install
test=release/1.0.0
2 parents 2ff9f10 + b2e6e5f commit e9fc61d

21 files changed

+249
-848
lines changed

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ COPY ./paddle/scripts/docker/root/ /root/
2424

2525
RUN apt-get update && \
2626
apt-get install -y --allow-downgrades patchelf \
27+
python3 python3-dev python3-pip \
2728
git python-pip python-dev python-opencv openssh-server bison \
2829
libnccl2=2.1.2-1+cuda8.0 libnccl-dev=2.1.2-1+cuda8.0 \
2930
wget unzip unrar tar xz-utils bzip2 gzip coreutils ntp \
@@ -70,24 +71,33 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8
7071
# specify sphinx version as 1.5.6 and remove -U option for [pip install -U
7172
# sphinx-rtd-theme] since -U option will cause sphinx being updated to newest
7273
# version(1.7.1 for now), which causes building documentation failed.
73-
RUN easy_install -U pip && \
74+
RUN pip3 install -U wheel && \
75+
pip3 install -U docopt PyYAML sphinx==1.5.6 && \
76+
pip3 install sphinx-rtd-theme==0.1.9 recommonmark && \
77+
easy_install -U pip && \
7478
pip install -U wheel && \
7579
pip install -U docopt PyYAML sphinx==1.5.6 && \
7680
pip install sphinx-rtd-theme==0.1.9 recommonmark
7781

78-
RUN pip install pre-commit 'ipython==5.3.0' && \
82+
RUN pip3 install pre-commit 'ipython==5.3.0' && \
83+
pip3 install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
84+
pip3 install opencv-python && \
85+
pip install pre-commit 'ipython==5.3.0' && \
7986
pip install 'ipykernel==4.6.0' 'jupyter==1.0.0' && \
8087
pip install opencv-python
8188

8289
#For docstring checker
90+
RUN pip3 install pylint pytest astroid isort
8391
RUN pip install pylint pytest astroid isort LinkChecker
8492

8593
COPY ./python/requirements.txt /root/
94+
RUN pip3 install -r /root/requirements.txt
8695
RUN pip install -r /root/requirements.txt
8796

8897
# To fix https://github.com/PaddlePaddle/Paddle/issues/1954, we use
8998
# the solution in https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2
9099
RUN apt-get install -y libssl-dev libffi-dev
100+
RUN pip3 install certifi urllib3[secure]
91101
RUN pip install certifi urllib3[secure]
92102

93103

cmake/cblas.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(OPENBLAS_LIB_SEARCH_PATHS
4040
/usr/local/opt/openblas/lib)
4141

4242
find_path(OPENBLAS_INC_DIR NAMES cblas.h
43-
PATHS ${OPENBLAS_INCLUDE_SEARCH_PATHS})
43+
PATHS ${OPENBLAS_INCLUDE_SEARCH_PATHS} NO_DEFAULT_PATH)
4444
find_path(OPENBLAS_LAPACKE_INC_DIR NAMES lapacke.h
4545
PATHS ${OPENBLAS_INCLUDE_SEARCH_PATHS})
4646
find_library(OPENBLAS_LIB NAMES openblas

cmake/external/openblas.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ IF(NOT ${CBLAS_FOUND})
2727

2828
SET(CBLAS_SOURCES_DIR ${THIRD_PARTY_PATH}/openblas)
2929
SET(CBLAS_INSTALL_DIR ${THIRD_PARTY_PATH}/install/openblas)
30-
SET(CBLAS_INCLUDE_DIR "${CBLAS_INSTALL_DIR}/include" CACHE PATH "openblas include directory." FORCE)
30+
SET(CBLAS_INC_DIR "${CBLAS_INSTALL_DIR}/include" CACHE PATH "openblas include directory." FORCE)
3131

3232
SET(CBLAS_LIBRARIES
3333
"${CBLAS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}openblas${CMAKE_STATIC_LIBRARY_SUFFIX}"
@@ -96,7 +96,7 @@ IF(NOT ${CBLAS_FOUND})
9696
ENDIF(NOT WIN32)
9797
SET(CBLAS_PROVIDER openblas)
9898
IF(WITH_C_API)
99-
INSTALL(DIRECTORY ${CBLAS_INCLUDE_DIR} DESTINATION third_party/openblas)
99+
INSTALL(DIRECTORY ${CBLAS_INC_DIR} DESTINATION third_party/openblas)
100100
# Because libopenblas.a is a symbolic link of another library, thus need to
101101
# install the whole directory.
102102
IF(ANDROID)
@@ -117,8 +117,8 @@ IF(NOT ${CBLAS_FOUND})
117117
ENDIF(NOT ${CBLAS_FOUND})
118118

119119
MESSAGE(STATUS "BLAS library: ${CBLAS_LIBRARIES}")
120-
MESSAGE(STATUS "BLAS Include: ${CBLAS_INCLUDE_DIR}")
121-
INCLUDE_DIRECTORIES(${CBLAS_INCLUDE_DIR})
120+
MESSAGE(STATUS "BLAS Include: ${CBLAS_INC_DIR}")
121+
INCLUDE_DIRECTORIES(${CBLAS_INC_DIR})
122122

123123
# FIXME(gangliao): generate cblas target to track all high performance
124124
# linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas)

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)