diff --git a/.gitmodules b/.gitmodules index 8c294e25bd6095ee8bbc9f51d82ffebbf1bd7bcf..67437e82e8e0f1c5f332c5e0f35c87ff3edb11e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -50,3 +50,15 @@ path = third_party/eigen3 url = https://gitlab.com/libeigen/eigen.git ignore = dirty +[submodule "third_party/mkldnn"] + path = third_party/mkldnn + url = https://github.com/oneapi-src/oneDNN.git + ignore = dirty +[submodule "third_party/flashattn"] + path = third_party/flashattn + url = https://github.com/PaddlePaddle/flash-attention.git + ignore = dirty +[submodule "third_party/gtest"] + path = third_party/gtest + url = https://github.com/google/googletest.git + ignore = dirty diff --git a/cmake/external/flashattn.cmake b/cmake/external/flashattn.cmake index 68957406756254def8bcc3fc8d62e849be690926..b071f25dd4d3a57d4585a87ffcbcf14189773e24 100644 --- a/cmake/external/flashattn.cmake +++ b/cmake/external/flashattn.cmake @@ -19,7 +19,7 @@ add_definitions(-DPADDLE_WITH_FLASHATTN) set(FLASHATTN_PREFIX_DIR ${THIRD_PARTY_PATH}/flashattn) set(FLASHATTN_SOURCE_SUBDIR csrc/flash_attn) set(FLASHATTN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/flashattn) -set(FLASHATTN_REPOSITORY ${GIT_URL}/PaddlePaddle/flash-attention.git) +set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/flashattn) set(FLASHATTN_TAG 18106c1ba0ccee81b97ca947397c08a141815a47) set(FLASHATTN_INCLUDE_DIR @@ -69,9 +69,8 @@ endif() ExternalProject_Add( extern_flashattn - ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${FLASHATTN_REPOSITORY} - GIT_TAG ${FLASHATTN_TAG} + ${EXTERNAL_PROJECT_LOG_ARGS} + SOURCE_DIR ${SOURCE_DIR} PREFIX ${FLASHATTN_PREFIX_DIR} SOURCE_SUBDIR ${FLASHATTN_SOURCE_SUBDIR} UPDATE_COMMAND "" diff --git a/cmake/external/gtest.cmake b/cmake/external/gtest.cmake index 777d37a023f059bde9e44f810849db11e650369a..f71e6e09b07c499b3e40474a7cc35c3c7b5ca9bd 100644 --- a/cmake/external/gtest.cmake +++ b/cmake/external/gtest.cmake @@ -26,7 +26,7 @@ set(GTEST_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gtest) set(GTEST_INCLUDE_DIR "${GTEST_INSTALL_DIR}/include" CACHE PATH "gtest include directory." FORCE) -set(GTEST_REPOSITORY ${GIT_URL}/google/googletest.git) +set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/gtest) set(GTEST_TAG release-1.8.1) set(GTEST_SOURCE_DIR ${THIRD_PARTY_PATH}/gtest/src/extern_gtest) include_directories(${GTEST_INCLUDE_DIR}) @@ -69,14 +69,13 @@ if(NOT WIN32 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0) # See: [Why calling some `git` commands before `patch`?] set(GTEST_PATCH_COMMAND git checkout -- . && git checkout ${GTEST_TAG} && patch -Nd - ${GTEST_SOURCE_DIR}/googletest/src < ${native_src}) + ${SOURCE_DIR}/googletest/src < ${native_src}) endif() if(WIN32) ExternalProject_Add( extern_gtest - ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${GTEST_REPOSITORY} - GIT_TAG ${GTEST_TAG} + ${EXTERNAL_PROJECT_LOG_ARGS} + SOURCE_DIR ${SOURCE_DIR} DEPENDS ${GTEST_DEPENDS} PREFIX ${GTEST_PREFIX_DIR} UPDATE_COMMAND "" @@ -106,9 +105,8 @@ if(WIN32) else() ExternalProject_Add( extern_gtest - ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${GTEST_REPOSITORY} - GIT_TAG ${GTEST_TAG} + ${EXTERNAL_PROJECT_LOG_ARGS} + SOURCE_DIR ${SOURCE_DIR} DEPENDS ${GTEST_DEPENDS} PREFIX ${GTEST_PREFIX_DIR} UPDATE_COMMAND "" diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index 00a83a37893d9b9f91e37f8297393a27de98b2de..03e66635f4c55f034da77aa427b42062ea1efa8f 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -20,7 +20,7 @@ set(MKLDNN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/mkldnn) set(MKLDNN_INC_DIR "${MKLDNN_INSTALL_DIR}/include" CACHE PATH "mkldnn include directory." FORCE) -set(MKLDNN_REPOSITORY ${GIT_URL}/oneapi-src/oneDNN.git) +set(SOURCE_DIR ${PADDLE_SOURCE_DIR}/third_party/mkldnn) set(MKLDNN_TAG 2089770c4818be8933c5e9d1dd3cbaeba1457667) # Introduce variables: @@ -69,9 +69,8 @@ endif() ExternalProject_Add( ${MKLDNN_PROJECT} - ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - GIT_REPOSITORY ${MKLDNN_REPOSITORY} - GIT_TAG ${MKLDNN_TAG} + ${EXTERNAL_PROJECT_LOG_ARGS} + SOURCE_DIR ${SOURCE_DIR} DEPENDS ${MKLDNN_DEPENDS} PREFIX ${MKLDNN_PREFIX_DIR} UPDATE_COMMAND "" diff --git a/third_party/flashattn b/third_party/flashattn new file mode 160000 index 0000000000000000000000000000000000000000..18106c1ba0ccee81b97ca947397c08a141815a47 --- /dev/null +++ b/third_party/flashattn @@ -0,0 +1 @@ +Subproject commit 18106c1ba0ccee81b97ca947397c08a141815a47 diff --git a/third_party/gtest b/third_party/gtest new file mode 160000 index 0000000000000000000000000000000000000000..2fe3bd994b3189899d93f1d5a881e725e046fdc2 --- /dev/null +++ b/third_party/gtest @@ -0,0 +1 @@ +Subproject commit 2fe3bd994b3189899d93f1d5a881e725e046fdc2 diff --git a/third_party/mkldnn b/third_party/mkldnn new file mode 160000 index 0000000000000000000000000000000000000000..2089770c4818be8933c5e9d1dd3cbaeba1457667 --- /dev/null +++ b/third_party/mkldnn @@ -0,0 +1 @@ +Subproject commit 2089770c4818be8933c5e9d1dd3cbaeba1457667