Skip to content

Commit

Permalink
merge paddlepaddle master (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
qingshui authored Feb 5, 2021
1 parent 23a73d7 commit de7313b
Show file tree
Hide file tree
Showing 3,335 changed files with 307,489 additions and 70,909 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/---document-issue-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: 文档(Document Issue)
about: 您可以提问文档相关的问题。 You could use this template for reporting an document issue.

---

非常感谢您提交关于飞桨文档的Issue,我们会认真听取您的意见,并进行改进。

建立issue时,为快速解决问题,请您根据情况给出如下信息:
- 标题:请包含关键词“XXX文档问题”,例如“add 文档问题” 或 ”paddle.add 文档问题“
- 文档版本信息:请提供有问题的文档的版本号,例如 develop,1.8,2.0RC;

### 文档问题描述:

#### API文档描述是否清晰?
如:文档描述看不懂,不知道这个API该怎么用;文档公式错误;

#### 参数说明是否清晰
如:参数未解释清楚,包括用法、使用场景、默认值等

#### 返回/形状说明是否清晰
如:API返回值、数据的形状描述错误、不清楚

#### 示例代码是否有效?
如:没有示例代码;示例代码没有可指导性;示例代码跑不通;示例代码格式有问题;示例代码没有注释;

#### 中英文内容是否一致?
如:中英文API描述不一致;中英文API参数不一致;

#### 其他
如:文档页面打不开;文档缺失;文档中有死链;


Thanks for opening a document issue. We will listen to your opinions carefully and make improvements.

In order to quickly solve your problem, when creating an issue, please provide the following information:
**Document Information**
- Title:Please include the keyword "XXX document issue", such as "add document issue" or "paddle.add document issue"
- Doc Version:Please provide the version of the document, such as develop, 1.8, 2.0RC;

### Describe the problem:

#### Document description is clear?
For example: I don’t understand this document, I don’t know how to use this API; The formula in this doc is unclear;

#### Parameter description is clear?
For example: The parameters are confusing, including usage, scenarios, default values, etc.

#### Return/Shape description is clear
For example: Data returned this doc is error, shape returned is not clear.

#### The sample code is clear?
For example: no sample code; The sample code is not helpful; The sample code not run well; Format of the sample is not reasonable; The sample code has no comments.

#### Chinese content and English content is consistent?
For example:Chinese API in this doc is inconsistent with English API, including params, description, sample code, formula, etc.

#### Other
For example: The doc link is broken; The doc page is missing; Dead link in docs.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/---feature-request-.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ about: 您可以提出您的建议。 You could use this template for reporting
1)PaddlePaddle版本:请提供您的PaddlePaddle版本号,例如1.1
2)CPU/GPU:您是否使用GPU进行训练,如是,请提供您的CUDA和cuDNN版本号
3)系统环境:请您描述系统类型、版本,例如Mac OS 10.14
注:您可以通过执行[summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py)获取以上信息。
- 复现信息:如为报错,请给出复现环境、复现步骤
- 建议描述:请您详细描述,您认为需优化的功能

Expand All @@ -21,6 +22,7 @@ Please make sure that this is a feature request.
-CPU: including CPUMKL/OpenBlas/MKLDNN version
-GPU: including CUDA/CUDNN version
-OS Platform (eg.Mac OS 10.14)
Note: You can get most of the information by running [summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py).
**To Reproduce**
Steps to reproduce the behavior
**Describe the feature and the current behavior/state.**
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/---inference-issue-.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ about: 您可以提问预测中报错、应用等问题。 You could use this te
   2)CPU:预测若用CPU,请提供CPU型号,MKL/OpenBlas/MKLDNN/等数学库使用情况
   3)GPU:预测若用GPU,请提供GPU型号、CUDA和CUDNN版本号
   4)系统环境:请您描述系统类型、版本(如Mac OS 10.14),Python版本
注:您可以通过执行[summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py)获取以上信息。
-预测信息
   1)C++预测:请您提供预测库安装包的版本信息,及其中的version.txt文件
   2)CMake包含路径的完整命令
Expand All @@ -33,6 +34,7 @@ If there is no solution,please make sure that this is an inference issue includi
-Cmake orders
-C++version.txt
-API information
Note: You can get most of the information by running [summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py).
**To Reproduce**
Steps to reproduce the behavior
**Describe your current behavior**
Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/---installation-issue-.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ about: 您可以提问安装、编译出现报错等问题。 You could use this
   2)CPU:请提供CPU型号,MKL/OpenBlas/MKLDNN/等数学库的使用情况
   3)GPU:请提供GPU型号,CUDA和CUDNN版本号
   4)系统环境:请说明系统类型、版本(如Mac OS 10.14)、Python版本
注:您可以通过执行[summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py)获取以上信息。
- 安装方式信息:
1)pip安装/docker安装
2)本地编译:请提供cmake命令,编译命令
Expand All @@ -32,7 +33,9 @@ If there is no solution,please make sure that this is an installation issue incl
-OS Platform (eg. Mac OS 10.14)
-Python version
- Install method: pip install/install with docker/build from source(without docker)/build within docker
- Other special cases that you think may be related to this problem, eg. offline install, special internet condition  
- Other special cases that you think may be related to this problem, eg. offline install, special internet condition
Note: You can get most of the information by running [summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py).  

**To Reproduce**
Steps to reproduce the behavior
**Describe your current behavior**
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/---model-issue-.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ about: 您可以提问模型、算法、数据集方向的使用报错等问题
   2)CPU:请提供CPU型号,MKL/OpenBlas/MKLDNN/等数学库的使用情况
   3)GPU:请提供GPU型号,CUDA和CUDNN版本号
   4)系统环境:请说明系统类型、版本(例如Mac OS 10.14),Python版本
注:您可以通过执行[summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py)获取以上信息。
- 模型信息
   1)模型名称 2)使用数据集名称 3)使用算法名称 4)模型链接
- 复现信息:如为报错,请给出复现环境、复现步骤
Expand All @@ -29,6 +30,7 @@ If there is no solution,please make sure that this is a issue of models includin
-OS Platform (eg.Mac OS 10.14)
-Python version
-Name of Models&Dataset/details of operator
Note: You can get most of the information by running [summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py).
**To Reproduce**
Steps to reproduce the behavior
**Describe your current behavior**
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/---others-.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ about: 如上述分类未包含您的问题,可在此提出。 You could use t
   3)系统环境:请您描述系统类型、版本,例如Mac OS 10.14
   4)Python版本号
   5)显存信息
注:您可以通过执行[summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py)获取以上信息。
- 复现信息:如为报错,请给出复现环境、复现步骤
- 问题描述:请详细描述您的问题,同步贴出报错信息、日志/代码关键片段

Expand All @@ -26,6 +27,7 @@ If there is no solution,please provide us with the following details :
-GPU: including CUDA/cuDNN version
-OS Platform and Distribution(eg.Mac OS 10.14)
-Python version
Note: You can get most of the information by running [summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py).
**To Reproduce**
Steps to reproduce the behavior
**Describe your current behavior**
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/---training-issue-.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ about: 您可以提问训练中报错、应用、出core等问题。 You could u
   2)CPU:预测若用CPU,请提供CPU型号,MKL/OpenBlas/MKLDNN/等数学库使用情况
   3)GPU:预测若用GPU,请提供GPU型号、CUDA和CUDNN版本号
   4)系统环境:请您描述系统类型、版本,例如Mac OS 10.14,Python版本
注:您可以通过执行[summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py)获取以上信息。
- 训练信息
   1)单机/多机,单卡/多卡
   2)显存信息
Expand All @@ -31,6 +32,7 @@ If there is no solution,please make sure that this is a training issue including
-OS Platform (eg.Mac OS 10.14)
-Other imformation: Distriuted training/informantion of operator/
Graphics card storage
Note: You can get most of the information by running [summary_env.py](https://github.com/PaddlePaddle/Paddle/blob/develop/tools/summary_env.py).
**To Reproduce**
Steps to reproduce the behavior
**Describe your current behavior**
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ paddle/fluid/op_use_default_grad_maker_PR.spec
build/
build_doc/
*.user
*.tmp

.vscode
.idea
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ repos:
name: copyright_checker
entry: python ./tools/codestyle/copyright.hook
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py|sh)$
exclude: (?!.*third_party)^.*$ | (?!.*book)^.*$
122 changes: 99 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,23 @@ include(system)
project(paddle CXX C)

include(init)
include(generic) # simplify cmake module

# enable language CUDA
# TODO(Shibo Tao): remove find_package(CUDA) completely.
find_package(CUDA QUIET)
option(WITH_GPU "Compile PaddlePaddle with NVIDIA GPU" ${CUDA_FOUND})
option(WITH_TENSORRT "Compile PaddlePaddle with NVIDIA TensorRT" OFF)
option(WITH_XPU "Compile PaddlePaddle with BAIDU KUNLUN" OFF)
if (WITH_GPU AND WITH_XPU)
message(FATAL_ERROR "Error when compile GPU and XPU at the same time")
endif()
# cmake 3.12, 3.13, 3.14 will append gcc link options to nvcc, and nvcc doesn't recognize them.
if(WITH_GPU AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12) AND (${CMAKE_VERSION} VERSION_LESS 3.15))
message(FATAL_ERROR "cmake ${CMAKE_VERSION} is not supported when WITH_GPU=ON because of bug https://cmake.org/pipermail/cmake/2018-September/068195.html. "
"You can use cmake 3.16 (recommended), 3.10, 3.11, 3.15 or 3.17. Please refer to the install document: https://cmake.org/install/")
endif()

if(WITH_GPU AND NOT APPLE)
enable_language(CUDA)
message(STATUS "CUDA compiler: ${CMAKE_CUDA_COMPILER}, version: "
Expand All @@ -39,39 +51,75 @@ message(STATUS "C compiler: ${CMAKE_C_COMPILER}, version: "
"${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
message(STATUS "AR tools: ${CMAKE_AR}")

# MUSL build turn off warnings
if(WITH_MUSL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations -Wno-error=pessimizing-move -Wno-error=deprecated-copy")
endif()

if(WIN32)
option(MSVC_STATIC_CRT "use static C Runtime library by default" ON)

set(CMAKE_SUPPRESS_REGENERATION ON)
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
add_definitions("/DGOOGLE_GLOG_DLL_DECL=")

if (MSVC_STATIC_CRT)
message(STATUS "Use static C runtime time, refer to https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=vs-2019")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /bigobj /MTd")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /bigobj /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj /MT")
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
endforeach(flag_var)
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838 /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838 /MP")
message(STATUS "Using parallel compiling (/MP)")
set(PADDLE_LINK_FLAGS "/IGNORE:4006 /IGNORE:4098 /IGNORE:4217 /IGNORE:4221")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${PADDLE_LINK_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PADDLE_LINK_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PADDLE_LINK_FLAGS}")

# windows build turn off warnings, use parallel compiling.
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
string(REGEX REPLACE "/W[1-4]" " /W0 " ${flag_var} "${${flag_var}}")
set(${flag_var} "${${flag_var}} /MP")
endforeach(flag_var)
foreach(flag_var CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
set(${flag_var} "${${flag_var}} /w")
endforeach(flag_var)

# Windows Remove /Zi, /ZI for Release, MinSizeRel builds
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL)
if(${flag_var} MATCHES "/Z[iI]")
string(REGEX REPLACE "/Z[iI]" "" ${flag_var} "${${flag_var}}")
endif()
endforeach(flag_var)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838")
else(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations")
endif(WIN32)

find_package(Git REQUIRED)

# config GIT_URL with github mirrors to speed up dependent repos clone
option(GIT_URL "Git URL to clone dependent repos" ${GIT_URL})
if(NOT GIT_URL)
set(GIT_URL "https://github.com")
endif()

find_package(Threads REQUIRED)

include(simd)

################################ Exposed Configurations #######################################
option(WITH_DSO "Compile PaddlePaddle with dynamic linked CUDA" ON)
option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND})
option(WITH_PYTHON "Compile PaddlePaddle with python interpreter" ON)
option(WITH_TESTING "Compile PaddlePaddle with unit testing" OFF)
Expand All @@ -85,6 +133,7 @@ option(WITH_AMD_GPU "Compile PaddlePaddle with AMD GPU" OFF)
option(WITH_NV_JETSON "Compile PaddlePaddle with NV JETSON" OFF)
option(WITH_PROFILER "Compile PaddlePaddle with GPU profiler and gperftools" OFF)
option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF)
option(WITH_INCREMENTAL_COVERAGE "Generate coverage reports only for incremental code" OFF)
OPTION(WITH_LIBXSMM "Compile with libxsmm" OFF)
option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF)
option(WITH_PSLIB "Compile with pslib support" OFF)
Expand All @@ -99,6 +148,10 @@ option(SANITIZER_TYPE "Choose the type of sanitizer, options are: Address, Leak,
option(WITH_LITE "Compile Paddle Fluid with Lite Engine" OFF)
option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
option(WITH_CRYPTO "Compile PaddlePaddle with crypto support" ON)
option(WITH_ARM "Compile PaddlePaddle with arm support" OFF)
option(WITH_SW "Compile PaddlePaddle with sw support" OFF)
option(WITH_MUSL "Compile with musl libc instead of gblic" OFF)
option(WITH_UNITY_BUILD "Compile with UnityBuild mode" OFF)

# PY_VERSION
if(NOT PY_VERSION)
Expand Down Expand Up @@ -160,7 +213,19 @@ if(WITH_BRPC_RDMA)
endif()
endif()

include(third_party) # download, build, install third_party
if(WITH_GPU)
include(cuda)
# lite subgraph compilation depends on CUDNN_ROOT,
# so include(cudnn) needs to be in front of include(third_party/lite)
include(cudnn) # set cudnn libraries, must before configure
include(tensorrt)
# there is no official support of nccl, cupti in windows
if(NOT WIN32)
include(cupti)
endif()
endif()

include(third_party) # download, build, install third_party, Contains about 20+ dependencies

if(WITH_DISTRIBUTE)
if(WITH_GRPC)
Expand All @@ -173,26 +238,20 @@ if(WITH_DISTRIBUTE)
endif()
endif()

# there is no official support of nccl, cupti in windows
if(NOT WIN32)
include(cupti)
endif()

include(flags) # set paddle compile flags
include(cudnn) # set cudnn libraries, must before configure

if(WITH_GPU)
include(cuda)
include(tensorrt)
endif()

if(WITH_PROFILER)
find_package(Gperftools REQUIRED)
include_directories(${GPERFTOOLS_INCLUDE_DIR})
add_definitions(-DWITH_GPERFTOOLS)
endif()

include(generic) # simplify cmake module
if(WITH_DISTRIBUTE)
if(LINUX)
set(WITH_GLOO ON CACHE STRING "Enable GLOO when compiling WITH_DISTRIBUTE=ON." FORCE)
endif()
endif()

include(ccache) # set ccache for compilation
include(util) # set unittest and link libs
include(version) # set PADDLE_VERSION
Expand All @@ -206,6 +265,23 @@ if(WITH_AMD_GPU)
include(hip)
endif(WITH_AMD_GPU)

if(WITH_ARM)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(WITH_XBYAK OFF CACHE STRING "Disable XBYAK when compiling WITH_ARM=ON" FORCE)
set(WITH_MKL OFF CACHE STRING "Disable MKL when compiling WITH_ARM=ON." FORCE)
add_definitions(-DPADDLE_WITH_ARM)
endif()

if (WITH_SW)
# mieee flag solves floating-point exceptions under sw and ALPHA architectures
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -mieee")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -mieee")
set(WITH_XBYAK OFF CACHE STRING "Disable XBYAK when compiling WITH_SW=ON" FORCE)
set(WITH_MKL OFF CACHE STRING "Disable MKL when compiling WITH_SW=ON." FORCE)
add_definitions(-DPADDLE_WITH_SW)
endif()

set(PADDLE_PYTHON_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/python/build")

set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
Expand Down
Loading

0 comments on commit de7313b

Please sign in to comment.