-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
集成了flash attn v2 forward算子 --------- Co-authored-by: oneflow-ci-bot <[email protected]>
- Loading branch information
1 parent
3d7b87d
commit 44ad994
Showing
11 changed files
with
953 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
include(ExternalProject) | ||
|
||
find_package(Threads) | ||
|
||
# NOTE: A git version of 1.6.5 or later is required if this download method is used. | ||
find_package(Git QUIET REQUIRED) | ||
|
||
set(FLASH_ATTENTION_PROJECT flash_attention) | ||
|
||
set(FLASH_ATTENTION_URL https://github.com/Oneflow-Inc/flash-attention-v2.git) | ||
set(FLASH_ATTENTION_TAG eed2e82b880e06237af3e50ceac4cf6728b15645) | ||
|
||
set(FLASH_ATTENTION_INSTALL_DIR ${THIRD_PARTY_DIR}/flash_attention) | ||
set(FLASH_ATTENTION_INCLUDE_DIR ${FLASH_ATTENTION_INSTALL_DIR}/include CACHE PATH "" FORCE) | ||
set(FLASH_ATTENTION_LIBRARY_DIR ${FLASH_ATTENTION_INSTALL_DIR}/lib CACHE PATH "" FORCE) | ||
set(FLASH_ATTENTION_LIBRARIES ${FLASH_ATTENTION_LIBRARY_DIR}/libflash_attention.so) | ||
|
||
if(THIRD_PARTY) | ||
ExternalProject_Add( | ||
${FLASH_ATTENTION_PROJECT} | ||
PREFIX flash_attention | ||
GIT_REPOSITORY ${FLASH_ATTENTION_URL} | ||
GIT_TAG ${FLASH_ATTENTION_TAG} | ||
UPDATE_COMMAND "" | ||
BUILD_BYPRODUCTS ${FLASH_ATTENTION_LIBRARIES} | ||
CMAKE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | ||
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} | ||
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} | ||
-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} | ||
-DCMAKE_CUDA_ARCHITECTURES:STRING=${CMAKE_CUDA_ARCHITECTURES} | ||
CMAKE_CACHE_ARGS | ||
-DCMAKE_CUDA_COMPILER:STRING=${CUDAToolkit_NVCC_EXECUTABLE} | ||
-DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER} | ||
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=${CMAKE_CXX_COMPILER_LAUNCHER} | ||
-DCMAKE_INSTALL_PREFIX:PATH=${FLASH_ATTENTION_INSTALL_DIR} | ||
-DCMAKE_INSTALL_LIBDIR:PATH=${FLASH_ATTENTION_LIBRARY_DIR} | ||
-DCMAKE_INSTALL_MESSAGE:STRING=${CMAKE_INSTALL_MESSAGE} | ||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) | ||
endif(THIRD_PARTY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.