Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zbt78 committed May 26, 2024
2 parents 9c7f5dc + 12ecf2e commit a55ebac
Show file tree
Hide file tree
Showing 4,787 changed files with 185,561 additions and 151,483 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ insert_final_newline = true
[*.{c,cc,cxx,cpp,cu,cuh,h,hpp,hxx,kps}]
indent_size = 2

[*.{py,java,r}]
[*.{py,pyi,java,r,toml}]
indent_size = 4

[Dockerfile.*]
indent_size = 4

[.flake8]
indent_size = 4

[*.go]
indent_style = tab
indent_size = 4
76 changes: 76 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This file is migrated from CI script, it's an effort of modenizing our dev infra.
# Code owners are expected to take responsibility for review patches to respective file.

/CMakeLists.txt @wanghuancoder @Aurelius84 @XiaoguangHu01 @qili93
paddle/fluid/eager/autograd_meta.cc @JiabinYang @phlrain
paddle/fluid/eager/autograd_meta.h @JiabinYang @phlrain
paddle/fluid/eager/backward.cc @JiabinYang @phlrain
paddle/fluid/eager/backward.h @JiabinYang @phlrain
paddle/fluid/eager/grad_node_info.cc @JiabinYang @phlrain
paddle/fluid/eager/grad_node_info.h @JiabinYang @phlrain
paddle/fluid/eager/grad_tensor_holder.cc @JiabinYang @phlrain
paddle/fluid/eager/grad_tensor_holder.h @JiabinYang @phlrain
paddle/fluid/eager/tensor_wrapper.h @JiabinYang @phlrain
paddle/fluid/framework/block_desc.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/details/op_registry.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/framework.proto @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/grad_op_desc_maker.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/ir/graph.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/ir/node.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/lod_tensor.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/op_desc.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/operator.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/scope.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/selected_rows.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/tensor.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/framework/unused_var_check.cc @zhiqiu @phlrain
paddle/fluid/framework/var_desc.h @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
paddle/fluid/operators/distributed/send_recv.proto.in @gongweibao @seiriosPlus
paddle/fluid/prim/api/api.yaml @cxxly @xiaoguoguo626807 @Charles-hit @cyber-pioneer @JiabinYang
paddle/fluid/prim/api/composite_backward/composite_backward_api.h @cxxly @xiaoguoguo626807 @Charles-hit @cyber-pioneer @JiabinYang
paddle/fluid/prim/api/composite_backward/composite_double_backward_api.h @cxxly @xiaoguoguo626807 @Charles-hit @cyber-pioneer @JiabinYang
paddle/fluid/prim/api/manual_prim/prim_manual_api.h @cxxly @xiaoguoguo626807 @Charles-hit @cyber-pioneer @JiabinYang
paddle/phi/api/include/tensor.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/attribute.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/dense_tensor.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/device_context.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/infermeta_utils.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/kernel_context.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/kernel_factory.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/kernel_registry.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/kernel_utils.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/meta_tensor.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/tensor_base.h @phlrain @zyfncg @YuanRisheng
paddle/phi/core/tensor_meta.h @phlrain @zyfncg @YuanRisheng
paddle/phi/infermeta/spmd_rules @LiYuRio @ForFishes @zhiqiu
paddle/scripts/paddle_build.bat @zhwesky2010 @wanghuancoder @Aurelius84
paddle/scripts/paddle_build.sh @risemeup1 @zhangbo9674 @XieYunshen
pyproject.toml @SigureMo @gouzil
python/paddle/autograd/backward_utils.py @Aurelius84 @cxxly @xiaoguoguo626807 @changeyoung98
python/paddle/autograd/ir_backward.py @Aurelius84 @cxxly @xiaoguoguo626807 @changeyoung98
python/paddle/base/backward.py @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
python/paddle/base/compiler.py @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
python/paddle/base/dygraph/layers.py @JiabinYang @phlrain
python/paddle/base/framework.py @XiaoguangHu01 @zhiqiu @Xreki @qili93 @Aurelius84
python/paddle/base/__init__.py @phlrain @Aurelius84 @qili93
python/paddle/base/parallel_executor.py @Xreki @zhhsplendid @Aurelius84
python/paddle/base/tests/unittests/white_list/check_op_sequence_batch_1_input_white_list.py @Aurelius84 @phlrain
python/paddle/base/tests/unittests/white_list/check_op_sequence_instance_0_input_white_list.py @Aurelius84 @phlrain
python/paddle/base/tests/unittests/white_list/check_shape_white_list.py @hong19860320 @Aurelius84 @phlrain
python/paddle/base/tests/unittests/white_list/compile_vs_runtime_white_list.py @Aurelius84 @phlrain
python/paddle/base/tests/unittests/white_list/no_check_set_white_list.py @Aurelius84 @phlrain
python/paddle/base/tests/unittests/white_list/no_grad_set_white_list.py @Aurelius84 @phlrain
python/paddle/base/tests/unittests/white_list/op_accuracy_white_list.py @juncaipeng @zhangting2020 @Aurelius84
python/paddle/base/tests/unittests/white_list/op_threshold_white_list.py @juncaipeng @zhangting2020 @Aurelius84
python/paddle/distributed/fleet/__init__.py @sneaxiy @raindrops2sea
python/paddle/distributed/fleet/launch.py @sneaxiy @raindrops2sea
python/paddle/distributed/__init__.py @sneaxiy @raindrops2sea
python/paddle/incubate/autograd/composite_rules.py @cyber-pioneer @xiaoguoguo626807 @Charles-hit @JiabinYang
python/paddle/incubate/autograd/primitives.py @cyber-pioneer @xiaoguoguo626807 @Charles-hit @JiabinYang
python/paddle/_typing @SigureMo @zrr1999 @gouzil
python/requirements.txt @phlrain @jzhang533 @kolinwei
test/dygraph_to_static @SigureMo @Aurelius84 @gouzil
test/sot @SigureMo @Aurelius84 @gouzil
tools/parallel_UT_rule.py @zhwesky2010 @wanghuancoder @Aurelius84
tools/windows/run_unittests.sh @zhwesky2010 @wanghuancoder @Aurelius84
.pre-commit-config.yaml @SigureMo @gouzil
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ paddle/fluid/operators/generated_sparse_op.cc
paddle/fluid/operators/generated_static_op.cc
paddle/fluid/operators/generated_fused_op.cc
paddle/fluid/operators/ops_signature/generated_*.cc
paddle/phi/api/yaml/parsed_apis/
paddle/fluid/operators/generator/parsed_ops/
paddle/fluid/pybind/tmp_eager_op_function_impl.h
paddle/fluid/pybind/eager_op_function_impl.h
paddle/fluid/pybind/eager_op_function_impl.h
Expand All @@ -107,3 +105,4 @@ paddle/phi/kernels/fusion/cutlass/cutlass_kernels/fpA_intB_gemm/autogen/*
paddle/phi/kernels/fusion/cutlass/cutlass_kernels/fpA_intB_gemm/autogen_tmp/*
paddle/fluid/pybind/static_op_function.*
paddle/fluid/pybind/ops_api.cc
python/paddle/tensor/tensor.pyi
8 changes: 6 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
path = third_party/xbyak
url = https://github.com/herumi/xbyak.git
ignore = dirty
[submodule "third_party/mkldnn"]
path = third_party/mkldnn
[submodule "third_party/onednn"]
path = third_party/onednn
url = https://github.com/oneapi-src/oneDNN.git
ignore = dirty
[submodule "third_party/flashattn"]
Expand Down Expand Up @@ -118,3 +118,7 @@
path = third_party/cryptopp-cmake
url = https://github.com/noloader/cryptopp-cmake.git
ignore = dirty
[submodule "third_party/nlohmann_json"]
path = third_party/nlohmann_json
url = https://github.com/nlohmann/json.git
ignore = dirty
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ repos:
hooks:
- id: copyright_checker
name: copyright_checker
entry: python ./tools/codestyle/copyright.hook
entry: python ./tools/codestyle/copyright.py
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps|py|sh)$
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps|py|pyi|sh)$
exclude: |
(?x)^(
paddle/utils/.*|
Expand All @@ -57,7 +57,7 @@ repos:
- id: black
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
rev: v0.3.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --no-cache]
Expand All @@ -67,15 +67,15 @@ repos:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: bash ./tools/codestyle/clang_format.hook -i
entry: bash ./tools/codestyle/clang_format.sh -i
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|xpu|kps)$
- repo: local
hooks:
- id: cpplint-cpp-source
name: cpplint
description: Check C++ code style using cpplint.py.
entry: bash ./tools/codestyle/cpplint_pre_commit.hook
entry: bash ./tools/codestyle/cpplint_pre_commit.sh
language: system
files: \.(cc|cxx|cpp|cu|h|hpp|hxx)$
args:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ option(WITH_PIP_CUDA_LIBRARIES
"Paddle uses the CUDA library provided by NVIDIA" OFF)
option(WITH_NIGHTLY_BUILD
"Compile nightly paddle whl package of the develop branch" OFF)
option(WITH_CPP_TEST "Compile PaddlePaddle skip cpp test" ON)
find_package(Git REQUIRED)

# config GIT_URL with github mirrors to speed up dependent repos clone
Expand Down Expand Up @@ -306,7 +307,6 @@ option(
SANITIZER_TYPE
"Choose the type of sanitizer, options are: Address, Leak, Memory, Thread, Undefined"
OFF)
option(WITH_LITE "Compile Paddle Fluid with Lite Engine" OFF)
option(WITH_CINN "Compile PaddlePaddle with CINN" OFF)
option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
option(WITH_RCCL "Compile PaddlePaddle with RCCL support" ON)
Expand Down
14 changes: 0 additions & 14 deletions ISSUE_TEMPLATE.md

This file was deleted.

22 changes: 21 additions & 1 deletion cmake/cblas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
# Find the CBlas and lapack libraries
#
# It will search MKLML, OpenBlas, reference-cblas, extern-openblas in order.
# On APPLE, accelerate framework (apple's blas implementation) will be
# used, if applicable.
#
# If any cblas implementation found, the following variable will be set.
# CBLAS_PROVIDER # one of MKLML, OPENBLAS, REFERENCE
# CBLAS_PROVIDER # one of MKLML, ACCELERATE, OPENBLAS, REFERENCE
# CBLAS_INC_DIR # the include directory for cblas.
# CBLAS_LIBS # a list of libraries should be linked by paddle.
# # Each library should be full path to object file.
Expand Down Expand Up @@ -45,6 +47,24 @@ if(WITH_MKLML)
"(include: ${CBLAS_INC_DIR}, library: ${CBLAS_LIBRARIES})")
endif()

## find accelerate on apple
if(APPLE AND NOT DEFINED CBLAS_PROVIDER)
find_library(ACCELERATE_FRAMEWORK Accelerate)
if(ACCELERATE_FRAMEWORK)
message(STATUS "Accelerate framework found " "${ACCELERATE_FRAMEWORK}")

set(CBLAS_PROVIDER ACCELERATE)
# no need to setup include dir if it's accelerate
# set(CBLAS_INC_DIR "")
set(CBLAS_LIBRARIES ${ACCELERATE_FRAMEWORK})

add_definitions(-DPADDLE_USE_ACCELERATE)
add_definitions(-DLAPACK_FOUND)
else()
message(WARNING "Accelerate framework not found")
endif()
endif()

## Then find openblas.
if(NOT DEFINED CBLAS_PROVIDER)
set(OPENBLAS_ROOT
Expand Down
32 changes: 19 additions & 13 deletions cmake/cinn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if(WITH_MKL)
add_dependencies(cinn_mklml ${MKLML_PROJECT})
add_definitions(-DCINN_WITH_MKL_CBLAS)
endif()
if(WITH_MKLDNN)
if(WITH_ONEDNN)
add_definitions(-DCINN_WITH_DNNL)
endif()

Expand Down Expand Up @@ -164,6 +164,8 @@ cinn_cc_library(
isl
ginac
pybind
op_fusion
cinn_op_dialect
${jitify_deps})
add_dependencies(cinnapi GEN_LLVM_RUNTIME_IR_HEADER ZLIB::ZLIB)
add_dependencies(cinnapi GEN_LLVM_RUNTIME_IR_HEADER ${core_deps})
Expand All @@ -175,9 +177,9 @@ target_link_libraries(cinnapi ${PYTHON_LIBRARIES})
if(WITH_MKL)
target_link_libraries(cinnapi cinn_mklml)
add_dependencies(cinnapi cinn_mklml)
if(WITH_MKLDNN)
target_link_libraries(cinnapi ${MKLDNN_LIB})
add_dependencies(cinnapi ${MKLDNN_PROJECT})
if(WITH_ONEDNN)
target_link_libraries(cinnapi ${ONEDNN_LIB})
add_dependencies(cinnapi ${ONEDNN_PROJECT})
endif()
endif()

Expand Down Expand Up @@ -220,21 +222,25 @@ function(gen_cinncore LINKTYPE)
schedule_desc_proto
absl
isl
ginac)
ginac
pybind
op_fusion
cinn_op_dialect
${jitify_deps})
add_dependencies(${CINNCORE_TARGET} GEN_LLVM_RUNTIME_IR_HEADER ZLIB::ZLIB)
add_dependencies(${CINNCORE_TARGET} GEN_LLVM_RUNTIME_IR_HEADER ${core_deps})
target_link_libraries(${CINNCORE_TARGET} op_dialect pir phi)
add_dependencies(${CINNCORE_TARGET} op_dialect pir phi)

add_dependencies(${CINNCORE_TARGET} pybind)
# add_dependencies(${CINNCORE_TARGET} pybind)
target_link_libraries(${CINNCORE_TARGET} ${PYTHON_LIBRARIES})

if(WITH_MKL)
target_link_libraries(${CINNCORE_TARGET} cinn_mklml)
add_dependencies(${CINNCORE_TARGET} cinn_mklml)
if(WITH_MKLDNN)
target_link_libraries(${CINNCORE_TARGET} ${MKLDNN_LIB})
add_dependencies(${CINNCORE_TARGET} ${MKLDNN_PROJECT})
if(WITH_ONEDNN)
target_link_libraries(${CINNCORE_TARGET} ${ONEDNN_LIB})
add_dependencies(${CINNCORE_TARGET} ${ONEDNN_PROJECT})
endif()
endif()

Expand All @@ -247,16 +253,16 @@ function(gen_cinncore LINKTYPE)
${CUBLAS}
${CUDNN}
${CURAND}
${CUSOLVER}
${jitify_deps})
${CUSOLVER})
# ${jitify_deps})
if(NVTX_FOUND)
target_link_libraries(${CINNCORE_TARGET} ${CUDA_NVTX_LIB})
endif()
endif()

if(WITH_CUTLASS)
target_link_libraries(cinnapi cutlass)
add_dependencies(cinnapi cutlass)
target_link_libraries(${CINNCORE_TARGET} cutlass)
add_dependencies(${CINNCORE_TARGET} cutlass)
endif()
endfunction()

Expand Down
14 changes: 11 additions & 3 deletions cmake/external/eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,22 @@ endif()

set(EIGEN_INCLUDE_DIR ${SOURCE_DIR})
include_directories(${EIGEN_INCLUDE_DIR})

if(NOT WIN32)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=maybe-uninitialized")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=maybe-uninitialized")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=uninitialized")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=uninitialized")
endif()
endif()
ExternalProject_Add(
extern_eigen3
${EXTERNAL_PROJECT_LOG_ARGS}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${EIGEN_PREFIX_DIR}
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" -Wno-maybe-uninitialized"
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" -Wno-maybe-uninitialized"
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
UPDATE_COMMAND ""
PATCH_COMMAND ${EIGEN_PATCH_COMMAND}
CONFIGURE_COMMAND ""
Expand Down
43 changes: 43 additions & 0 deletions cmake/external/json.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include(ExternalProject)

set(JSON_PREFIX_DIR ${THIRD_PARTY_PATH}/nlohmann_json)
set(JSON_INCLUDE_DIR ${JSON_PREFIX_DIR}/include)

set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/nlohmann_json)
set(SOURCE_INCLUDE_DIR ${SOURCE_DIR}/include)

include_directories(${JSON_INCLUDE_DIR})

set(JSON_BuildTests
OFF
CACHE INTERNAL "")

ExternalProject_Add(
extern_json
${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE}
SOURCE_DIR ${SOURCE_DIR}
PREFIX ${JSON_PREFIX_DIR}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND "")

add_library(json INTERFACE)
#target_include_directories(json PRIVATE ${JSON_INCLUDE_DIR})
add_dependencies(json extern_json)
Loading

0 comments on commit a55ebac

Please sign in to comment.