-
Notifications
You must be signed in to change notification settings - Fork 68
Merge CK validation to release/2.6 #2016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
cc09d84
6943678
507e0aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# create INTERFACE target for CK library | ||
# | ||
|
||
# get CK commit hash | ||
execute_process( | ||
COMMAND git -C ${CMAKE_SOURCE_DIR}/third_party submodule status composable_kernel | ||
RESULT_VARIABLE result | ||
OUTPUT_VARIABLE submodule_status | ||
ERROR_VARIABLE submodule_status_error | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(result EQUAL 0) | ||
string(REGEX REPLACE "^[ \t]" "" submodule_status ${submodule_status}) | ||
# extract first 8 characters of the commit hash | ||
string(SUBSTRING "${submodule_status}" 0 8 ck_commit_hash) | ||
else() | ||
message(FATAL_ERROR "Failed to get submodule status for composable_kernel.") | ||
endif() | ||
|
||
# get ROCm version from LoadHIP.cmake | ||
include(${CMAKE_SOURCE_DIR}/cmake/public/LoadHIP.cmake) | ||
akashveramd marked this conversation as resolved.
Show resolved
Hide resolved
akashveramd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# full path for CK library on compute-artifactory.amd.com | ||
set(url "https://compute-artifactory.amd.com/artifactory/rocm-generic-local") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pruthvistony @jeffdaily Should this be a concern about putting artifactory links in a public repo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider reuse the release page of https://github.com/ROCm/composable_kernel There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I don't think https://github.com/ROCm/composable_kernel is an option, since we don't own that repo and I don't think it'd be appropriate to store these artifacts on their repo, given that they are generated using scripts that are not even in their repo. |
||
set(ck_lib_full_path "${url}/torch_ck_gen_lib/ck_${ck_commit_hash}/rocm_${ROCM_VERSION_DEV}/libck_kernels.so") | ||
jithunnair-amd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# set destination | ||
set(destination "${CMAKE_SOURCE_DIR}/torch/lib/libck_kernels.so") | ||
|
||
# download CK library | ||
file(DOWNLOAD ${ck_lib_full_path} ${destination} SHOW_PROGRESS RESULT_VARIABLE download_status) | ||
akashveramd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if(NOT download_status) | ||
message(STATUS "Downloaded CK library successfully.") | ||
else() | ||
message(FATAL_ERROR "Failed to download the CK library from ${SOURCE_URL}.") | ||
endif() | ||
|
||
# create INTERFACE target | ||
add_library(__ck_lib INTERFACE) | ||
|
||
# specify path to CK library | ||
target_link_libraries(__ck_lib INTERFACE ${destination}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the
UNIX
part sinceUSE_ROCM
is defined ascmake_dependent_option(USE_ROCM "Use ROCm" ON "LINUX" OFF)
?Also, please correct indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aotriton.cmake is getting linked similarly using condition if(UNIX AND (USE_FLASH_ATTENTION...
I borrowed the logic from there and linked in a similar way.
Will correct the indentation and the spacing though.