未验证 提交 20a9d2fd 编写于 作者: W Wang Xin 提交者: GitHub

third-party lib offline compilation support for mkldnn flashattn gtest (#54319)

* third-party lib offline compilation support for mkldnn flashattn and gtest

* fix bug

* ignore dirty
上级 82dd6b15
...@@ -50,3 +50,15 @@ ...@@ -50,3 +50,15 @@
path = third_party/eigen3 path = third_party/eigen3
url = https://gitlab.com/libeigen/eigen.git url = https://gitlab.com/libeigen/eigen.git
ignore = dirty 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
...@@ -19,7 +19,7 @@ add_definitions(-DPADDLE_WITH_FLASHATTN) ...@@ -19,7 +19,7 @@ add_definitions(-DPADDLE_WITH_FLASHATTN)
set(FLASHATTN_PREFIX_DIR ${THIRD_PARTY_PATH}/flashattn) set(FLASHATTN_PREFIX_DIR ${THIRD_PARTY_PATH}/flashattn)
set(FLASHATTN_SOURCE_SUBDIR csrc/flash_attn) set(FLASHATTN_SOURCE_SUBDIR csrc/flash_attn)
set(FLASHATTN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/flashattn) 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_TAG 18106c1ba0ccee81b97ca947397c08a141815a47)
set(FLASHATTN_INCLUDE_DIR set(FLASHATTN_INCLUDE_DIR
...@@ -69,9 +69,8 @@ endif() ...@@ -69,9 +69,8 @@ endif()
ExternalProject_Add( ExternalProject_Add(
extern_flashattn extern_flashattn
${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} ${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY ${FLASHATTN_REPOSITORY} SOURCE_DIR ${SOURCE_DIR}
GIT_TAG ${FLASHATTN_TAG}
PREFIX ${FLASHATTN_PREFIX_DIR} PREFIX ${FLASHATTN_PREFIX_DIR}
SOURCE_SUBDIR ${FLASHATTN_SOURCE_SUBDIR} SOURCE_SUBDIR ${FLASHATTN_SOURCE_SUBDIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
......
...@@ -26,7 +26,7 @@ set(GTEST_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gtest) ...@@ -26,7 +26,7 @@ set(GTEST_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gtest)
set(GTEST_INCLUDE_DIR set(GTEST_INCLUDE_DIR
"${GTEST_INSTALL_DIR}/include" "${GTEST_INSTALL_DIR}/include"
CACHE PATH "gtest include directory." FORCE) 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_TAG release-1.8.1)
set(GTEST_SOURCE_DIR ${THIRD_PARTY_PATH}/gtest/src/extern_gtest) set(GTEST_SOURCE_DIR ${THIRD_PARTY_PATH}/gtest/src/extern_gtest)
include_directories(${GTEST_INCLUDE_DIR}) include_directories(${GTEST_INCLUDE_DIR})
...@@ -69,14 +69,13 @@ if(NOT WIN32 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0) ...@@ -69,14 +69,13 @@ if(NOT WIN32 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 12.0)
# See: [Why calling some `git` commands before `patch`?] # See: [Why calling some `git` commands before `patch`?]
set(GTEST_PATCH_COMMAND set(GTEST_PATCH_COMMAND
git checkout -- . && git checkout ${GTEST_TAG} && patch -Nd git checkout -- . && git checkout ${GTEST_TAG} && patch -Nd
${GTEST_SOURCE_DIR}/googletest/src < ${native_src}) ${SOURCE_DIR}/googletest/src < ${native_src})
endif() endif()
if(WIN32) if(WIN32)
ExternalProject_Add( ExternalProject_Add(
extern_gtest extern_gtest
${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} ${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY ${GTEST_REPOSITORY} SOURCE_DIR ${SOURCE_DIR}
GIT_TAG ${GTEST_TAG}
DEPENDS ${GTEST_DEPENDS} DEPENDS ${GTEST_DEPENDS}
PREFIX ${GTEST_PREFIX_DIR} PREFIX ${GTEST_PREFIX_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
...@@ -106,9 +105,8 @@ if(WIN32) ...@@ -106,9 +105,8 @@ if(WIN32)
else() else()
ExternalProject_Add( ExternalProject_Add(
extern_gtest extern_gtest
${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} ${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY ${GTEST_REPOSITORY} SOURCE_DIR ${SOURCE_DIR}
GIT_TAG ${GTEST_TAG}
DEPENDS ${GTEST_DEPENDS} DEPENDS ${GTEST_DEPENDS}
PREFIX ${GTEST_PREFIX_DIR} PREFIX ${GTEST_PREFIX_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
......
...@@ -20,7 +20,7 @@ set(MKLDNN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/mkldnn) ...@@ -20,7 +20,7 @@ set(MKLDNN_INSTALL_DIR ${THIRD_PARTY_PATH}/install/mkldnn)
set(MKLDNN_INC_DIR set(MKLDNN_INC_DIR
"${MKLDNN_INSTALL_DIR}/include" "${MKLDNN_INSTALL_DIR}/include"
CACHE PATH "mkldnn include directory." FORCE) 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) set(MKLDNN_TAG 2089770c4818be8933c5e9d1dd3cbaeba1457667)
# Introduce variables: # Introduce variables:
...@@ -69,9 +69,8 @@ endif() ...@@ -69,9 +69,8 @@ endif()
ExternalProject_Add( ExternalProject_Add(
${MKLDNN_PROJECT} ${MKLDNN_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} ${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY ${MKLDNN_REPOSITORY} SOURCE_DIR ${SOURCE_DIR}
GIT_TAG ${MKLDNN_TAG}
DEPENDS ${MKLDNN_DEPENDS} DEPENDS ${MKLDNN_DEPENDS}
PREFIX ${MKLDNN_PREFIX_DIR} PREFIX ${MKLDNN_PREFIX_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
......
Subproject commit 18106c1ba0ccee81b97ca947397c08a141815a47
Subproject commit 2fe3bd994b3189899d93f1d5a881e725e046fdc2
Subproject commit 2089770c4818be8933c5e9d1dd3cbaeba1457667
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册