Skip to content

Commit

Permalink
Merge branch 'develop' into triplet_margin_distance_loss
Browse files Browse the repository at this point in the history
  • Loading branch information
yangguohao committed Jun 5, 2022
2 parents 8b00df1 + 58d2949 commit b3e8aea
Show file tree
Hide file tree
Showing 6,187 changed files with 136,966 additions and 99,408 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
125 changes: 125 additions & 0 deletions .cmake-format.py
@@ -0,0 +1,125 @@
# Copyright (c) 2022 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.

# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):

# How wide to allow formatted cmake files
line_width = 80

# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):
# enable comment markup parsing and reflow
enable_markup = False

# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
# statements.
first_comment_is_literal = True

# ----------------------------------
# Options affecting listfile parsing
# ----------------------------------
with section("parse"):
# Additional FLAGS and KWARGS for custom commands
additional_commands = {
"cc_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"nv_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"hip_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"xpu_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"hip_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"hip_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"go_library": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"copy": {
"kwargs": {
"SRCS": '*',
"DSTS": '*',
}
},
"cc_test": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"nv_test": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"hip_test": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"xpu_test": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"go_test": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
},
"py_test": {
"kwargs": {
"SRCS": '*',
"DEPS": '*',
}
}
}
25 changes: 22 additions & 3 deletions .pre-commit-config.yaml
@@ -1,14 +1,19 @@
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
sha: v1.0.1
rev: v1.1.14
hooks:
- id: remove-crlf
files: (?!.*third_party)^.*$ | (?!.*book)^.*$
- repo: https://github.com/PaddlePaddle/mirrors-yapf.git
sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
- repo: https://github.com/google/yapf
sha: v0.32.0
hooks:
- id: yapf
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
exclude: |
(?x)^(
python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py|
python/paddle/fluid/tests/unittests/dygraph_to_static/test_origin_info.py
)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
Expand All @@ -28,6 +33,10 @@ repos:
entry: bash ./tools/codestyle/clang_format.hook -i
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|xpu|kps)$
exclude: |
(?x)^(
paddle/fluid/distributed/ps/thirdparty/round_robin.h
)$
- repo: local
hooks:
- id: cpplint-cpp-source
Expand Down Expand Up @@ -55,3 +64,13 @@ repos:
(?x)^(
paddle/utils/.*
)$
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
# exclude paddle/fluid/operators/CMakeLists.txt, see the comment
# https://github.com/PaddlePaddle/Paddle/pull/43057#pullrequestreview-993471860
exclude: |
(?x)^(
paddle/fluid/operators/CMakeLists.txt
)$
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -255,6 +255,7 @@ option(WITH_POCKETFFT "Compile with pocketfft support" ON)
option(WITH_RECORD_BUILDTIME "Compile PaddlePaddle with record all targets build time" OFF)
option(WITH_CUSTOM_DEVICE "Compile with custom device support" OFF)
option(WITH_ARM_BRPC "Supprot Brpc in Arm" OFF)
option(WITH_FLPS "FL PS mode" OFF)

if(WITH_RECORD_BUILDTIME)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_build_time.sh ${CMAKE_CURRENT_BINARY_DIR}")
Expand Down
45 changes: 22 additions & 23 deletions cmake/FindGperftools.cmake
Expand Up @@ -17,47 +17,46 @@
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers

find_library(GPERFTOOLS_TCMALLOC
find_library(
GPERFTOOLS_TCMALLOC
NAMES tcmalloc
HINTS ${Gperftools_ROOT_DIR}/lib)

find_library(GPERFTOOLS_PROFILER

find_library(
GPERFTOOLS_PROFILER
NAMES profiler
HINTS ${Gperftools_ROOT_DIR}/lib)

find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
find_library(
GPERFTOOLS_TCMALLOC_AND_PROFILER
NAMES tcmalloc_and_profiler
HINTS ${Gperftools_ROOT_DIR}/lib)

find_path(GPERFTOOLS_INCLUDE_DIR
find_path(
GPERFTOOLS_INCLUDE_DIR
NAMES gperftools/heap-profiler.h
HINTS ${Gperftools_ROOT_DIR}/include)

set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Gperftools
DEFAULT_MSG
GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR)
find_package_handle_standard_args(Gperftools DEFAULT_MSG GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR)

mark_as_advanced(
Gperftools_ROOT_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
GPERFTOOLS_TCMALLOC_AND_PROFILER
GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR)
Gperftools_ROOT_DIR GPERFTOOLS_TCMALLOC GPERFTOOLS_PROFILER
GPERFTOOLS_TCMALLOC_AND_PROFILER GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR)

# create IMPORTED targets
if (Gperftools_FOUND AND NOT TARGET gperftools::tcmalloc)
if(Gperftools_FOUND AND NOT TARGET gperftools::tcmalloc)
add_library(gperftools::tcmalloc UNKNOWN IMPORTED)
set_target_properties(gperftools::tcmalloc PROPERTIES
IMPORTED_LOCATION ${GPERFTOOLS_TCMALLOC}
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}")
set_target_properties(
gperftools::tcmalloc
PROPERTIES IMPORTED_LOCATION ${GPERFTOOLS_TCMALLOC}
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}")
add_library(gperftools::profiler UNKNOWN IMPORTED)
set_target_properties(gperftools::profiler PROPERTIES
IMPORTED_LOCATION ${GPERFTOOLS_PROFILER}
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}")
set_target_properties(
gperftools::profiler
PROPERTIES IMPORTED_LOCATION ${GPERFTOOLS_PROFILER}
INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}")
endif()
13 changes: 8 additions & 5 deletions cmake/FindNumPy.cmake
Expand Up @@ -14,24 +14,27 @@ if(NOT PYTHON_EXECUTABLE)
endif()
endif()

if (PYTHON_EXECUTABLE)
if(PYTHON_EXECUTABLE)
# write a python script that finds the numpy path
file(WRITE ${PROJECT_BINARY_DIR}/FindNumpyPath.py
"try: import numpy; print(numpy.get_include())\nexcept:pass\n")
"try: import numpy; print(numpy.get_include())\nexcept:pass\n")

# execute the find script
exec_program("${PYTHON_EXECUTABLE}" ${PROJECT_BINARY_DIR}
exec_program(
"${PYTHON_EXECUTABLE}" ${PROJECT_BINARY_DIR}
ARGS "FindNumpyPath.py"
OUTPUT_VARIABLE NUMPY_PATH)
elseif(_numpy_out)
message(STATUS "Python executable not found.")
endif(PYTHON_EXECUTABLE)

find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h
HINTS "${NUMPY_PATH}" "${PYTHON_INCLUDE_PATH}")
HINTS "${NUMPY_PATH}" "${PYTHON_INCLUDE_PATH}")

if(PYTHON_NUMPY_INCLUDE_DIR)
set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found")
set(PYTHON_NUMPY_FOUND
1
CACHE INTERNAL "Python numpy found")
endif(PYTHON_NUMPY_INCLUDE_DIR)

include(FindPackageHandleStandardArgs)
Expand Down

1 comment on commit b3e8aea

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on b3e8aea Jun 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #40545 Commit ID: b3e8aea contains failed CI.

🔹 Failed: PR-CI-Static-Check

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Windows

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Coverage

Unknown Failed
Unknown Failed

Please sign in to comment.