From f774780889871bac973692417e8e4007a2893d83 Mon Sep 17 00:00:00 2001 From: RedContritio Date: Wed, 7 Jun 2023 22:09:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=93?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E7=BC=96=E8=AF=91=E3=80=91add=20submodule=20?= =?UTF-8?q?pocketfft=20and=20xbyak=20(#54344)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add submodule pocketfft * add submodule xbyak * remove shallow_copy arg --- .gitmodules | 8 ++++++++ cmake/external/pocketfft.cmake | 22 +++++++++++++--------- cmake/external/xbyak.cmake | 4 ++-- cmake/third_party.cmake | 2 +- third_party/pocketfft | 1 + third_party/xbyak | 1 + 6 files changed, 26 insertions(+), 12 deletions(-) create mode 160000 third_party/pocketfft create mode 160000 third_party/xbyak diff --git a/.gitmodules b/.gitmodules index 70cef6c9569..9128f9233f0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,10 @@ path = third_party/protobuf url = https://github.com/protocolbuffers/protobuf.git ignore = dirty +[submodule "third_party/pocketfft"] + path = third_party/pocketfft + url = https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git + ignore = dirty [submodule "third_party/gflags"] path = third_party/gflags url = https://github.com/gflags/gflags.git @@ -62,6 +66,10 @@ path = third_party/cutlass url = https://github.com/NVIDIA/cutlass.git ignore = dirty +[submodule "third_party/xbyak"] + path = third_party/xbyak + url = https://github.com/herumi/xbyak.git + ignore = dirty [submodule "third_party/mkldnn"] path = third_party/mkldnn url = https://github.com/oneapi-src/oneDNN.git diff --git a/cmake/external/pocketfft.cmake b/cmake/external/pocketfft.cmake index f56b92d467b..3599d295602 100644 --- a/cmake/external/pocketfft.cmake +++ b/cmake/external/pocketfft.cmake @@ -19,32 +19,36 @@ set(POCKETFFT_PATH CACHE STRING "A path setting for external_pocketfft path.") set(POCKETFFT_PREFIX_DIR ${POCKETFFT_PATH}) -set(POCKETFFT_REPOSITORY https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git) -set(POCKETFFT_TAG release_for_eigen) - set(POCKETFFT_INCLUDE_DIR ${POCKETFFT_PREFIX_DIR}/src) +set(POCKETFFT_SOURCE_DIR ${POCKETFFT_PREFIX_DIR}/src/extern_pocketfft) message("POCKETFFT_INCLUDE_DIR is ${POCKETFFT_INCLUDE_DIR}") include_directories(${POCKETFFT_INCLUDE_DIR}) +set(POCKETFFT_TAG release_for_eigen) +set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/pocketfft) + if(APPLE) file(TO_NATIVE_PATH ${PADDLE_SOURCE_DIR}/patches/pocketfft/pocketfft_hdronly.h.patch native_dst) set(POCKETFFT_PATCH_COMMAND - git checkout -- . && git checkout ${GLOO_TAG} && patch -Nd - ${POCKETFFT_INCLUDE_DIR}/extern_pocketfft < ${native_dst}) + git checkout -- . && git checkout ${POCKETFFT_TAG} && patch -Nd + ${SOURCE_DIR} < ${native_dst}) endif() ExternalProject_Add( extern_pocketfft - ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${POCKETFFT_REPOSITORY} - GIT_TAG ${POCKETFFT_TAG} + ${EXTERNAL_PROJECT_LOG_ARGS} + SOURCE_DIR ${SOURCE_DIR} PREFIX ${POCKETFFT_PREFIX_DIR} PATCH_COMMAND ${POCKETFFT_PATCH_COMMAND} UPDATE_COMMAND "" CONFIGURE_COMMAND "" - BUILD_COMMAND "" + BUILD_COMMAND + COMMAND ${CMAKE_COMMAND} -E remove_directory ${POCKETFFT_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -E make_directory ${POCKETFFT_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${SOURCE_DIR} + ${POCKETFFT_SOURCE_DIR} INSTALL_COMMAND "" TEST_COMMAND "") diff --git a/cmake/external/xbyak.cmake b/cmake/external/xbyak.cmake index 589056458c1..a146d53d606 100644 --- a/cmake/external/xbyak.cmake +++ b/cmake/external/xbyak.cmake @@ -20,6 +20,7 @@ set(XBYAK_INSTALL_ROOT ${THIRD_PARTY_PATH}/install/xbyak) set(XBYAK_INC_DIR ${XBYAK_INSTALL_ROOT}/include) set(XBYAK_REPOSITORY ${GIT_URL}/herumi/xbyak.git) set(XBYAK_TAG v5.81) # Dec 19, 2019 +set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/xbyak) include_directories(${XBYAK_INC_DIR}) include_directories(${XBYAK_INC_DIR}/xbyak) @@ -33,8 +34,7 @@ add_definitions(-DXBYAK_NO_OP_NAMES) ExternalProject_Add( ${XBYAK_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${XBYAK_REPOSITORY} - GIT_TAG ${XBYAK_TAG} + SOURCE_DIR ${SOURCE_DIR} DEPENDS "" PREFIX ${XBYAK_PREFIX_DIR} UPDATE_COMMAND "" diff --git a/cmake/third_party.cmake b/cmake/third_party.cmake index 8587d025dbb..21877212695 100755 --- a/cmake/third_party.cmake +++ b/cmake/third_party.cmake @@ -441,7 +441,7 @@ if(WITH_DISTRIBUTE endif() if(WITH_XBYAK) - include(external/xbyak) # download, build, install xbyak + include(external/xbyak) # prepare submodule xbyak list(APPEND third_party_deps extern_xbyak) endif() diff --git a/third_party/pocketfft b/third_party/pocketfft new file mode 160000 index 00000000000..ea778e37710 --- /dev/null +++ b/third_party/pocketfft @@ -0,0 +1 @@ +Subproject commit ea778e37710c07723435b1be58235996d1d43a5a diff --git a/third_party/xbyak b/third_party/xbyak new file mode 160000 index 00000000000..4ca0434b4e7 --- /dev/null +++ b/third_party/xbyak @@ -0,0 +1 @@ +Subproject commit 4ca0434b4e78c05e3f3e68bda70e8713668e87d3 -- GitLab