diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a8892250..0f147006 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,9 +18,7 @@ source: - patches/0001-Force-endian-flag-in-cross-compilation-mode.patch # [arm64 or aarch64 or ppc64le] - patches/0002-Enable-latest-libcxx-on-MacOS.patch # [osx] - patches/0003-Use-mingw-w64-path.patch - - patches/0004-Undo-dmlc-xgboost-9436.patch - - patches/0005-CMake-Explicitly-link-with-CCCL-standalone-or-CTK.patch - - patches/0006-Partial-fix-for-CTK-12.5-10574.patch + - patches/0004-Backport-fixes.patch build: number: {{ build_number }} diff --git a/recipe/patches/0004-Backport-fixes.patch b/recipe/patches/0004-Backport-fixes.patch new file mode 100644 index 00000000..199aac90 --- /dev/null +++ b/recipe/patches/0004-Backport-fixes.patch @@ -0,0 +1,143 @@ +From 7782edc8e004bd3fe10879c52753d6a6de35947d Mon Sep 17 00:00:00 2001 +From: Hyunsu Cho +Date: Fri, 28 Jun 2024 17:38:34 -0700 +Subject: [PATCH] Backport fixes + +* Undo dmlc/xgboost#9436 +* Explicitly link with CCCL (standalone or CTK) (#10624, #10633) +* Partial fix for CTK 12.5 (#10574) +--- + CMakeLists.txt | 27 ++++++++++++++++++--------- + cmake/Utils.cmake | 7 +++---- + src/tree/updater_gpu_common.cuh | 21 ++++++++------------- + src/tree/updater_gpu_hist.cu | 1 + + 4 files changed, 30 insertions(+), 26 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c4ca82937..aa078405f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -224,6 +224,24 @@ if(USE_CUDA) + add_subdirectory(${PROJECT_SOURCE_DIR}/gputreeshap) + + find_package(CUDAToolkit REQUIRED) ++ find_package(CCCL CONFIG) ++ if(NOT CCCL_FOUND) ++ message(STATUS "Standalone CCCL not found. Attempting to use CCCL from CUDA Toolkit...") ++ find_package(CCCL CONFIG ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ if(NOT CCCL_FOUND) ++ message(STATUS "Could not locate CCCL from CUDA Toolkit. Using Thrust and CUB from CUDA Toolkit...") ++ find_package(libcudacxx CONFIG REQUIRED ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ find_package(CUB CONFIG REQUIRED ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ find_package(Thrust CONFIG REQUIRED ++ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) ++ thrust_create_target(Thrust HOST CPP DEVICE CUDA) ++ add_library(CCCL::CCCL INTERFACE IMPORTED GLOBAL) ++ target_link_libraries(CCCL::CCCL INTERFACE libcudacxx::libcudacxx CUB::CUB Thrust) ++ endif() ++ endif() + endif() + + if(FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja") AND +@@ -301,15 +319,6 @@ add_subdirectory(${xgboost_SOURCE_DIR}/plugin) + + if(PLUGIN_RMM) + find_package(rmm REQUIRED) +- +- # Patch the rmm targets so they reference the static cudart +- # Remove this patch once RMM stops specifying cudart requirement +- # (since RMM is a header-only library, it should not specify cudart in its CMake config) +- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) +- list(REMOVE_ITEM rmm_link_libs CUDA::cudart) +- list(APPEND rmm_link_libs CUDA::cudart_static) +- set_target_properties(rmm::rmm PROPERTIES INTERFACE_LINK_LIBRARIES "${rmm_link_libs}") +- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) + endif() + + if(PLUGIN_SYCL) +diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake +index d555f5edf..c1f19fdbb 100644 +--- a/cmake/Utils.cmake ++++ b/cmake/Utils.cmake +@@ -108,12 +108,12 @@ function(xgboost_set_cuda_flags target) + target_compile_definitions(${target} PRIVATE -DXGBOOST_USE_NVTX=1) + endif() + ++ target_link_libraries(${target} ++ PRIVATE CCCL::CCCL CUDA::cudart_static) + target_compile_definitions(${target} PRIVATE -DXGBOOST_USE_CUDA=1) + target_include_directories( + ${target} PRIVATE +- ${xgboost_SOURCE_DIR}/gputreeshap +- ${xgboost_SOURCE_DIR}/rabit/include +- ${CUDAToolkit_INCLUDE_DIRS}) ++ ${xgboost_SOURCE_DIR}/gputreeshap) + + if(MSVC) + target_compile_options(${target} PRIVATE +@@ -240,7 +240,6 @@ macro(xgboost_target_link_libraries target) + + if(USE_CUDA) + xgboost_set_cuda_flags(${target}) +- target_link_libraries(${target} PUBLIC CUDA::cudart_static) + endif() + + if(PLUGIN_RMM) +diff --git a/src/tree/updater_gpu_common.cuh b/src/tree/updater_gpu_common.cuh +index 1c3e6a552..5d999d6d6 100644 +--- a/src/tree/updater_gpu_common.cuh ++++ b/src/tree/updater_gpu_common.cuh +@@ -1,18 +1,13 @@ +-/*! +- * Copyright 2017-2019 XGBoost contributors ++/** ++ * Copyright 2017-2024, XGBoost contributors + */ + #pragma once +-#include +-#include +-#include +-#include +-#include +-#include +-#include "../common/categorical.h" +-#include "../common/device_helpers.cuh" +-#include "../common/random.h" ++#include // for numeric_limits ++#include // for ostream ++ + #include "gpu_hist/histogram.cuh" + #include "param.h" ++#include "xgboost/base.h" + + namespace xgboost::tree { + struct GPUTrainingParam { +@@ -54,8 +49,8 @@ enum DefaultDirection { + }; + + struct DeviceSplitCandidate { +- float loss_chg {-FLT_MAX}; +- DefaultDirection dir {kLeftDir}; ++ float loss_chg{-std::numeric_limits::max()}; ++ DefaultDirection dir{kLeftDir}; + int findex {-1}; + float fvalue {0}; + // categorical split, either it's the split category for OHE or the threshold for partition-based +diff --git a/src/tree/updater_gpu_hist.cu b/src/tree/updater_gpu_hist.cu +index 958fa0331..e126aeb31 100644 +--- a/src/tree/updater_gpu_hist.cu ++++ b/src/tree/updater_gpu_hist.cu +@@ -19,6 +19,7 @@ + #include "../common/cuda_context.cuh" // CUDAContext + #include "../common/device_helpers.cuh" + #include "../common/hist_util.h" ++#include "../common/random.h" // for ColumnSampler, GlobalRandom + #include "../common/timer.h" + #include "../data/ellpack_page.cuh" + #include "../data/ellpack_page.h" +-- +2.45.2 + diff --git a/recipe/patches/0004-Undo-dmlc-xgboost-9436.patch b/recipe/patches/0004-Undo-dmlc-xgboost-9436.patch deleted file mode 100644 index ef25bb7b..00000000 --- a/recipe/patches/0004-Undo-dmlc-xgboost-9436.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3660a4216763d02d48cb1db63f5fee7ad02ad7d4 Mon Sep 17 00:00:00 2001 -From: Hyunsu Cho -Date: Fri, 28 Jun 2024 17:38:34 -0700 -Subject: [PATCH] [PATCH] Undo dmlc/xgboost#9436 - ---- - CMakeLists.txt | 9 --------- - cmake/Utils.cmake | 1 - - 2 files changed, 10 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c4ca82937..dc0f7e654 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -301,15 +301,6 @@ add_subdirectory(${xgboost_SOURCE_DIR}/plugin) - - if(PLUGIN_RMM) - find_package(rmm REQUIRED) -- -- # Patch the rmm targets so they reference the static cudart -- # Remove this patch once RMM stops specifying cudart requirement -- # (since RMM is a header-only library, it should not specify cudart in its CMake config) -- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) -- list(REMOVE_ITEM rmm_link_libs CUDA::cudart) -- list(APPEND rmm_link_libs CUDA::cudart_static) -- set_target_properties(rmm::rmm PROPERTIES INTERFACE_LINK_LIBRARIES "${rmm_link_libs}") -- get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES) - endif() - - if(PLUGIN_SYCL) -diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake -index d555f5edf..8659df7c3 100644 ---- a/cmake/Utils.cmake -+++ b/cmake/Utils.cmake -@@ -240,7 +240,6 @@ macro(xgboost_target_link_libraries target) - - if(USE_CUDA) - xgboost_set_cuda_flags(${target}) -- target_link_libraries(${target} PUBLIC CUDA::cudart_static) - endif() - - if(PLUGIN_RMM) --- -2.34.1 - diff --git a/recipe/patches/0005-CMake-Explicitly-link-with-CCCL-standalone-or-CTK.patch b/recipe/patches/0005-CMake-Explicitly-link-with-CCCL-standalone-or-CTK.patch deleted file mode 100644 index bce9467c..00000000 --- a/recipe/patches/0005-CMake-Explicitly-link-with-CCCL-standalone-or-CTK.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 6e58a81cf201d27c3acb304cdcd991cd46aa421f Mon Sep 17 00:00:00 2001 -From: Hyunsu Cho -Date: Wed, 24 Jul 2024 12:25:04 -0700 -Subject: [PATCH] [CMake] Explicitly link with CCCL (standalone or CTK) - -Also allow building with CCCL that's newer than CTK - -Co-authored-by: jakirkham ---- - CMakeLists.txt | 18 ++++++++++++++++++ - cmake/Utils.cmake | 6 +++--- - 2 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index dc0f7e654..aa078405f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -224,6 +224,24 @@ if(USE_CUDA) - add_subdirectory(${PROJECT_SOURCE_DIR}/gputreeshap) - - find_package(CUDAToolkit REQUIRED) -+ find_package(CCCL CONFIG) -+ if(NOT CCCL_FOUND) -+ message(STATUS "Standalone CCCL not found. Attempting to use CCCL from CUDA Toolkit...") -+ find_package(CCCL CONFIG -+ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) -+ if(NOT CCCL_FOUND) -+ message(STATUS "Could not locate CCCL from CUDA Toolkit. Using Thrust and CUB from CUDA Toolkit...") -+ find_package(libcudacxx CONFIG REQUIRED -+ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) -+ find_package(CUB CONFIG REQUIRED -+ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) -+ find_package(Thrust CONFIG REQUIRED -+ HINTS ${CUDAToolkit_LIBRARY_DIR}/cmake) -+ thrust_create_target(Thrust HOST CPP DEVICE CUDA) -+ add_library(CCCL::CCCL INTERFACE IMPORTED GLOBAL) -+ target_link_libraries(CCCL::CCCL INTERFACE libcudacxx::libcudacxx CUB::CUB Thrust) -+ endif() -+ endif() - endif() - - if(FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja") AND -diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake -index 8659df7c3..c1f19fdbb 100644 ---- a/cmake/Utils.cmake -+++ b/cmake/Utils.cmake -@@ -108,12 +108,12 @@ function(xgboost_set_cuda_flags target) - target_compile_definitions(${target} PRIVATE -DXGBOOST_USE_NVTX=1) - endif() - -+ target_link_libraries(${target} -+ PRIVATE CCCL::CCCL CUDA::cudart_static) - target_compile_definitions(${target} PRIVATE -DXGBOOST_USE_CUDA=1) - target_include_directories( - ${target} PRIVATE -- ${xgboost_SOURCE_DIR}/gputreeshap -- ${xgboost_SOURCE_DIR}/rabit/include -- ${CUDAToolkit_INCLUDE_DIRS}) -+ ${xgboost_SOURCE_DIR}/gputreeshap) - - if(MSVC) - target_compile_options(${target} PRIVATE --- -2.34.1 - diff --git a/recipe/patches/0006-Partial-fix-for-CTK-12.5-10574.patch b/recipe/patches/0006-Partial-fix-for-CTK-12.5-10574.patch deleted file mode 100644 index e2d63261..00000000 --- a/recipe/patches/0006-Partial-fix-for-CTK-12.5-10574.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 5fa754ff95d7f7bca4a68c1c23c299417de86de0 Mon Sep 17 00:00:00 2001 -From: Jiaming Yuan -Date: Tue, 16 Jul 2024 17:41:50 +0800 -Subject: [PATCH] Partial fix for CTK 12.5 (#10574) - ---- - src/tree/updater_gpu_common.cuh | 21 ++++++++------------- - src/tree/updater_gpu_hist.cu | 1 + - 2 files changed, 9 insertions(+), 13 deletions(-) - -diff --git a/src/tree/updater_gpu_common.cuh b/src/tree/updater_gpu_common.cuh -index 1c3e6a552..5d999d6d6 100644 ---- a/src/tree/updater_gpu_common.cuh -+++ b/src/tree/updater_gpu_common.cuh -@@ -1,18 +1,13 @@ --/*! -- * Copyright 2017-2019 XGBoost contributors -+/** -+ * Copyright 2017-2024, XGBoost contributors - */ - #pragma once --#include --#include --#include --#include --#include --#include --#include "../common/categorical.h" --#include "../common/device_helpers.cuh" --#include "../common/random.h" -+#include // for numeric_limits -+#include // for ostream -+ - #include "gpu_hist/histogram.cuh" - #include "param.h" -+#include "xgboost/base.h" - - namespace xgboost::tree { - struct GPUTrainingParam { -@@ -54,8 +49,8 @@ enum DefaultDirection { - }; - - struct DeviceSplitCandidate { -- float loss_chg {-FLT_MAX}; -- DefaultDirection dir {kLeftDir}; -+ float loss_chg{-std::numeric_limits::max()}; -+ DefaultDirection dir{kLeftDir}; - int findex {-1}; - float fvalue {0}; - // categorical split, either it's the split category for OHE or the threshold for partition-based -diff --git a/src/tree/updater_gpu_hist.cu b/src/tree/updater_gpu_hist.cu -index 958fa0331..e126aeb31 100644 ---- a/src/tree/updater_gpu_hist.cu -+++ b/src/tree/updater_gpu_hist.cu -@@ -19,6 +19,7 @@ - #include "../common/cuda_context.cuh" // CUDAContext - #include "../common/device_helpers.cuh" - #include "../common/hist_util.h" -+#include "../common/random.h" // for ColumnSampler, GlobalRandom - #include "../common/timer.h" - #include "../data/ellpack_page.cuh" - #include "../data/ellpack_page.h" --- -2.34.1 -