Skip to content

Commit 17c60b9

Browse files
jcristOfek Haim
authored andcommitted
Remove conditional compilation blocks leftover from cuml-cpu (rapidsai#6572)
We're no longer releasing builds of `cuml-cpu`. This PR: - Removes the previous `IF GPUBUILD` blocks used to conditionally guard compilation for `cuml-cpu` builds. I didn't remove or simplify the usage of `gpu_only_import`/`cpu_only_import`, this PR is only tackling removal of the conditional compilation. - Removes setting `GPUBUILD` in the cmake file - Since the latter effectively breaks `cuml-cpu` builds, I went ahead and fully removed `cuml-cpu` from our cmake setup. Fixes rapidsai#6231. Part of rapidsai#6523. Authors: - Jim Crist-Harif (https://github.com/jcrist) Approvers: - Gil Forsyth (https://github.com/gforsyth) - Bradley Dice (https://github.com/bdice) - Simon Adorf (https://github.com/csadorf) URL: rapidsai#6572
1 parent f06d1cc commit 17c60b9

21 files changed

Lines changed: 3022 additions & 3199 deletions

File tree

build.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARGS=$*
1818
# script, and that this script resides in the repo dir!
1919
REPODIR=$(cd "$(dirname $0)"; pwd)
2020

21-
VALIDTARGETS="clean libcuml cuml cuml-cpu cpp-mgtests prims bench prims-bench cppdocs pydocs"
21+
VALIDTARGETS="clean libcuml cuml cpp-mgtests prims bench prims-bench cppdocs pydocs"
2222
VALIDFLAGS="-v -g -n --allgpuarch --singlegpu --nolibcumltest --nvtx --show_depr_warn --codecov --ccache --configure-only -h --help "
2323
VALIDARGS="${VALIDTARGETS} ${VALIDFLAGS}"
2424
HELP="$0 [<target> ...] [<flag> ...]
@@ -27,7 +27,6 @@ HELP="$0 [<target> ...] [<flag> ...]
2727
libcuml - build the cuml C++ code only. Also builds the C-wrapper library
2828
around the C++ code.
2929
cuml - build the cuml Python package
30-
cuml-cpu - build the cuml CPU Python package
3130
cpp-mgtests - build libcuml mnmg tests. Builds MPI communicator, adding MPI as dependency.
3231
prims - build the ml-prims tests
3332
bench - build the libcuml C++ benchmark
@@ -306,8 +305,3 @@ if (! hasArg --configure-only) && (completeBuild || hasArg cuml || hasArg pydocs
306305
make html
307306
fi
308307
fi
309-
310-
if hasArg cuml-cpu; then
311-
SKBUILD_CMAKE_ARGS="-DCUML_CPU=ON;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE" \
312-
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true ${REPODIR}/python/cuml
313-
fi

python/cuml/CMakeLists.txt

Lines changed: 30 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,11 @@ cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
1616

1717
include(../../cmake/rapids_config.cmake)
1818

19-
option(CUML_CPU "Build only cuML CPU Python components." OFF)
2019
set(language_list "CXX")
2120

22-
if(NOT CUML_CPU)
23-
# We always need CUDA for cuML GPU because the raft dependency brings in a
24-
# header-only cuco dependency that enables CUDA unconditionally.
25-
include(rapids-cuda)
26-
rapids_cuda_init_architectures(cuml-python)
27-
list(APPEND language_list "CUDA")
28-
endif()
21+
include(rapids-cuda)
22+
rapids_cuda_init_architectures(cuml-python)
23+
list(APPEND language_list "CUDA")
2924

3025
project(
3126
cuml-python
@@ -41,7 +36,6 @@ option(USE_LIBCUML_WHEEL "Use libcuml wheel to provide some dependencies" OFF)
4136

4237
# todo: use CMAKE_MESSAGE_CONTEXT for prefix for logging.
4338
# https://github.com/rapidsai/cuml/issues/4843
44-
message(VERBOSE "CUML_PY: Build only cuML CPU Python components.: ${CUML_CPU}")
4539
message(VERBOSE "CUML_PY: Disabling all mnmg components and comms libraries: ${SINGLEGPU}")
4640

4741
set(CUML_ALGORITHMS "ALL" CACHE STRING "Choose which algorithms are built cuML. Can specify individual algorithms or groups in a semicolon-separated list.")
@@ -52,70 +46,39 @@ set(CUML_CPP_SRC "../../cpp")
5246
################################################################################
5347
# - Process User Options ------------------------------------------------------
5448

55-
if(CUML_CPU)
56-
set(CUML_UNIVERSAL OFF)
57-
set(SINGLEGPU ON)
58-
59-
# only a subset of algorithms are supported in CPU-only cuML
60-
set(CUML_ALGORITHMS "linearregression")
61-
list(APPEND CUML_ALGORITHMS "pca")
62-
list(APPEND CUML_ALGORITHMS "tsvd")
63-
list(APPEND CUML_ALGORITHMS "elasticnet")
64-
list(APPEND CUML_ALGORITHMS "logisticregression")
65-
list(APPEND CUML_ALGORITHMS "ridge")
66-
list(APPEND CUML_ALGORITHMS "lasso")
67-
list(APPEND CUML_ALGORITHMS "umap")
68-
list(APPEND CUML_ALGORITHMS "knn")
69-
list(APPEND CUML_ALGORITHMS "hdbscan")
70-
list(APPEND CUML_ALGORITHMS "dbscan")
71-
list(APPEND CUML_ALGORITHMS "kmeans")
72-
73-
# this won't be needed when we add CPU libcuml++ (FIL)
74-
set(cuml_sg_libraries "")
75-
76-
list(APPEND CYTHON_FLAGS
77-
"--compile-time-env GPUBUILD=0")
78-
79-
# cuml-cpu does not need libcuml++.so
80-
else()
81-
82-
include(rapids-cpm)
83-
include(rapids-export)
84-
rapids_cpm_init()
85-
86-
# --- treelite --- #
87-
# Need to call get_treelite explicitly because we need the correct
88-
# ${TREELITE_LIBS} definition for RF.
89-
#
90-
# And because cuml Cython code needs the headers to satisfy calls like
91-
# 'cdef extern from "treelite/c_api.h"'
92-
93-
# wheel builds use a static treelite, because the 'libtreelite.so' in 'treelite' wheels
94-
# isn't intended for dynamic linking by third-party projects (e.g. hides its symbols)
95-
if(USE_LIBCUML_WHEEL)
96-
set(CUML_PYTHON_TREELITE_TARGET treelite::treelite_static)
97-
set(CUML_USE_TREELITE_STATIC ON)
98-
else()
99-
set(CUML_PYTHON_TREELITE_TARGET treelite::treelite)
100-
set(CUML_USE_TREELITE_STATIC OFF)
101-
endif()
49+
include(rapids-cpm)
50+
include(rapids-export)
51+
rapids_cpm_init()
10252

103-
set(CUML_EXCLUDE_TREELITE_FROM_ALL ON)
53+
# --- treelite --- #
54+
# Need to call get_treelite explicitly because we need the correct
55+
# ${TREELITE_LIBS} definition for RF.
56+
#
57+
# And because cuml Cython code needs the headers to satisfy calls like
58+
# 'cdef extern from "treelite/c_api.h"'
59+
60+
# wheel builds use a static treelite, because the 'libtreelite.so' in 'treelite' wheels
61+
# isn't intended for dynamic linking by third-party projects (e.g. hides its symbols)
62+
if(USE_LIBCUML_WHEEL)
63+
set(CUML_PYTHON_TREELITE_TARGET treelite::treelite_static)
64+
set(CUML_USE_TREELITE_STATIC ON)
65+
else()
66+
set(CUML_PYTHON_TREELITE_TARGET treelite::treelite)
67+
set(CUML_USE_TREELITE_STATIC OFF)
68+
endif()
10469

105-
include(${CUML_CPP_SRC}/cmake/thirdparty/get_treelite.cmake)
70+
set(CUML_EXCLUDE_TREELITE_FROM_ALL ON)
10671

107-
# --- libcuml --- #
108-
find_package(cuml "${RAPIDS_VERSION}" REQUIRED)
72+
include(${CUML_CPP_SRC}/cmake/thirdparty/get_treelite.cmake)
10973

110-
set(cuml_sg_libraries cuml::${CUML_CPP_TARGET})
111-
set(cuml_mg_libraries cuml::${CUML_CPP_TARGET})
74+
# --- libcuml --- #
75+
find_package(cuml "${RAPIDS_VERSION}" REQUIRED)
11276

113-
if(NOT SINGLEGPU)
114-
list(APPEND cuml_mg_libraries cumlprims_mg::cumlprims_mg)
115-
endif()
77+
set(cuml_sg_libraries cuml::${CUML_CPP_TARGET})
78+
set(cuml_mg_libraries cuml::${CUML_CPP_TARGET})
11679

117-
list(APPEND CYTHON_FLAGS
118-
"--compile-time-env GPUBUILD=1")
80+
if(NOT SINGLEGPU)
81+
list(APPEND cuml_mg_libraries cumlprims_mg::cumlprims_mg)
11982
endif()
12083

12184
################################################################################
@@ -124,12 +87,6 @@ endif()
12487
include("${CUML_CPP_SRC}/cmake/modules/ConfigureAlgorithms.cmake")
12588
include(cmake/ConfigureCythonAlgorithms.cmake)
12689

127-
if(CUML_CPU)
128-
# libcuml requires metrics built if HDSCAN is built, which is not the case
129-
# for cuml-cpu
130-
unset(metrics_algo)
131-
endif()
132-
13390
message(VERBOSE "CUML_PY: Building cuML with algorithms: '${CUML_ALGORITHMS}'.")
13491

13592
include(rapids-cython-core)

0 commit comments

Comments
 (0)