Skip to content

Commit f58a7e3

Browse files
authored
Merge branch 'PaddlePaddle:develop' into threshold
2 parents c936f55 + ccac768 commit f58a7e3

File tree

5,725 files changed

+228832
-80609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,725 files changed

+228832
-80609
lines changed

.clang-tidy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ bugprone-copy-constructor-init,
1111
bugprone-exception-escape,
1212
-bugprone-fold-init-type,
1313
-bugprone-forwarding-reference-overload,
14-
-bugprone-inaccurate-erase,
14+
bugprone-inaccurate-erase,
1515
bugprone-incorrect-roundings,
16-
-bugprone-infinite-loop,
16+
bugprone-infinite-loop,
1717
bugprone-integer-division,
1818
-bugprone-macro-repeated-side-effects,
1919
-bugprone-misplaced-operator-in-strlen-in-alloc,
@@ -28,7 +28,7 @@ bugprone-signed-char-misuse,
2828
-bugprone-sizeof-container,
2929
-bugprone-sizeof-expression,
3030
-bugprone-string-constructor,
31-
-bugprone-string-integer-assignment,
31+
bugprone-string-integer-assignment,
3232
-bugprone-string-literal-with-embedded-nul,
3333
-bugprone-suspicious-enum-usage,
3434
-bugprone-suspicious-memset-usage,
@@ -123,7 +123,7 @@ clang-analyzer-optin.portability.UnixAPI,
123123
-clang-analyzer-osx.coreFoundation.CFRetainRelease,
124124
-clang-analyzer-osx.coreFoundation.containers.OutOfBounds,
125125
-clang-analyzer-osx.coreFoundation.containers.PointerSizedValues,
126-
-clang-analyzer-security.FloatLoopCounter,
126+
clang-analyzer-security.FloatLoopCounter,
127127
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
128128
-clang-analyzer-security.insecureAPI.SecuritySyntaxChecker,
129129
-clang-analyzer-security.insecureAPI.UncheckedReturn,
@@ -198,7 +198,7 @@ performance-move-const-arg,
198198
-performance-move-constructor-init,
199199
-performance-no-automatic-move,
200200
performance-noexcept-move-constructor,
201-
-performance-trivially-destructible,
201+
performance-trivially-destructible,
202202
-performance-type-promotion-in-math-fn,
203203
-performance-unnecessary-copy-initialization,
204204
readability-container-size-empty,

.flake8

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
<!-- TemplateReference: https://github.com/PaddlePaddle/Paddle/wiki/PULL-REQUEST-TEMPLATE--REFERENCE -->
12
<!-- Demo: https://github.com/PaddlePaddle/Paddle/pull/24810 -->
2-
### PR types
3-
<!-- One of [ New features | Bug fixes | Function optimization | Performance optimization | Breaking changes | Others ] -->
43

5-
### PR changes
6-
<!-- One of [ OPs | APIs | Docs | Others ] -->
4+
### PR Category
5+
<!-- One of [ User Experience | Execute Infrastructure | Operator Mechanism | CINN | Custom Device | Performance Optimization | Distributed Strategy | Parameter Server | Communication Library | Auto Parallel | Inference | Environment Adaptation | Others ] -->
6+
7+
8+
### PR Types
9+
<!-- One of [ New features | Bug fixes | Improvements | Performance | BC Breaking | Deprecations | Docs | Devs | Not User Facing | Security | Deprecations | Others ] -->
10+
711

812
### Description
913
<!-- Describe what you’ve done -->

.gitignore

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ paddle/phi/include/*
3333
paddle/phi/infermeta/generated.*
3434
paddle/fluid/prim/api/generated_prim/*.cc
3535
paddle/fluid/prim/api/generated_prim/*.h
36+
python/paddle/libs/bfloat16.h
37+
python/paddle/libs/cinn_cuda_runtime_source.cuh
38+
python/paddle/libs/float16.h
3639
*.DS_Store
3740
*.vs
3841
build/
@@ -78,7 +81,7 @@ tools/nvcc_lazy
7881
paddle/phi/kernels/sparse/gpu/cutlass_generator/all_gemm_operations.h
7982
paddle/phi/kernels/sparse/gpu/cutlass_generator/configurations.h
8083

81-
# these files (directories) are generated before build system generation
84+
#these files (directories) are generated before build system generation
8285
paddle/fluid/operators/generated_op*.cc
8386
paddle/fluid/operators/generated_sparse_op.cc
8487
paddle/fluid/operators/generated_static_op.cc
@@ -104,17 +107,3 @@ paddle/phi/kernels/fusion/cutlass/cutlass_kernels/fpA_intB_gemm/autogen/*
104107
paddle/phi/kernels/fusion/cutlass/cutlass_kernels/fpA_intB_gemm/autogen_tmp/*
105108
paddle/fluid/pybind/static_op_function.*
106109
paddle/fluid/pybind/ops_api.cc
107-
paddle/fluid/pir/dialect/operator/ir/pd_api.*
108-
paddle/fluid/pir/dialect/operator/ir/op_decomp.cc
109-
paddle/fluid/pir/dialect/operator/ir/pd_op_vjp.cc
110-
paddle/fluid/pir/dialect/operator/ir/pd_op.*
111-
paddle/fluid/pir/dialect/operator/ir/pd_op_bwd.*
112-
paddle/fluid/pir/dialect/operator/ir/pd_op_fused.*
113-
paddle/fluid/pir/dialect/operator/ir/pd_op_fused_bwd.*
114-
paddle/fluid/pir/dialect/operator/ir/pd_pir_op.*
115-
paddle/fluid/pir/dialect/operator/ir/pd_pir_op_bwd.*
116-
paddle/fluid/pir/dialect/operator/ir/pd_pir_op_update.*
117-
paddle/fluid/pir/dialect/operator/ir/pd_op_info.*
118-
paddle/cinn/hlir/dialect/generated/ops.parsed.yaml
119-
paddle/cinn/hlir/dialect/operator/ir/cinn_op.*
120-
paddle/cinn/hlir/dialect/operator/ir/cinn_op_info.*

.gitmodules

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,11 @@
110110
path = third_party/cccl
111111
url = https://github.com/NVIDIA/cccl.git
112112
ignore = dirty
113+
[submodule "third_party/cryptopp"]
114+
path = third_party/cryptopp
115+
url = https://github.com/weidai11/cryptopp.git
116+
ignore = dirty
117+
[submodule "third_party/cryptopp-cmake"]
118+
path = third_party/cryptopp-cmake
119+
url = https://github.com/noloader/cryptopp-cmake.git
120+
ignore = dirty

.pre-commit-config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
# Exclude some unit test files that require tabs.
3737
exclude: |
3838
(?x)^(
39-
test/dygraph_to_static/test_legacy_error.py
39+
test/dygraph_to_static/test_error.py
4040
)$
4141
- repo: local
4242
hooks:
@@ -56,13 +56,8 @@ repos:
5656
hooks:
5757
- id: black
5858
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
59-
- repo: https://github.com/PyCQA/flake8
60-
rev: 5.0.4
61-
hooks:
62-
- id: flake8
63-
args: ["--config=.flake8"]
6459
- repo: https://github.com/astral-sh/ruff-pre-commit
65-
rev: v0.1.5
60+
rev: v0.3.0
6661
hooks:
6762
- id: ruff
6863
args: [--fix, --exit-non-zero-on-fix, --no-cache]

CMakeLists.txt

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,20 @@ option(WITH_XPU "Compile PaddlePaddle with BAIDU KUNLUN XPU" OFF)
5454
option(WITH_XPU_KP "Compile PaddlePaddle with BAIDU XPU compiler " OFF)
5555
option(WITH_XPU_XFT "Compile PaddlePaddle with BAIDU XPU-XFT" OFF)
5656
option(WITH_XPU_PLUGIN "Compile PaddlePaddle with BAIDU XPU plugin" OFF)
57-
option(WITH_XPU_XHPC "Compile PaddlePaddle with BAIDU XPU-HPC library" OFF)
57+
option(WITH_XPU_XHPC "Compile PaddlePaddle with BAIDU XPU-HPC library"
58+
${WITH_XPU})
5859
option(WITH_WIN_DUMP_DBG "Compile with windows core dump debug mode" OFF)
5960
option(WITH_ROCM "Compile PaddlePaddle with ROCM platform" OFF)
6061
option(WITH_IPU "Compile PaddlePaddle with Graphcore IPU" OFF)
6162
option(WITH_ONNXRUNTIME "Compile PaddlePaddle with ONNXRUNTIME" OFF)
6263
option(WITH_CUSPARSELT "Compile PaddlePaddle with CUSPARSELT" OFF)
6364
option(WITH_SETUP_INSTALL "Compile PaddlePaddle with setup.py" OFF)
6465
option(WITH_SHARED_PHI "Compile PaddlePaddle with SHARED LIB of PHI" ON)
65-
option(CINN_ONLY "Compile CINN only in Paddle" OFF)
6666
option(CINN_WITH_CUDNN "Compile CINN with CUDNN support" ON)
67-
67+
option(WITH_PIP_CUDA_LIBRARIES
68+
"Paddle uses the CUDA library provided by NVIDIA" OFF)
69+
option(WITH_NIGHTLY_BUILD
70+
"Compile nightly paddle whl package of the develop branch" OFF)
6871
find_package(Git REQUIRED)
6972

7073
# config GIT_URL with github mirrors to speed up dependent repos clone
@@ -95,6 +98,18 @@ if(WITH_GPU AND WITH_ROCM)
9598
endif()
9699

97100
if(WITH_GPU AND NOT APPLE)
101+
#(Note risemeup1): The cudart dynamic library libcudart.so is used by set CUDA_USE_STATIC_CUDA_RUNTIME and CMAKE_CUDA_FLAGS
102+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL
103+
"x86_64")
104+
set(CUDA_USE_STATIC_CUDA_RUNTIME
105+
OFF
106+
CACHE BOOL "" FORCE)
107+
set(CMAKE_CUDA_FLAGS "--cudart shared")
108+
if(WITH_PIP_CUDA_LIBRARIES)
109+
#(Note risemeup1): Flag 'WITH_PIP_CUDA_LIBRARIES' will be used in dynamic_loader.cc to search for CUDA-related .so files through the Python libraries provided by NVIDIA.
110+
add_definitions(-DWITH_PIP_CUDA_LIBRARIES)
111+
endif()
112+
endif()
98113
enable_language(CUDA)
99114
message(STATUS "CUDA compiler: ${CMAKE_CUDA_COMPILER}, version: "
100115
"${CMAKE_CUDA_COMPILER_ID} ${CMAKE_CUDA_COMPILER_VERSION}")
@@ -112,6 +127,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND CMAKE_CXX_COMPILER_VERSION
112127
endif()
113128

114129
# MUSL build turn off warnings
130+
115131
if(WITH_MUSL)
116132
set(CMAKE_CXX_FLAGS
117133
"${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations -Wno-error=pessimizing-move -Wno-error=deprecated-copy"
@@ -126,7 +142,10 @@ endif()
126142
if(WIN32)
127143
option(MSVC_STATIC_CRT "use static C Runtime library by default" ON)
128144
message("Build static library of PHI")
129-
set(CMAKE_SUPPRESS_REGENERATION ON)
145+
# (Note xuxinyi04): If CMAKE_SUPPRESS_REGENERATION is OFF, which is default, then CMake adds a
146+
# special target on which all other targets depend that checks the build system and optionally
147+
# re-runs CMake to regenerate the build system when the target specification source changes.
148+
set(CMAKE_SUPPRESS_REGENERATION OFF)
130149
set(CMAKE_STATIC_LIBRARY_PREFIX lib)
131150
set(WITH_SHARED_PHI
132151
OFF
@@ -224,6 +243,8 @@ if(WIN32)
224243
"${${flag_var}} /ignore:4049 /ignore:4217 /ignore:4006 /ignore:4221")
225244
if(MSVC_STATIC_CRT)
226245
set(${flag_var} "${${flag_var}} /NODEFAULTLIB:MSVCRT.LIB")
246+
else()
247+
set(${flag_var} "${${flag_var}} /NODEFAULTLIB:LIBCMT.LIB")
227248
endif()
228249
endforeach()
229250

@@ -314,12 +335,11 @@ option(WITH_FLPS "FL PS mode" OFF)
314335
option(WITH_RPC "Compile with rpc support" ${WITH_DISTRIBUTE})
315336
option(WITH_CUDNN_FRONTEND
316337
"Compile with CUDNN Frontend API support (experimental)" OFF)
317-
option(WITH_CUDNN_DSO "Compile PaddlePaddle with cuDNN dynamic-link libraries"
318-
OFF)
319338
option(WITH_SHARED_IR "Compile PaddlePaddle with SHARED LIB of IR" ON)
320339
option(WITH_NVCC_LAZY
321340
"Compile PaddlePaddle with nvcc lazy mode, used for CI-Inference only."
322341
ON)
342+
option(BUILD_WHL_PACKAGE "Build paddle whl package after compilation" ON)
323343

324344
if(WITH_RECORD_BUILDTIME)
325345
set_property(
@@ -410,16 +430,6 @@ if(NOT WITH_GPU AND WITH_NCCL)
410430
CACHE STRING "Disable NCCL when compiling without GPU" FORCE)
411431
endif()
412432

413-
if(NOT WITH_GPU AND WITH_CUDNN_DSO)
414-
message(
415-
WARNING
416-
"Can't compile with cuDNN libraries when compiling without GPU. Force WITH_CUDNN_DSO=OFF."
417-
)
418-
set(WITH_CUDNN_DSO
419-
OFF
420-
CACHE STRING "Disable cuDNN libraries when compiling without GPU" FORCE)
421-
endif()
422-
423433
# force WITH_XPU on when WITH_XPU_KP
424434
if(WITH_XPU_KP AND NOT WITH_XPU)
425435
message(
@@ -598,7 +608,10 @@ include(third_party
598608
)# download, build, install third_party, Contains about 20+ dependencies
599609

600610
include(flags) # set paddle compile flags
601-
611+
include(util) # set unittest and link libs
612+
include(version) # set PADDLE_VERSION
613+
include(coveralls) # set code coverage
614+
include(configure) # add paddle env configuration
602615
#------------- cinn cmake config start --------------
603616

604617
if(WITH_CINN)
@@ -614,20 +627,9 @@ if(WITH_CINN)
614627
add_definitions(-DCINN_WITH_CUDNN)
615628
endif()
616629
endif()
630+
617631
include(cmake/cinn.cmake)
618632
add_definitions(-DPADDLE_WITH_CINN)
619-
620-
if(CINN_ONLY)
621-
add_definitions(-DCINN_WITH_ONLY)
622-
if(WITH_PYTHON)
623-
add_subdirectory(python)
624-
endif()
625-
add_subdirectory(test)
626-
if(NOT WITH_GFLAGS)
627-
add_subdirectory(paddle/utils)
628-
endif()
629-
return()
630-
endif()
631633
endif()
632634

633635
#------------- cinn cmake config end --------------
@@ -638,11 +640,6 @@ if(WITH_PROFILER)
638640
add_definitions(-DWITH_GPERFTOOLS)
639641
endif()
640642

641-
include(util) # set unittest and link libs
642-
include(version) # set PADDLE_VERSION
643-
include(coveralls) # set code coverage
644-
include(configure) # add paddle env configuration
645-
646643
include_directories("${PADDLE_SOURCE_DIR}")
647644

648645
if(WITH_NV_JETSON)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ English | [简体中文](./README_cn.md) | [日本語](./README_ja.md)
1515
Welcome to the PaddlePaddle GitHub.
1616

1717
PaddlePaddle, as the first independent R&D deep learning platform in China, has been officially open-sourced to professional communities since 2016. It is an industrial platform with advanced technologies and rich features that cover core deep learning frameworks, basic model libraries, end-to-end development kits, tools & components as well as service platforms.
18-
PaddlePaddle is originated from industrial practices with dedication and commitments to industrialization. It has been widely adopted by a wide range of sectors including manufacturing, agriculture, enterprise service, and so on while serving more than 8 million developers, 220,000 companies and generating 800,000 models. With such advantages, PaddlePaddle has helped an increasing number of partners commercialize AI.
18+
PaddlePaddle is originated from industrial practices with dedication and commitments to industrialization. It has been widely adopted by a wide range of sectors including manufacturing, agriculture, enterprise service, and so on while serving more than 10.7 million developers, 235,000 companies and generating 860,000 models. With such advantages, PaddlePaddle has helped an increasing number of partners commercialize AI.
1919

2020
## Installation
2121

22-
### Latest PaddlePaddle Release: [v2.5](https://github.com/PaddlePaddle/Paddle/tree/release/2.5)
22+
### Latest PaddlePaddle Release: [v2.6](https://github.com/PaddlePaddle/Paddle/tree/release/2.6)
2323

2424
Our vision is to enable deep learning for everyone via PaddlePaddle.
2525
Please refer to our [release announcement](https://github.com/PaddlePaddle/Paddle/releases) to track the latest features of PaddlePaddle.
@@ -50,7 +50,7 @@ Now our developers can acquire Tesla V100 online computing resources for free. I
5050

5151
- **High-Performance Inference Engines for Comprehensive Deployment Environments**
5252

53-
PaddlePaddle is not only compatible with models trained in 3rd party open-source frameworks , but also offers complete inference products for various production scenarios. Our inference product line includes [Paddle Inference](https://paddle-inference.readthedocs.io/en/master/guides/introduction/index_intro.html): Native inference library for high-performance server and cloud inference; [Paddle Serving](https://github.com/PaddlePaddle/Serving): A service-oriented framework suitable for distributed and pipeline productions; [Paddle Lite](https://github.com/PaddlePaddle/Paddle-Lite): Ultra-Lightweight inference engine for mobile and IoT environments; [Paddle.js](https://www.paddlepaddle.org.cn/paddle/paddlejs): A frontend inference engine for browser and mini-apps. Furthermore, by great amounts of optimization with leading hardware in each scenario, Paddle inference engines outperform most of the other mainstream frameworks.
53+
PaddlePaddle is not only compatible with models trained in 3rd party open-source frameworks , but also offers complete inference products for various production scenarios. Our inference product line includes [Paddle Inference](https://www.paddlepaddle.org.cn/inference/master/guides/introduction/index_intro.html): Native inference library for high-performance server and cloud inference; [FastDeploy](https://github.com/PaddlePaddle/FastDeploy): Easy-to-use and High Performance AI model deployment toolkit for Cloud, Mobile and Edge without-of-the-box and unified experience; [Paddle Lite](https://github.com/PaddlePaddle/Paddle-Lite): Ultra-Lightweight inference engine for mobile and IoT environments; [Paddle.js](https://www.paddlepaddle.org.cn/paddle/paddlejs): A frontend inference engine for browser and mini-apps. Furthermore, by great amounts of optimization with leading hardware in each scenario, Paddle inference engines outperform most of the other mainstream frameworks.
5454

5555
- **Industry-Oriented Models and Libraries with Open Source Repositories**
5656

README_cn.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
欢迎来到 PaddlePaddle GitHub
1616

17-
飞桨(PaddlePaddle)以百度多年的深度学习技术研究和业务应用为基础,是中国首个自主研发、功能完备、 开源开放的产业级深度学习平台,集深度学习核心训练和推理框架、基础模型库、端到端开发套件和丰富的工具组件于一体。目前,飞桨累计开发者800万,服务企业22万家,基于飞桨开源深度学习平台产生了80万个模型。飞桨助力开发者快速实现AI想法,快速上线AI业务。帮助越来越多的行业完成AI赋能,实现产业智能化升级。
17+
飞桨(PaddlePaddle)以百度多年的深度学习技术研究和业务应用为基础,是中国首个自主研发、功能完备、 开源开放的产业级深度学习平台,集深度学习核心训练和推理框架、基础模型库、端到端开发套件和丰富的工具组件于一体。目前,飞桨累计开发者1070万,服务企业23.5万家,基于飞桨开源深度学习平台产生了86万个模型。飞桨助力开发者快速实现AI想法,快速上线AI业务。帮助越来越多的行业完成AI赋能,实现产业智能化升级。
1818

1919
## 安装
2020

21-
### PaddlePaddle最新版本: [v2.5](https://github.com/PaddlePaddle/Paddle/tree/release/2.5)
21+
### PaddlePaddle 最新版本: [v2.6](https://github.com/PaddlePaddle/Paddle/tree/release/2.6)
2222

23-
跟进PaddlePaddle最新特性请参考我们的[版本说明](https://github.com/PaddlePaddle/Paddle/releases)
23+
跟进 PaddlePaddle 最新特性请参考我们的[版本说明](https://github.com/PaddlePaddle/Paddle/releases)
2424

2525
### 安装最新稳定版本
2626

@@ -48,7 +48,7 @@ PaddlePaddle用户可领取**免费Tesla V100在线算力资源**,训练模型
4848

4949
- **支持多端多平台的高性能推理部署工具**
5050

51-
飞桨不仅广泛兼容第三方开源框架训练的模型部署,并且为不同的场景的生产环境提供了完备的推理引擎,包括适用于高性能服务器及云端推理的原生推理库 [Paddle Inference](https://www.paddlepaddle.org.cn/inference/product_introduction/inference_intro.html)面向分布式、流水线生产环境下自动上云、A/B测试等高阶功能的服务化推理框架 [Paddle Serving](https://github.com/PaddlePaddle/Serving),针对于移动端、物联网场景的轻量化推理引擎 [Paddle Lite](https://github.com/PaddlePaddle/Paddle-Lite),以及在浏览器、小程序等环境下使用的前端推理引擎 [Paddle.js](https://www.paddlepaddle.org.cn/paddle/paddlejs)。同时,透过与不同场景下的主流硬件高度适配优化及异构计算的支持, 飞桨的推理性能也领先绝大部分的主流实现。
51+
飞桨不仅广泛兼容第三方开源框架训练的模型部署,并且为不同的场景的生产环境提供了完备的推理引擎,包括适用于高性能服务器及云端推理的原生推理库 [Paddle Inference](https://www.paddlepaddle.org.cn/inference/master/guides/introduction/index_intro.html)全场景、易用灵活、极致高效的AI推理部署工具,支持云边端部署工具 [FastDeploy](https://github.com/PaddlePaddle/FastDeploy),针对于移动端、物联网场景的轻量化推理引擎 [Paddle Lite](https://github.com/PaddlePaddle/Paddle-Lite),以及在浏览器、小程序等环境下使用的前端推理引擎 [Paddle.js](https://www.paddlepaddle.org.cn/paddle/paddlejs)。同时,透过与不同场景下的主流硬件高度适配优化及异构计算的支持, 飞桨的推理性能也领先绝大部分的主流实现。
5252

5353
- **面向产业应用,开源开放覆盖多领域的工业级模型库。**
5454

0 commit comments

Comments
 (0)