Skip to content

Commit

Permalink
Fix pinning to a different RAFT tag (#235)
Browse files Browse the repository at this point in the history
Attempting to pin the version of a raft to a custom fork wasn't working, and it was still using the version installed by conda. Fix by mirroing the `CUML_RAFT_CLONE_ON_PIN` logic found in the cuml cmake files.

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Divye Gala (https://github.com/divyegala)

URL: #235
  • Loading branch information
benfred authored Jul 19, 2024
1 parent f4d7de0 commit 0786591
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 3 additions & 6 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ option(DETECT_CONDA_ENV "Enable detection of conda environment for dependencies"
option(DISABLE_DEPRECATION_WARNINGS "Disable deprecaction warnings " ON)
option(DISABLE_OPENMP "Disable OpenMP" OFF)
option(CUVS_NVTX "Enable nvtx markers" OFF)
option(CUVS_RAFT_CLONE_ON_PIN "Explicitly clone RAFT branch when pinned to non-feature branch" ON)

if((BUILD_TESTS OR BUILD_C_LIBRARY) AND NOT BUILD_CPU_ONLY)

Expand Down Expand Up @@ -101,12 +102,8 @@ message(VERBOSE "cuVS: Disable OpenMP: ${DISABLE_OPENMP}")
message(VERBOSE "cuVS: Enable kernel resource usage info: ${CUDA_ENABLE_KERNELINFO}")
message(VERBOSE "cuVS: Enable lineinfo in nvcc: ${CUDA_ENABLE_LINEINFO}")
message(VERBOSE "cuVS: Enable nvtx markers: ${CUVS_NVTX}")
message(VERBOSE
"cuVS: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}"
)
message(VERBOSE
"cuVS: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}"
)
message(VERBOSE "cuVS: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
message(VERBOSE "cuVS: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}")
message(VERBOSE "cuVS: Build and statically link RAFT libraries: ${CUVS_USE_RAFT_STATIC}")

# Set RMM logging level
Expand Down
10 changes: 8 additions & 2 deletions cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ set(RAFT_FORK "rapidsai")
set(RAFT_PINNED_TAG "branch-${RAPIDS_VERSION_MAJOR_MINOR}")

function(find_and_configure_raft)
set(oneValueArgs VERSION FORK PINNED_TAG USE_RAFT_STATIC ENABLE_NVTX ENABLE_MNMG_DEPENDENCIES)
set(oneValueArgs VERSION FORK PINNED_TAG USE_RAFT_STATIC ENABLE_NVTX ENABLE_MNMG_DEPENDENCIES CLONE_ON_PIN)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

if(PKG_CLONE_ON_PIN AND NOT PKG_PINNED_TAG STREQUAL "branch-${CUML_BRANCH_VERSION_raft}")
if(PKG_CLONE_ON_PIN AND NOT PKG_PINNED_TAG STREQUAL "branch-${RAFT_VERSION}")
message(STATUS "cuVS: RAFT pinned tag found: ${PKG_PINNED_TAG}. Cloning raft locally.")
set(CPM_DOWNLOAD_raft ON)
elseif(PKG_USE_RAFT_STATIC AND (NOT CPM_raft_SOURCE))
Expand Down Expand Up @@ -56,6 +56,7 @@ function(find_and_configure_raft)
)
endfunction()


# Change pinned tag here to test a commit in CI
# To use a different RAFT locally, set the CMake variable
# CPM_raft_SOURCE=/path/to/local/raft
Expand All @@ -65,4 +66,9 @@ find_and_configure_raft(VERSION ${RAFT_VERSION}.00
ENABLE_MNMG_DEPENDENCIES OFF
ENABLE_NVTX OFF
USE_RAFT_STATIC ${CUVS_USE_RAFT_STATIC}
# When PINNED_TAG above doesn't match the default rapids branch,
# force local raft clone in build directory
# even if it's already installed.
CLONE_ON_PIN ${CUVS_RAFT_CLONE_ON_PIN}

)

0 comments on commit 0786591

Please sign in to comment.