From 45c1c1a78115a77e9fcd80521110a98d46fb380c Mon Sep 17 00:00:00 2001 From: akolliasAMD <99202231+akolliasAMD@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:09:30 -0700 Subject: [PATCH] changed the CMake option from AMDGPU_TARGETS to GPU_TARGETS (#1440) --- CMakeLists.txt | 26 +++++++++++++------------- cmake/MSCCLPP.cmake | 4 ++-- install.sh | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2d760752..34d26c847 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,33 +68,33 @@ if (BUILD_LOCAL_GPU_TARGET_ONLY) endif() # Determine which GPU architectures to build for -set(AMDGPU_TARGETS "${DEFAULT_GPUS}" CACHE STRING "Target default GPUs if AMDGPU_TARGETS is not defined.") +set(GPU_TARGETS "${DEFAULT_GPUS}" CACHE STRING "Target default GPUs if GPU_TARGETS is not defined.") # Modify GPU architectures for Address Sanitizer builds by appending "xnack+" if (BUILD_ADDRESS_SANITIZER) SET(amdgpu_targets "") - foreach(amdgpu_target IN LISTS AMDGPU_TARGETS) + foreach(amdgpu_target IN LISTS GPU_TARGETS) if(NOT amdgpu_target STREQUAL "") list(APPEND amdgpu_targets "${amdgpu_target}:xnack+") endif() endforeach() - SET(AMDGPU_TARGETS "${amdgpu_targets}" CACHE STRING "Modified GPU list for Address-Sanitizer enabled build." FORCE) + SET(GPU_TARGETS "${amdgpu_targets}" CACHE STRING "Modified GPU list for Address-Sanitizer enabled build." FORCE) endif() -# Check if clang compiler can offload to AMDGPU_TARGETS +# Check if clang compiler can offload to GPU_TARGETS if (COMMAND rocm_check_target_ids) - message(STATUS "Checking for ROCm support for GPU targets: " "${AMDGPU_TARGETS}") - rocm_check_target_ids(SUPPORTED_GPUS TARGETS ${AMDGPU_TARGETS}) + message(STATUS "Checking for ROCm support for GPU targets: " "${GPU_TARGETS}") + rocm_check_target_ids(SUPPORTED_GPUS TARGETS ${GPU_TARGETS}) else() message(WARNING "Unable to check for supported GPU targets. Falling back to default GPUs.") set(SUPPORTED_GPUS ${DEFAULT_GPUS}) endif() -set(GPU_TARGETS "${SUPPORTED_GPUS}" CACHE STRING "GPU targets to compile for.") -message(STATUS "Compiling for ${GPU_TARGETS}") +set(COMPILING_TARGETS "${SUPPORTED_GPUS}" CACHE STRING "GPU targets to compile for.") +message(STATUS "Compiling for ${COMPILING_TARGETS}") -## NOTE: Reload rocm-cmake in order to update GPU_TARGETS -include(cmake/Dependencies.cmake) # Reloading to use desired GPU_TARGETS instead of defaults +## NOTE: Reload rocm-cmake in order to update COMPILING_TARGETS +include(cmake/Dependencies.cmake) # Reloading to use desired COMPILING_TARGETS instead of defaults # Try to establish ROCM_PATH (for find_package) #================================================================================================== @@ -301,7 +301,7 @@ endif() ## Disable building MSCCL++ if the build environment is invalid ## Currently MSCCL++ is supported only on gfx942 -if (ENABLE_MSCCLPP AND NOT ("gfx942" IN_LIST GPU_TARGETS OR "gfx942:xnack-" IN_LIST GPU_TARGETS OR "gfx942:xnack+" IN_LIST GPU_TARGETS)) +if (ENABLE_MSCCLPP AND NOT ("gfx942" IN_LIST COMPILING_TARGETS OR "gfx942:xnack-" IN_LIST COMPILING_TARGETS OR "gfx942:xnack+" IN_LIST COMPILING_TARGETS)) set(ENABLE_MSCCLPP OFF) message(WARNING "Can only build MSCCL++ for gfx942; disabling MSCCL++ build") endif() @@ -744,7 +744,7 @@ if (HAVE_KERNARG_PRELOAD) endif() ## NOTE: This is currently being handled by rocm-cmake, however may need to be re-enabled in the future -#foreach(target ${GPU_TARGETS}) +#foreach(target ${COMPILING_TARGETS}) # target_compile_options(rccl PRIVATE --offload-arch=${target}) #endforeach() @@ -868,7 +868,7 @@ if(NOT BUILD_SHARED_LIBS) endif() endforeach() - foreach(target ${GPU_TARGETS}) + foreach(target ${COMPILING_TARGETS}) list(APPEND static_link_flags --offload-arch=${target}) endforeach() list(JOIN static_link_flags " " flags_str) diff --git a/cmake/MSCCLPP.cmake b/cmake/MSCCLPP.cmake index 30e225d13..a20a4033e 100644 --- a/cmake/MSCCLPP.cmake +++ b/cmake/MSCCLPP.cmake @@ -73,7 +73,7 @@ if(ENABLE_MSCCLPP) ) message(STATUS "Building mscclpp only for gfx942.") - + mscclpp_cmake_arg(CMAKE_PREFIX_PATH) mscclpp_cmake_arg(CMAKE_INSTALL_RPATH_USE_LINK_PATH) mscclpp_cmake_arg(HIP_COMPILER) @@ -82,7 +82,7 @@ if(ENABLE_MSCCLPP) if(BUILD_ADDRESS_SANITIZER) set(GFX942_VARIANT "gfx942:xnack+") endif() - + download_project(PROJ mscclpp_nccl # GIT_REPOSITORY https://github.com/microsoft/mscclpp.git # GIT_TAG 1e82dd444fc1ed8b7add354eebaab8a94e67d5fc diff --git a/install.sh b/install.sh index ab57e0e2e..d393277dd 100755 --- a/install.sh +++ b/install.sh @@ -219,7 +219,7 @@ fi # Build for specified GPU target(s) only if [[ ! -z "${build_amdgpu_targets}" ]]; then - cmake_common_options="${cmake_common_options} -DAMDGPU_TARGETS=${build_amdgpu_targets}" + cmake_common_options="${cmake_common_options} -DGPU_TARGETS=${build_amdgpu_targets}" fi # shared vs static