From 9ab8f10c2087bbfb39b54a77d32d0dee335432ed Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 25 Apr 2023 22:52:14 -0500 Subject: [PATCH 1/4] Test rapids-cmake branch with CCCL updates to 2.1.0. --- fetch_rapids.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index eebf72e22b..0e4fed4b73 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -11,6 +11,8 @@ # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= +set(rapids-cmake-repo bdice/rapids-cmake) +set(rapids-cmake-branch cccl-update-2.1.0) if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake) file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake ${CMAKE_CURRENT_BINARY_DIR}/RAFT_RAPIDS.cmake From 950c05c86cb03c9d5ffcb4b85fd7d68bd5794121 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 31 Aug 2023 10:44:21 -0700 Subject: [PATCH 2/4] Temporarily remove rmm from conda dependencies so it is fetched by CPM with the appropriate CCCL. --- conda/recipes/libraft/meta.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conda/recipes/libraft/meta.yaml b/conda/recipes/libraft/meta.yaml index f4d133d714..35a1e5fd2e 100644 --- a/conda/recipes/libraft/meta.yaml +++ b/conda/recipes/libraft/meta.yaml @@ -62,13 +62,13 @@ outputs: - cuda-cudart-dev {% endif %} - cuda-version ={{ cuda_version }} - - librmm ={{ minor_version }} + #- librmm ={{ minor_version }} # TODO: Temporarily disabled so that rmm doesn't provide CCCL run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major == "11" %} - cudatoolkit {% endif %} - - librmm ={{ minor_version }} + #- librmm ={{ minor_version }} # TODO: Temporarily disabled so that rmm doesn't provide CCCL about: home: https://rapids.ai/ license: Apache-2.0 @@ -88,7 +88,7 @@ outputs: - cuda-version ={{ cuda_version }} run: - {{ pin_subpackage('libraft-headers-only', exact=True) }} - - librmm ={{ minor_version }} + #- librmm ={{ minor_version }} # TODO: Temporarily disabled so that rmm doesn't provide CCCL - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major == "11" %} - cudatoolkit From 38d67533267a18f5de00aac65a96e7ba6e55a28e Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 11 Sep 2023 18:40:50 -0700 Subject: [PATCH 3/4] Proclaim return type in matrix_wrappers.hpp. --- .../raft/spectral/detail/matrix_wrappers.hpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp index 07ab1dbeba..be43a025a5 100644 --- a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp +++ b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp @@ -30,6 +30,8 @@ #include #include +#include + #include // ========================================================= @@ -107,15 +109,16 @@ class vector_t { value_type nrm1() const { - return thrust::reduce(thrust_policy, - buffer_.data(), - buffer_.data() + buffer_.size(), - value_type{0}, - [] __device__(auto left, auto right) { - auto abs_left = left > 0 ? left : -left; - auto abs_right = right > 0 ? right : -right; - return abs_left + abs_right; - }); + return thrust::reduce( + thrust_policy, + buffer_.data(), + buffer_.data() + buffer_.size(), + value_type{0}, + cuda::proclaim_return_type([] __device__(auto left, auto right) { + auto abs_left = left > 0 ? left : -left; + auto abs_right = right > 0 ? right : -right; + return abs_left + abs_right; + })); } void fill(value_type value) From e3684c93233d515697c772845886e52578583f77 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 11 Sep 2023 21:33:51 -0700 Subject: [PATCH 4/4] Fix include order to avoid macro redefinition on CUDA 12. --- cpp/test/core/span.cpp | 8 ++++++++ cpp/test/core/sparse_matrix.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/cpp/test/core/span.cpp b/cpp/test/core/span.cpp index 1a21b5ff47..087ab6ab4d 100644 --- a/cpp/test/core/span.cpp +++ b/cpp/test/core/span.cpp @@ -13,6 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* TODO: This include of cuda_runtime.h is needed to work around + * https://github.com/NVIDIA/libcudacxx/pull/476 + * which is resolved in CCCL 2.2.0. The macro definition order requires CUDA + * headers to be included before libcudacxx headers. + */ +#include + #include "test_span.hpp" #include #include // iota diff --git a/cpp/test/core/sparse_matrix.cpp b/cpp/test/core/sparse_matrix.cpp index a5f26a3e53..f241b0a771 100644 --- a/cpp/test/core/sparse_matrix.cpp +++ b/cpp/test/core/sparse_matrix.cpp @@ -13,6 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* TODO: This include of cuda_runtime.h is needed to work around + * https://github.com/NVIDIA/libcudacxx/pull/476 + * which is resolved in CCCL 2.2.0. The macro definition order requires CUDA + * headers to be included before libcudacxx headers. + */ +#include + #include #include #include