-
Notifications
You must be signed in to change notification settings - Fork 234
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
Fix ucx build #938
Fix ucx build #938
Changes from 7 commits
e796bc9
4def3b3
5cb3892
fdeb31f
d7c8dc9
ef4513b
35a3e6e
d17f626
258ae7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,9 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |
STRING "Choose the type of build." FORCE) | ||
endif() | ||
|
||
# set std 11 | ||
set (CMAKE_CXX_STANDARD 11) | ||
|
||
# do not disable assertions even if in release mode | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG") | ||
|
||
|
@@ -43,106 +46,15 @@ option(FF_USE_PREBUILT_NCCL "Enable use of NCCL pre-compiled library, if availab | |
option(FF_USE_PREBUILT_LEGION "Enable use of Legion pre-compiled library, if available" ON) | ||
option(FF_USE_ALL_PREBUILT_LIBRARIES "Enable use of all pre-compiled libraries, if available" OFF) | ||
|
||
# option for using Python | ||
set(FF_GASNET_CONDUITS aries udp mpi ibv ucx) | ||
# option for using network | ||
set(FF_GASNET_CONDUITS aries udp mpi ibv) | ||
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. Why do we remove ucx as an opinion? 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. It is prefer to use the realm ucx module over gastnet ucx conduit, so I think it is not necessary to provide the ucx option. |
||
set(FF_GASNET_CONDUIT "mpi" CACHE STRING "Select GASNet conduit ${FF_GASNET_CONDUITS}") | ||
set_property(CACHE FF_GASNET_CONDUIT PROPERTY STRINGS ${FF_GASNET_CONDUITS}) | ||
set(FF_LEGION_NETWORKS "" CACHE STRING "Network backend(s) to use") | ||
|
||
if ((FF_LEGION_NETWORKS STREQUAL "gasnet" AND FF_GASNET_CONDUIT STREQUAL "ucx") OR FF_LEGION_NETWORKS STREQUAL "ucx") | ||
if("${FF_UCX_URL}" STREQUAL "") | ||
set(UCX_URL "https://github.com/openucx/ucx/releases/download/v1.14.0-rc1/ucx-1.14.0.tar.gz") | ||
else() | ||
set(UCX_URL "${FF_UCX_URL}") | ||
endif() | ||
|
||
set(UCX_DIR ${CMAKE_CURRENT_BINARY_DIR}/ucx) | ||
get_filename_component(UCX_COMPRESSED_FILE_NAME "${UCX_URL}" NAME) | ||
# message(STATUS "UCX_URL: ${UCX_URL}") | ||
# message(STATUS "UCX_COMPRESSED_FILE_NAME: ${UCX_COMPRESSED_FILE_NAME}") | ||
set(UCX_COMPRESSED_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${UCX_COMPRESSED_FILE_NAME}") | ||
set(UCX_BUILD_NEEDED OFF) | ||
set(UCX_CONFIG_FILE ${UCX_DIR}/config.txt) | ||
set(UCX_BUILD_OUTPUT ${UCX_DIR}/build.log) | ||
|
||
if(EXISTS ${UCX_CONFIG_FILE}) | ||
file(READ ${UCX_CONFIG_FILE} PREV_UCX_CONFIG) | ||
# message(STATUS "PREV_UCX_CONFIG: ${PREV_UCX_CONFIG}") | ||
if("${UCX_URL}" STREQUAL "${PREV_UCX_CONFIG}") | ||
# configs match - no build needed | ||
set(UCX_BUILD_NEEDED OFF) | ||
else() | ||
message(STATUS "UCX configuration has changed - rebuilding...") | ||
set(UCX_BUILD_NEEDED ON) | ||
endif() | ||
else() | ||
message(STATUS "Configuring and building UCX...") | ||
set(UCX_BUILD_NEEDED ON) | ||
endif() | ||
|
||
if(UCX_BUILD_NEEDED) | ||
if(NOT EXISTS "${UCX_COMPRESSED_FILE_PATH}") | ||
message(STATUS "Downloading openucx/ucx from: ${UCX_URL}") | ||
file( | ||
DOWNLOAD | ||
"${UCX_URL}" "${UCX_COMPRESSED_FILE_PATH}" | ||
SHOW_PROGRESS | ||
STATUS status | ||
LOG log | ||
) | ||
|
||
list(GET status 0 status_code) | ||
list(GET status 1 status_string) | ||
|
||
if(status_code EQUAL 0) | ||
message(STATUS "Downloading... done") | ||
else() | ||
message(FATAL_ERROR "error: downloading '${UCX_URL}' failed | ||
status_code: ${status_code} | ||
status_string: ${status_string} | ||
log: | ||
--- LOG BEGIN --- | ||
${log} | ||
--- LOG END ---" | ||
) | ||
endif() | ||
else() | ||
message(STATUS "${UCX_COMPRESSED_FILE_NAME} already exists") | ||
endif() | ||
|
||
execute_process(COMMAND mkdir -p ${UCX_DIR}) | ||
execute_process(COMMAND tar xzf ${UCX_COMPRESSED_FILE_PATH} -C ${UCX_DIR} --strip-components 1) | ||
message(STATUS "Building UCX...") | ||
execute_process( | ||
COMMAND sh -c "cd ${UCX_DIR} && ${UCX_DIR}/contrib/configure-release --prefix=${UCX_DIR}/install --enable-mt && make -j8 && make install" | ||
RESULT_VARIABLE UCX_BUILD_STATUS | ||
OUTPUT_FILE ${UCX_BUILD_OUTPUT} | ||
ERROR_FILE ${UCX_BUILD_OUTPUT} | ||
) | ||
|
||
if(UCX_BUILD_STATUS) | ||
message(FATAL_ERROR "UCX build result = ${UCX_BUILD_STATUS} - see ${UCX_BUILD_OUTPUT} for more details") | ||
endif() | ||
|
||
# Currently, we use default build configurations for UCX and therefore only save URL as configuration settings | ||
file(WRITE ${UCX_CONFIG_FILE} "${UCX_URL}") | ||
endif() | ||
|
||
if (FF_LEGION_NETWORKS STREQUAL "gasnet" AND FF_GASNET_CONDUIT STREQUAL "ucx") | ||
set(ENV{UCX_HOME} "${UCX_DIR}/install") | ||
install(DIRECTORY ${UCX_DIR}/install/bin/ DESTINATION bin) | ||
install(DIRECTORY ${UCX_DIR}/install/include/ DESTINATION include) | ||
install(DIRECTORY ${UCX_DIR}/install/lib/ DESTINATION lib) | ||
install(DIRECTORY ${UCX_DIR}/install/share/ DESTINATION share) | ||
endif() | ||
|
||
if (FF_LEGION_NETWORKS STREQUAL "ucx") | ||
set(ucx_DIR ${UCX_DIR}/cmake) | ||
set(ENV{Legion_NETWORKS} "ucx") | ||
message(STATUS "Legion_NETWORKS: $ENV{Legion_NETWORKS}") | ||
endif() | ||
else() | ||
message(STATUS "FF_GASNET_CONDUIT: ${FF_GASNET_CONDUIT}") | ||
message(STATUS "FF_LEGION_NETWORKS: ${FF_LEGION_NETWORKS}") | ||
if (FF_LEGION_NETWORKS STREQUAL "gasnet") | ||
message(STATUS "FF_GASNET_CONDUIT: ${FF_GASNET_CONDUIT}") | ||
endif() | ||
|
||
set(FF_GPU_BACKENDS cuda hip_cuda hip_rocm intel) | ||
|
@@ -179,13 +91,6 @@ set(CC_FLAGS $ENV{CC_FLAGS}) | |
set(NVCC_FLAGS $ENV{NVCC_FLAGS}) | ||
set(LD_FLAGS $ENV{LD_FLAGS}) | ||
|
||
# Set global FLAGS | ||
list(APPEND CC_FLAGS | ||
-std=c++11) | ||
|
||
list(APPEND NVCC_FLAGS | ||
-std=c++11) | ||
|
||
add_compile_options(${CC_FLAGS}) | ||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ${NVCC_FLAGS}) | ||
link_libraries(${LD_FLAGS}) | ||
|
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.
@lockshaw Have we reached out the agreement that FlexFlow will use c++17 moving forward?