Skip to content

Commit

Permalink
Use GCC 13 in CUDA 12 conda builds. (#6221)
Browse files Browse the repository at this point in the history
## Description
conda-forge is using GCC 13 for CUDA 12 builds. This PR updates CUDA 12
conda builds to use GCC 13, for alignment.

These PRs should be merged in a specific order, see
rapidsai/build-planning#129 for details.

---------

Co-authored-by: divyegala <[email protected]>
  • Loading branch information
bdice and divyegala authored Jan 17, 2025
1 parent f29293f commit d95cae5
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 51 deletions.
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies:
- sphinx-copybutton
- sphinx-markdown-tables
- statsmodels
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- treelite==4.3.0
- umap-learn==0.5.6
- xgboost>=2.1.0
Expand Down
4 changes: 2 additions & 2 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- dask-ml
- doxygen=1.9.1
- fmt>=11.0.2,<12
- gcc_linux-64=11.*
- gcc_linux-64=13.*
- graphviz
- hdbscan>=0.8.39,<0.8.40
- hypothesis>=6.0,<7
Expand Down Expand Up @@ -71,7 +71,7 @@ dependencies:
- sphinx-copybutton
- sphinx-markdown-tables
- statsmodels
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- treelite==4.3.0
- umap-learn==0.5.6
- xgboost>=2.1.0
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/clang_tidy_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ dependencies:
- ninja
- nvcc_linux-64=11.8
- spdlog>=1.14.1,<1.15
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- tomli
name: clang_tidy_cuda-118_arch-x86_64
2 changes: 1 addition & 1 deletion conda/environments/cpp_all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ dependencies:
- ninja
- nvcc_linux-64=11.8
- spdlog>=1.14.1,<1.15
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
name: cpp_all_cuda-118_arch-x86_64
4 changes: 2 additions & 2 deletions conda/environments/cpp_all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- cuda-version=12.5
- cxx-compiler
- fmt>=11.0.2,<12
- gcc_linux-64=11.*
- gcc_linux-64=13.*
- libcublas-dev
- libcufft-dev
- libcumlprims==25.2.*,>=0.0.0a0
Expand All @@ -27,5 +27,5 @@ dependencies:
- librmm==25.2.*,>=0.0.0a0
- ninja
- spdlog>=1.14.1,<1.15
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
name: cpp_all_cuda-125_arch-x86_64
8 changes: 5 additions & 3 deletions conda/recipes/cuml-cpu/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
c_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cxx_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cmake_version:
- ">=3.26.4,!=3.30.0"
Expand All @@ -11,4 +13,4 @@ c_stdlib:
- sysroot

c_stdlib_version:
- "=2.17"
- "=2.28"
14 changes: 7 additions & 7 deletions conda/recipes/cuml/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
c_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cxx_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc
- cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cmake_version:
- ">=3.26.4,!=3.30.0"
Expand All @@ -17,7 +17,7 @@ c_stdlib:
- sysroot

c_stdlib_version:
- "=2.17"
- "=2.28"

treelite_version:
- "=4.3.0"
8 changes: 3 additions & 5 deletions conda/recipes/cuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Copyright (c) 2018-2025, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand Down Expand Up @@ -33,10 +33,8 @@ build:
- SCCACHE_S3_KEY_PREFIX=cuml-linux64 # [linux64]
- SCCACHE_S3_USE_SSL
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
{% if cuda_major != "11" %}
- cuda-cudart-dev
{% endif %}
- cuda-python
Expand All @@ -46,7 +44,7 @@ requirements:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
- {{ compiler('cuda') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
Expand Down
14 changes: 7 additions & 7 deletions conda/recipes/libcuml/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
c_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cxx_compiler_version:
- 11
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc
- cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
- nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]

c_stdlib:
- sysroot

c_stdlib_version:
- "=2.17"
- "=2.28"

cmake_version:
- ">=3.26.4,!=3.30.0"
Expand Down
16 changes: 5 additions & 11 deletions conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Copyright (c) 2018-2025, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand All @@ -14,9 +14,7 @@ source:

build:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% endif %}
- {{ compiler('cuda') }}
script_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
Expand All @@ -38,7 +36,7 @@ requirements:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
- {{ compiler('cuda') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
Expand Down Expand Up @@ -84,10 +82,8 @@ outputs:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
{% if cuda_major != "11" %}
- cuda-cudart-dev
{% endif %}
requirements:
Expand Down Expand Up @@ -131,10 +127,8 @@ outputs:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
{% if cuda_major != "11" %}
- cuda-cudart-dev
{% endif %}
requirements:
Expand Down
21 changes: 21 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,27 @@ if(BUILD_CUML_CPP_LIBRARY)
src/hdbscan/hdbscan.cu
src/hdbscan/condensed_hierarchy.cu
src/hdbscan/prediction_data.cu)

# When using GCC 13, some maybe-uninitialized warnings appear from CCCL and are treated as errors.
# See this issue: https://github.com/rapidsai/cuml/issues/6225
set_property(
SOURCE src/hdbscan/condensed_hierarchy.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
set_property(
SOURCE src/hdbscan/hdbscan.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
set_property(
SOURCE src/hdbscan/prediction_data.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
endif()

if(all_algo OR holtwinters_algo)
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/hdbscan/condensed_hierarchy.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
* Copyright (c) 2021-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,7 @@

#include <cub/cub.cuh>
#include <cuda/functional>
#include <cuda/std/functional>
#include <thrust/copy.h>
#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
Expand Down Expand Up @@ -157,8 +158,9 @@ void CondensedHierarchy<value_idx, value_t>::condense(value_idx* full_parents,
thrust::cuda::par.on(stream),
full_sizes,
full_sizes + size,
cuda::proclaim_return_type<bool>([=] __device__(value_idx a) -> bool { return a != -1; }),
0,
cuda::proclaim_return_type<value_idx>(
[=] __device__(value_idx a) -> value_idx { return static_cast<value_idx>(a != -1); }),
static_cast<value_idx>(0),
thrust::plus<value_idx>());

parents.resize(n_edges, stream);
Expand Down
8 changes: 5 additions & 3 deletions cpp/src/hdbscan/detail/utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
* Copyright (c) 2021-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,6 +34,7 @@
#include <rmm/exec_policy.hpp>

#include <cub/cub.cuh>
#include <cuda/functional>
#include <thrust/copy.h>
#include <thrust/execution_policy.h>
#include <thrust/for_each.h>
Expand Down Expand Up @@ -114,8 +115,9 @@ Common::CondensedHierarchy<value_idx, value_t> make_cluster_tree(
thrust_policy,
sizes,
sizes + condensed_tree.get_n_edges(),
cuda::proclaim_return_type<bool>([=] __device__(value_idx a) -> bool { return a > 1; }),
0,
cuda::proclaim_return_type<value_idx>(
[=] __device__(value_idx a) -> value_idx { return static_cast<value_idx>(a > 1); }),
static_cast<value_idx>(0),
thrust::plus<value_idx>());

// remove leaves from condensed tree
Expand Down
10 changes: 9 additions & 1 deletion cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Copyright (c) 2018-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -149,6 +149,14 @@ if("${CMAKE_CUDA_COMPILER_VERSION}" VERSION_GREATER_EQUAL "11.2")
# An HDBSCAN gtest is failing w/ CUDA 11.2 for some reason.
if(all_algo OR hdbscan_algo)
ConfigureTest(PREFIX SG NAME HDBSCAN_TEST sg/hdbscan_test.cu ML_INCLUDE)
# When using GCC 13, some maybe-uninitialized warnings appear from CCCL and are treated as errors.
# See this issue: https://github.com/rapidsai/cuml/issues/6225
set_property(
SOURCE sg/hdbscan_test.cu
APPEND_STRING
PROPERTY COMPILE_FLAGS
" -Xcompiler=-Wno-maybe-uninitialized"
)
endif()
endif()

Expand Down
16 changes: 12 additions & 4 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,29 +190,37 @@ dependencies:
- matrix:
arch: x86_64
packages:
- gcc_linux-64=11.*
- sysroot_linux-64==2.17
- sysroot_linux-64==2.28
- matrix:
arch: aarch64
packages:
- gcc_linux-aarch64=11.*
- sysroot_linux-aarch64==2.17
- sysroot_linux-aarch64==2.28
- output_types: conda
matrices:
- matrix:
arch: x86_64
cuda: "11.8"
packages:
- gcc_linux-64=11.*
- nvcc_linux-64=11.8
- matrix:
arch: aarch64
cuda: "11.8"
packages:
- gcc_linux-64=11.*
- nvcc_linux-aarch64=11.8
- matrix:
arch: x86_64
cuda: "12.*"
packages:
- cuda-nvcc
- gcc_linux-64=13.*
- matrix:
arch: aarch64
cuda: "12.*"
packages:
- cuda-nvcc
- gcc_linux-aarch64=13.*
py_build_cuml:
common:
- output_types: [conda, requirements, pyproject]
Expand Down

0 comments on commit d95cae5

Please sign in to comment.