From 6e6881719e3db2f9c3a5a744357d496df801c419 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 5 Dec 2024 12:11:49 -0600 Subject: [PATCH 1/4] Remove Thrust patch in favor of CMake definition for Thrust 32-bit offset types. --- cpp/cmake/thirdparty/get_cccl.cmake | 8 ++++++- .../thirdparty/patches/cccl_override.json | 5 ----- .../thrust_disable_64bit_dispatching.diff | 22 ------------------- 3 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 cpp/cmake/thirdparty/patches/thrust_disable_64bit_dispatching.diff diff --git a/cpp/cmake/thirdparty/get_cccl.cmake b/cpp/cmake/thirdparty/get_cccl.cmake index 5494ad018fb..f5e459519a9 100644 --- a/cpp/cmake/thirdparty/get_cccl.cmake +++ b/cpp/cmake/thirdparty/get_cccl.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -36,6 +36,12 @@ function(find_and_configure_cccl) # Find or install CCCL with our custom set of patches rapids_cpm_cccl(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports) + # Remove this after upgrading to a CCCL that has a proper CMake option. See + # https://github.com/NVIDIA/cccl/pull/2844 + target_compile_definitions( + cudf PRIVATE THRUST_FORCE_64_BIT_OFFSET_TYPE=0 THRUST_FORCE_32_BIT_OFFSET_TYPE=1 + ) + endfunction() find_and_configure_cccl() diff --git a/cpp/cmake/thirdparty/patches/cccl_override.json b/cpp/cmake/thirdparty/patches/cccl_override.json index 2f29578f7ae..d5cadce40c2 100644 --- a/cpp/cmake/thirdparty/patches/cccl_override.json +++ b/cpp/cmake/thirdparty/patches/cccl_override.json @@ -3,11 +3,6 @@ "packages" : { "CCCL" : { "patches" : [ - { - "file" : "${current_json_dir}/thrust_disable_64bit_dispatching.diff", - "issue" : "Remove 64bit dispatching as not needed by libcudf and results in compiling twice as many kernels [https://github.com/rapidsai/cudf/pull/11437]", - "fixed_in" : "" - }, { "file" : "${current_json_dir}/thrust_faster_sort_compile_times.diff", "issue" : "Improve Thrust sort compile times by not unrolling loops for inlined comparators [https://github.com/rapidsai/cudf/pull/10577]", diff --git a/cpp/cmake/thirdparty/patches/thrust_disable_64bit_dispatching.diff b/cpp/cmake/thirdparty/patches/thrust_disable_64bit_dispatching.diff deleted file mode 100644 index 9f68d85e7db..00000000000 --- a/cpp/cmake/thirdparty/patches/thrust_disable_64bit_dispatching.diff +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/thrust/thrust/system/cuda/detail/dispatch.h b/thrust/thrust/system/cuda/detail/dispatch.h -index 3d004aa55..71ce86bea 100644 ---- a/thrust/thrust/system/cuda/detail/dispatch.h -+++ b/thrust/thrust/system/cuda/detail/dispatch.h -@@ -63,7 +63,7 @@ - _THRUST_INDEX_TYPE_DISPATCH_GUARD_UNDERFLOW(count1) \ - _THRUST_INDEX_TYPE_DISPATCH_GUARD_UNDERFLOW(count2) - --#if defined(THRUST_FORCE_64_BIT_OFFSET_TYPE) -+#if 0 - //! @brief Always dispatches to 64 bit offset version of an algorithm - # define THRUST_INDEX_TYPE_DISPATCH(status, call, count, arguments) \ - _THRUST_INDEX_TYPE_DISPATCH_GUARD_UNDERFLOW(count) \ -@@ -89,7 +89,7 @@ - _THRUST_INDEX_TYPE_DISPATCH_GUARD_UNDERFLOW(count) \ - _THRUST_INDEX_TYPE_DISPATCH(std::uint64_t, status, call_64, count, arguments) - --#elif defined(THRUST_FORCE_32_BIT_OFFSET_TYPE) -+#elif 1 - - //! @brief Ensures that the size of the input does not overflow the offset type - # define _THRUST_INDEX_TYPE_DISPATCH_GUARD_OVERFLOW(index_type, count) \ From 816fc0975b2b0595a8ecc7ebc88f240c2d7c42d1 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sat, 7 Dec 2024 09:49:48 -0600 Subject: [PATCH 2/4] Move Thrust offset type definition. --- cpp/CMakeLists.txt | 6 ++++++ cpp/cmake/thirdparty/get_cccl.cmake | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 12e6826f301..c6075223cb2 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -928,6 +928,12 @@ if(TARGET CUDA::cuFile${_cufile_suffix}) target_compile_definitions(cudf PRIVATE CUDF_CUFILE_FOUND) endif() +# Remove this after upgrading to a CCCL that has a proper CMake option. See +# https://github.com/NVIDIA/cccl/pull/2844 +target_compile_definitions( + cudf PRIVATE THRUST_FORCE_64_BIT_OFFSET_TYPE=0 THRUST_FORCE_32_BIT_OFFSET_TYPE=1 +) + # Compile stringified JIT sources first add_dependencies(cudf jitify_preprocess_run) diff --git a/cpp/cmake/thirdparty/get_cccl.cmake b/cpp/cmake/thirdparty/get_cccl.cmake index f5e459519a9..5494ad018fb 100644 --- a/cpp/cmake/thirdparty/get_cccl.cmake +++ b/cpp/cmake/thirdparty/get_cccl.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2023-2024, NVIDIA CORPORATION. +# Copyright (c) 2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -36,12 +36,6 @@ function(find_and_configure_cccl) # Find or install CCCL with our custom set of patches rapids_cpm_cccl(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports) - # Remove this after upgrading to a CCCL that has a proper CMake option. See - # https://github.com/NVIDIA/cccl/pull/2844 - target_compile_definitions( - cudf PRIVATE THRUST_FORCE_64_BIT_OFFSET_TYPE=0 THRUST_FORCE_32_BIT_OFFSET_TYPE=1 - ) - endfunction() find_and_configure_cccl() From 3ae6834e2500b8923efa7c148dd39e6bef04f884 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sun, 8 Dec 2024 16:46:09 -0600 Subject: [PATCH 3/4] Only use 32 bit definition. --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c6075223cb2..dcc3e82c030 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -931,7 +931,7 @@ endif() # Remove this after upgrading to a CCCL that has a proper CMake option. See # https://github.com/NVIDIA/cccl/pull/2844 target_compile_definitions( - cudf PRIVATE THRUST_FORCE_64_BIT_OFFSET_TYPE=0 THRUST_FORCE_32_BIT_OFFSET_TYPE=1 + cudf PRIVATE THRUST_FORCE_32_BIT_OFFSET_TYPE=1 ) # Compile stringified JIT sources first From 1f0a381017450f803ae19a693ed770e8c97c348a Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 9 Dec 2024 18:30:55 -0800 Subject: [PATCH 4/4] Update cpp/CMakeLists.txt --- cpp/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index dcc3e82c030..e54c71de4fa 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -930,9 +930,7 @@ endif() # Remove this after upgrading to a CCCL that has a proper CMake option. See # https://github.com/NVIDIA/cccl/pull/2844 -target_compile_definitions( - cudf PRIVATE THRUST_FORCE_32_BIT_OFFSET_TYPE=1 -) +target_compile_definitions(cudf PRIVATE THRUST_FORCE_32_BIT_OFFSET_TYPE=1) # Compile stringified JIT sources first add_dependencies(cudf jitify_preprocess_run)