From 5890d800f7880b44b376144ca4892590eda50ecb Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:32:16 -0500 Subject: [PATCH 1/2] Remove checks for Pascal, no longer supported (#4044) The only remaining "support" for Pascal was a check that if we're on a Pascal GPU we expect the function to throw an exception. Not sure it does anymore (don't see evidence of it, we haven't tested on Pascal for a long time), but if we're not supporting Pascal it doesn't matter. Closes #4022 Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - AJ Schmidt (https://github.com/ajschmidt8) - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/4044 --- ci/notebook_list.py | 7 --- ci/test.sh | 4 +- ci/utils/is_pascal.py | 37 ---------------- cpp/CMakeLists.txt | 2 +- cpp/tests/community/ecg_test.cpp | 42 +++++++----------- cpp/tests/community/leiden_test.cpp | 36 ++++----------- cpp/tests/community/louvain_test.cpp | 66 ++++++---------------------- 7 files changed, 39 insertions(+), 155 deletions(-) delete mode 100644 ci/utils/is_pascal.py diff --git a/ci/notebook_list.py b/ci/notebook_list.py index 96e26e3ab1a..f7a284beeeb 100644 --- a/ci/notebook_list.py +++ b/ci/notebook_list.py @@ -42,7 +42,6 @@ def skip_book_dir(runtype): # Not strictly true... however what we mean is # Pascal or earlier # -pascal = False ampere = False device = cuda.get_current_device() @@ -62,8 +61,6 @@ def skip_book_dir(runtype): cc = getattr(device, "COMPUTE_CAPABILITY", None) or getattr( device, "compute_capability" ) -if cc[0] < 7: - pascal = True if cc[0] >= 8: ampere = True @@ -91,10 +88,6 @@ def skip_book_dir(runtype): ) skip = True break - elif pascal and re.search("# Does not run on Pascal", line): - print(f"SKIPPING {filename} (does not run on Pascal)", file=sys.stderr) - skip = True - break elif ampere and re.search("# Does not run on Ampere", line): print(f"SKIPPING {filename} (does not run on Ampere)", file=sys.stderr) skip = True diff --git a/ci/test.sh b/ci/test.sh index 0032e3f3398..b3adc80c593 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -63,9 +63,7 @@ fi # EXITCODE for the script. set +e -if (python ${CUGRAPH_ROOT}/ci/utils/is_pascal.py); then - echo "WARNING: skipping C++ tests on Pascal GPU arch." -elif hasArg "--run-cpp-tests"; then +if hasArg "--run-cpp-tests"; then echo "C++ gtests for cuGraph (single-GPU only)..." for gt in "${CONDA_PREFIX}/bin/gtests/libcugraph/"*_TEST; do test_name=$(basename $gt) diff --git a/ci/utils/is_pascal.py b/ci/utils/is_pascal.py deleted file mode 100644 index e716f59422f..00000000000 --- a/ci/utils/is_pascal.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import re -import sys -import glob - -from numba import cuda - -# FIXME: consolidate this code with ci/gpu/notebook_list.py - -# -# Not strictly true... however what we mean is -# Pascal or earlier -# -pascal = False - -device = cuda.get_current_device() -cc = device.compute_capability -if (cc[0] < 7): - pascal = True - -# Return zero (success) if pascal is True -if pascal: - sys.exit(0) -else: - sys.exit(1) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 84a5534facd..a772651625d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -41,7 +41,7 @@ endif() # cuhornet currently doesn't support # # >= 90 -set(supported_archs "60" "62" "70" "72" "75" "80" "86" "89" "90") +set(supported_archs "70" "72" "75" "80" "86" "89" "90") foreach( arch IN LISTS CMAKE_CUDA_ARCHITECTURES) string(REPLACE "-real" "" arch ${arch}) if( arch IN_LIST supported_archs ) diff --git a/cpp/tests/community/ecg_test.cpp b/cpp/tests/community/ecg_test.cpp index 3c4c9bc9c12..262e2bd23af 100644 --- a/cpp/tests/community/ecg_test.cpp +++ b/cpp/tests/community/ecg_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation @@ -121,41 +121,29 @@ TEST(ecg, dolphin) cugraph::legacy::GraphCSRView graph_csr( offsets_v.data(), indices_v.data(), weights_v.data(), num_verts, num_edges); - // "FIXME": remove this check once we drop support for Pascal - // - // Calling louvain on Pascal will throw an exception, we'll check that - // this is the behavior while we still support Pascal (device_prop.major < 7) - // - if (handle.get_device_properties().major < 7) { - EXPECT_THROW( - (cugraph::ecg(handle, graph_csr, .05, 16, result_v.data())), - cugraph::logic_error); - } else { - cugraph::ecg(handle, graph_csr, .05, 16, result_v.data()); + cugraph::ecg(handle, graph_csr, .05, 16, result_v.data()); - auto cluster_id = cugraph::test::to_host(handle, result_v); + auto cluster_id = cugraph::test::to_host(handle, result_v); - int max = *max_element(cluster_id.begin(), cluster_id.end()); - int min = *min_element(cluster_id.begin(), cluster_id.end()); + int max = *max_element(cluster_id.begin(), cluster_id.end()); + int min = *min_element(cluster_id.begin(), cluster_id.end()); - ASSERT_EQ((min >= 0), 1); + ASSERT_EQ((min >= 0), 1); - std::set cluster_ids; - for (auto c : cluster_id) { - cluster_ids.insert(c); - } + std::set cluster_ids; + for (auto c : cluster_id) { + cluster_ids.insert(c); + } - ASSERT_EQ(cluster_ids.size(), size_t(max + 1)); + ASSERT_EQ(cluster_ids.size(), size_t(max + 1)); - float modularity{0.0}; + float modularity{0.0}; - cugraph::ext_raft::analyzeClustering_modularity( - graph_csr, max + 1, result_v.data(), &modularity); + cugraph::ext_raft::analyzeClustering_modularity(graph_csr, max + 1, result_v.data(), &modularity); - float random_modularity{0.95 * 0.4962422251701355}; + float random_modularity{0.95 * 0.4962422251701355}; - ASSERT_GT(modularity, random_modularity); - } + ASSERT_GT(modularity, random_modularity); } CUGRAPH_TEST_PROGRAM_MAIN() diff --git a/cpp/tests/community/leiden_test.cpp b/cpp/tests/community/leiden_test.cpp index 656e855057f..36e850683bd 100644 --- a/cpp/tests/community/leiden_test.cpp +++ b/cpp/tests/community/leiden_test.cpp @@ -79,39 +79,19 @@ class Tests_Leiden : public ::testing::TestWithParamview(); - // "FIXME": remove this check once we drop support for Pascal - // - // Calling louvain on Pascal will throw an exception, we'll check that - // this is the behavior while we still support Pascal (device_prop.major < 7) - // - cudaDeviceProp device_prop; - RAFT_CUDA_TRY(cudaGetDeviceProperties(&device_prop, 0)); - - if (device_prop.major < 7) { - EXPECT_THROW(louvain_legacy(graph_view, - graph_view.get_number_of_vertices(), - louvain_usecase.check_correctness_, - louvain_usecase.expected_level_, - louvain_usecase.expected_modularity_), - cugraph::logic_error); - } else { - louvain_legacy(graph_view, - graph_view.get_number_of_vertices(), - louvain_usecase.check_correctness_, - louvain_usecase.expected_level_, - louvain_usecase.expected_modularity_); - } + louvain_legacy(graph_view, + graph_view.get_number_of_vertices(), + louvain_usecase.check_correctness_, + louvain_usecase.expected_level_, + louvain_usecase.expected_modularity_); } template @@ -124,41 +107,20 @@ class Tests_Louvain auto edge_weight_view = edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt; - // "FIXME": remove this check once we drop support for Pascal - // - // Calling louvain on Pascal will throw an exception, we'll check that - // this is the behavior while we still support Pascal (device_prop.major < 7) - // - cudaDeviceProp device_prop; - RAFT_CUDA_TRY(cudaGetDeviceProperties(&device_prop, 0)); - if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement hr_timer.start("Louvain"); } - if (device_prop.major < 7) { - EXPECT_THROW(louvain(graph_view, - edge_weight_view, - graph_view.local_vertex_partition_range_size(), - louvain_usecase.max_level_, - louvain_usecase.threshold_, - louvain_usecase.resolution_, - louvain_usecase.check_correctness_, - louvain_usecase.expected_level_, - louvain_usecase.expected_modularity_), - cugraph::logic_error); - } else { - louvain(graph_view, - edge_weight_view, - graph_view.local_vertex_partition_range_size(), - louvain_usecase.max_level_, - louvain_usecase.threshold_, - louvain_usecase.resolution_, - louvain_usecase.check_correctness_, - louvain_usecase.expected_level_, - louvain_usecase.expected_modularity_); - } + louvain(graph_view, + edge_weight_view, + graph_view.local_vertex_partition_range_size(), + louvain_usecase.max_level_, + louvain_usecase.threshold_, + louvain_usecase.resolution_, + louvain_usecase.check_correctness_, + louvain_usecase.expected_level_, + louvain_usecase.expected_modularity_); if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement From d7c88d1a676015af1def62500d1f7255bc25aa7f Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 14 Dec 2023 12:10:10 -0800 Subject: [PATCH 2/2] Switch to scikit-build-core (#4053) Contributes to rapidsai/build-planning#2 Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/4053 --- build.sh | 61 +++---------- ci/build_wheel_cugraph.sh | 2 +- ci/build_wheel_pylibcugraph.sh | 2 +- .../all_cuda-118_arch-x86_64.yaml | 2 +- .../all_cuda-120_arch-x86_64.yaml | 2 +- conda/recipes/cugraph-pyg/meta.yaml | 2 +- conda/recipes/cugraph/meta.yaml | 2 +- conda/recipes/pylibcugraph/meta.yaml | 2 +- dependencies.yaml | 7 +- .../wholegraph/installation/source_build.md | 2 +- python/cugraph-dgl/setup.py | 19 ---- python/cugraph-pyg/setup.py | 66 -------------- python/cugraph-pyg/setuputils.py | 86 ------------------- python/cugraph-service/client/setup.py | 19 ---- python/cugraph-service/server/pyproject.toml | 5 +- python/cugraph-service/server/setup.py | 24 ------ python/cugraph/CMakeLists.txt | 8 +- python/cugraph/pyproject.toml | 19 ++-- python/cugraph/setup.py | 52 ----------- python/nx-cugraph/setup.py | 18 ---- python/pylibcugraph/CMakeLists.txt | 8 +- python/pylibcugraph/pyproject.toml | 19 ++-- python/pylibcugraph/setup.py | 61 ------------- 23 files changed, 61 insertions(+), 427 deletions(-) delete mode 100644 python/cugraph-dgl/setup.py delete mode 100644 python/cugraph-pyg/setup.py delete mode 100644 python/cugraph-pyg/setuputils.py delete mode 100644 python/cugraph-service/client/setup.py delete mode 100644 python/cugraph-service/server/setup.py delete mode 100644 python/cugraph/setup.py delete mode 100644 python/nx-cugraph/setup.py delete mode 100644 python/pylibcugraph/setup.py diff --git a/build.sh b/build.sh index fa7a4f6f363..5044b3a55b3 100755 --- a/build.sh +++ b/build.sh @@ -69,7 +69,7 @@ HELP="$0 [ ...] [ ...] -v - verbose build mode -g - build for debug -n - do not install after a successful build (does not affect Python packages) - --pydevelop - use setup.py develop instead of install + --pydevelop - install the Python packages in editable mode --allgpuarch - build for all supported GPU architectures --skip_cpp_tests - do not build the SG test binaries as part of the libcugraph and libcugraph_etl targets --without_cugraphops - do not build algos that require cugraph-ops @@ -187,14 +187,18 @@ if hasArg --cmake_default_generator; then CMAKE_GENERATOR_OPTION="" fi if hasArg --pydevelop; then - PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps -e" + PYTHON_ARGS_FOR_INSTALL="${PYTHON_ARGS_FOR_INSTALL} -e" fi -# Append `-DFIND_RAFT_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option. SKBUILD_EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS}" - if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUGRAPH_CPP"* ]]; then - SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS} -DFIND_CUGRAPH_CPP=ON" - fi + +# Replace spaces with semicolons in SKBUILD_EXTRA_CMAKE_ARGS +SKBUILD_EXTRA_CMAKE_ARGS=$(echo ${SKBUILD_EXTRA_CMAKE_ARGS} | sed 's/ /;/g') + +# Append `-DFIND_CUGRAPH_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option. +if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUGRAPH_CPP"* ]]; then + SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DFIND_CUGRAPH_CPP=ON" +fi # If clean or uninstall targets given, run them prior to any other steps if hasArg uninstall; then @@ -213,8 +217,7 @@ if hasArg uninstall; then if [ -e ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt ]; then xargs rm -f < ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt > /dev/null 2>&1 fi - # uninstall cugraph and pylibcugraph installed from a prior "setup.py - # install" + # uninstall cugraph and pylibcugraph installed from a prior install # FIXME: if multiple versions of these packages are installed, this only # removes the latest one and leaves the others installed. build.sh uninstall # can be run multiple times to remove all of them, but that is not obvious. @@ -226,10 +229,6 @@ if hasArg clean; then # Ignore errors for clean since missing files, etc. are not failures set +e # remove artifacts generated inplace - # FIXME: ideally the "setup.py clean" command would be used for this, but - # currently running any setup.py command has side effects (eg. cloning - # repos). - # (cd ${REPODIR}/python && python setup.py clean) if [[ -d ${REPODIR}/python ]]; then cleanPythonDir ${REPODIR}/python fi @@ -317,24 +316,7 @@ if buildDefault || hasArg pylibcugraph || hasArg all; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/pylibcugraph else - # FIXME: skbuild with setuptools>=64 has a bug when called from a "pip - # install -e" command, resulting in a broken editable wheel. Continue - # to use "setup.py bdist_ext --inplace" for a develop build until - # https://github.com/scikit-build/scikit-build/issues/981 is closed. - if hasArg --pydevelop; then - cd ${REPODIR}/python/pylibcugraph - python setup.py build_ext \ - --inplace \ - -- \ - -DFIND_CUGRAPH_CPP=ON \ - -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \ - -Dcugraph_ROOT=${LIBCUGRAPH_BUILD_DIR} \ - -- \ - -j${PARALLEL_LEVEL:-1} - cd - - fi - SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS} -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ - SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/pylibcugraph fi fi @@ -344,24 +326,7 @@ if buildDefault || hasArg cugraph || hasArg all; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph else - # FIXME: skbuild with setuptools>=64 has a bug when called from a "pip - # install -e" command, resulting in a broken editable wheel. Continue - # to use "setup.py bdist_ext --inplace" for a develop build until - # https://github.com/scikit-build/scikit-build/issues/981 is closed. - if hasArg --pydevelop; then - cd ${REPODIR}/python/cugraph - python setup.py build_ext \ - --inplace \ - -- \ - -DFIND_CUGRAPH_CPP=ON \ - -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \ - -Dcugraph_ROOT=${LIBCUGRAPH_BUILD_DIR} \ - -- \ - -j${PARALLEL_LEVEL:-1} - cd - - fi - SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS} -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ - SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph fi fi diff --git a/ci/build_wheel_cugraph.sh b/ci/build_wheel_cugraph.sh index 0a722c88c3e..ffd6445f8d5 100755 --- a/ci/build_wheel_cugraph.sh +++ b/ci/build_wheel_cugraph.sh @@ -12,6 +12,6 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" RAPIDS_PY_WHEEL_NAME=pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX} rapids-download-wheels-from-s3 ./local-pylibcugraph export PIP_FIND_LINKS=$(pwd)/local-pylibcugraph -export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/" +export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/" ./ci/build_wheel.sh cugraph python/cugraph diff --git a/ci/build_wheel_pylibcugraph.sh b/ci/build_wheel_pylibcugraph.sh index 9e236c145ce..7c5a7299421 100755 --- a/ci/build_wheel_pylibcugraph.sh +++ b/ci/build_wheel_pylibcugraph.sh @@ -3,6 +3,6 @@ set -euo pipefail -export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/" +export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/" ./ci/build_wheel.sh pylibcugraph python/pylibcugraph diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index dd5b6a25f6c..76178269ab0 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -63,7 +63,7 @@ dependencies: - recommonmark - requests - rmm==24.2.* -- scikit-build>=0.13.1 +- scikit-build-core>=0.7.0 - scikit-learn>=0.23.1 - scipy - setuptools>=61.0.0 diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index a3130310a27..84a6525bf0c 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -62,7 +62,7 @@ dependencies: - recommonmark - requests - rmm==24.2.* -- scikit-build>=0.13.1 +- scikit-build-core>=0.7.0 - scikit-learn>=0.23.1 - scipy - setuptools>=61.0.0 diff --git a/conda/recipes/cugraph-pyg/meta.yaml b/conda/recipes/cugraph-pyg/meta.yaml index a2a02a1d9f6..c07b97cd5da 100644 --- a/conda/recipes/cugraph-pyg/meta.yaml +++ b/conda/recipes/cugraph-pyg/meta.yaml @@ -24,7 +24,7 @@ requirements: host: - cython >=3.0.0 - python - - scikit-build >=0.13.1 + - scikit-build-core >=0.7.0 run: - rapids-dask-dependency ={{ minor_version }} - numba >=0.57 diff --git a/conda/recipes/cugraph/meta.yaml b/conda/recipes/cugraph/meta.yaml index 58b9ea220d4..b8e3072dd38 100644 --- a/conda/recipes/cugraph/meta.yaml +++ b/conda/recipes/cugraph/meta.yaml @@ -61,7 +61,7 @@ requirements: - python - raft-dask ={{ minor_version }} - rmm ={{ minor_version }} - - scikit-build >=0.13.1 + - scikit-build-core >=0.7.0 - setuptools run: - aiohttp diff --git a/conda/recipes/pylibcugraph/meta.yaml b/conda/recipes/pylibcugraph/meta.yaml index ad59c4de66f..0f66f55ccaa 100644 --- a/conda/recipes/pylibcugraph/meta.yaml +++ b/conda/recipes/pylibcugraph/meta.yaml @@ -58,7 +58,7 @@ requirements: - libcugraph ={{ version }} - pylibraft ={{ minor_version }} - python - - scikit-build >=0.13.1 + - scikit-build-core >=0.7.0 - setuptools run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} diff --git a/dependencies.yaml b/dependencies.yaml index b5c1fb2fa2d..579acec3996 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -372,7 +372,12 @@ dependencies: - output_types: [conda, pyproject, requirements] packages: - cython>=3.0.0 - - scikit-build>=0.13.1 + - output_types: conda + packages: + - scikit-build-core>=0.7.0 + - output_types: [pyproject, requirements] + packages: + - scikit-build-core[pyproject]>=0.7.0 python_run_cugraph: common: - output_types: [conda, pyproject] diff --git a/docs/cugraph/source/wholegraph/installation/source_build.md b/docs/cugraph/source/wholegraph/installation/source_build.md index c468048c351..a7727ac4052 100644 --- a/docs/cugraph/source/wholegraph/installation/source_build.md +++ b/docs/cugraph/source/wholegraph/installation/source_build.md @@ -27,7 +27,7 @@ __Other Packages__: * cython * setuputils3 * scikit-learn -* scikit-build +* scikit-build-core * nanobind>=0.2.0 ## Building wholegraph diff --git a/python/cugraph-dgl/setup.py b/python/cugraph-dgl/setup.py deleted file mode 100644 index afb8002af42..00000000000 --- a/python/cugraph-dgl/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2022-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import find_packages, setup - -packages = find_packages(include=["cugraph_dgl*"]) -setup( - package_data={key: ["VERSION"] for key in packages}, -) diff --git a/python/cugraph-pyg/setup.py b/python/cugraph-pyg/setup.py deleted file mode 100644 index 50f023050bf..00000000000 --- a/python/cugraph-pyg/setup.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (c) 2018-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import shutil - -from setuptools import Command, find_packages, setup - -from setuputils import get_environment_option - - -CUDA_HOME = get_environment_option("CUDA_HOME") - -if not CUDA_HOME: - path_to_cuda_gdb = shutil.which("cuda-gdb") - if path_to_cuda_gdb is None: - raise OSError( - "Could not locate CUDA. " - "Please set the environment variable " - "CUDA_HOME to the path to the CUDA installation " - "and try again." - ) - CUDA_HOME = os.path.dirname(os.path.dirname(path_to_cuda_gdb)) - -if not os.path.isdir(CUDA_HOME): - raise OSError("Invalid CUDA_HOME: " "directory does not exist: {CUDA_HOME}") - - -class CleanCommand(Command): - """Custom clean command to tidy up the project root.""" - - user_options = [ - ("all", None, None), - ] - - def initialize_options(self): - self.all = None - - def finalize_options(self): - pass - - def run(self): - setupFileDir = os.path.dirname(os.path.abspath(__file__)) - os.chdir(setupFileDir) - os.system("rm -rf build") - os.system("rm -rf dist") - os.system("rm -rf dask-worker-space") - os.system('find . -name "__pycache__" -type d -exec rm -rf {} +') - os.system("rm -rf *.egg-info") - - -packages = find_packages(include=["cugraph_pyg*"]) -setup( - cmdclass={"clean": CleanCommand}, - package_data={key: ["VERSION"] for key in packages}, -) diff --git a/python/cugraph-pyg/setuputils.py b/python/cugraph-pyg/setuputils.py deleted file mode 100644 index 48b169ea3b9..00000000000 --- a/python/cugraph-pyg/setuputils.py +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright (c) 2018-2022, 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import glob -import os -import re -import shutil -import sys - - -def get_environment_option(name): - ENV_VARIABLE = os.environ.get(name, False) - - if not ENV_VARIABLE: - print("-- " + name + " environment variable not set.") - - else: - print("-- " + name + " detected with value: " + str(ENV_VARIABLE)) - - return ENV_VARIABLE - - -def get_cli_option(name): - if name in sys.argv: - print("-- Detected " + str(name) + " build option.") - return True - - else: - return False - - -def clean_folder(path): - """ - Function to clean all Cython and Python artifacts and cache folders. It - clean the folder as well as its direct children recursively. - - Parameters - ---------- - path : String - Path to the folder to be cleaned. - """ - shutil.rmtree(path + "/__pycache__", ignore_errors=True) - - folders = glob.glob(path + "/*/") - for folder in folders: - shutil.rmtree(folder + "/__pycache__", ignore_errors=True) - - clean_folder(folder) - - cython_exts = glob.glob(folder + "/*.cpp") - cython_exts.extend(glob.glob(folder + "/*.cpython*")) - for file in cython_exts: - os.remove(file) - - -def get_cuda_version_from_header(cuda_include_dir, delimiter=""): - - cuda_version = None - - with open(os.path.join(cuda_include_dir, "cuda.h"), encoding="utf-8") as f: - for line in f.readlines(): - if re.search(r"#define CUDA_VERSION ", line) is not None: - cuda_version = line - break - - if cuda_version is None: - raise TypeError("CUDA_VERSION not found in cuda.h") - cuda_version = int(cuda_version.split()[2]) - return "%d%s%d" % ( - cuda_version // 1000, - delimiter, - (cuda_version % 1000) // 10, - ) diff --git a/python/cugraph-service/client/setup.py b/python/cugraph-service/client/setup.py deleted file mode 100644 index 61c758cef4a..00000000000 --- a/python/cugraph-service/client/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2018-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import find_packages, setup - -packages = find_packages(include=["cugraph_service_client*"]) -setup( - package_data={key: ["VERSION"] for key in packages}, -) diff --git a/python/cugraph-service/server/pyproject.toml b/python/cugraph-service/server/pyproject.toml index 4c83ad3905b..84c0358668b 100644 --- a/python/cugraph-service/server/pyproject.toml +++ b/python/cugraph-service/server/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta" [project] name = "cugraph-service-server" -dynamic = ["version", "entry-points"] +dynamic = ["version"] description = "cuGraph Service server" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -39,6 +39,9 @@ classifiers = [ "Programming Language :: Python :: 3.10", ] +[project.scripts] +cugraph-service-server = "cugraph_service_server.__main__:main" + [project.optional-dependencies] test = [ "networkx>=2.5.1", diff --git a/python/cugraph-service/server/setup.py b/python/cugraph-service/server/setup.py deleted file mode 100644 index 91864168e2c..00000000000 --- a/python/cugraph-service/server/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2022-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import find_packages, setup - -packages = find_packages(include=["cugraph_service_server*"]) -setup( - entry_points={ - "console_scripts": [ - "cugraph-service-server=cugraph_service_server.__main__:main" - ], - }, - package_data={key: ["VERSION"] for key in packages}, -) diff --git a/python/cugraph/CMakeLists.txt b/python/cugraph/CMakeLists.txt index 99936b23a8c..92345a324e4 100644 --- a/python/cugraph/CMakeLists.txt +++ b/python/cugraph/CMakeLists.txt @@ -26,11 +26,7 @@ rapids_cuda_init_architectures(cugraph-python) project( cugraph-python VERSION ${cugraph_version} - LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C - # language to be enabled here. The test project that is built in scikit-build to verify - # various linking options for the python library is hardcoded to build with C, so until - # that is fixed we need to keep C. - C CXX CUDA + LANGUAGES CXX CUDA ) ################################################################################ @@ -52,7 +48,7 @@ else() set(cugraph_FOUND OFF) endif() -include(rapids-cython) +include(rapids-cython-core) if(NOT cugraph_FOUND) set(BUILD_TESTS OFF) diff --git a/python/cugraph/pyproject.toml b/python/cugraph/pyproject.toml index 620971bcde1..6a9d88bf5c8 100644 --- a/python/cugraph/pyproject.toml +++ b/python/cugraph/pyproject.toml @@ -9,11 +9,11 @@ requires = [ "pylibcugraph==24.2.*", "pylibraft==24.2.*", "rmm==24.2.*", - "scikit-build>=0.13.1", + "scikit-build-core[pyproject]>=0.7.0", "setuptools>=61.0.0", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. -build-backend = "setuptools.build_meta" +build-backend = "scikit_build_core.build" [tool.pytest.ini_options] testpaths = ["cugraph/tests"] @@ -67,8 +67,15 @@ test = [ Homepage = "https://github.com/rapidsai/cugraph" Documentation = "https://docs.rapids.ai/api/cugraph/stable/" -[tool.setuptools] -license-files = ["LICENSE"] +[tool.scikit-build] +build-dir = "build/{wheel_tag}" +cmake.build-type = "Release" +cmake.minimum-version = "3.26.4" +ninja.make-fallback = true +sdist.reproducible = true +wheel.packages = ["cugraph"] -[tool.setuptools.dynamic] -version = {file = "cugraph/VERSION"} +[tool.scikit-build.metadata.version] +provider = "scikit_build_core.metadata.regex" +input = "cugraph/VERSION" +regex = "(?P.*)" diff --git a/python/cugraph/setup.py b/python/cugraph/setup.py deleted file mode 100644 index 81916444cfd..00000000000 --- a/python/cugraph/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2018-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - -from setuptools import find_packages, Command -from skbuild import setup - - -class CleanCommand(Command): - """Custom clean command to tidy up the project root.""" - - user_options = [ - ("all", None, None), - ] - - def initialize_options(self): - self.all = None - - def finalize_options(self): - pass - - def run(self): - setupFileDir = os.path.dirname(os.path.abspath(__file__)) - os.chdir(setupFileDir) - os.system("rm -rf build") - os.system("rm -rf dist") - os.system("rm -rf dask-worker-space") - os.system('find . -name "__pycache__" -type d -exec rm -rf {} +') - os.system("rm -rf *.egg-info") - os.system('find . -name "*.cpp" -type f -delete') - os.system('find . -name "*.cpython*.so" -type f -delete') - os.system("rm -rf _skbuild") - - -packages = find_packages(include=["cugraph*"]) -setup( - packages=packages, - package_data={key: ["VERSION", "*.pxd", "*.yaml"] for key in packages}, - cmdclass={"clean": CleanCommand}, - zip_safe=False, -) diff --git a/python/nx-cugraph/setup.py b/python/nx-cugraph/setup.py deleted file mode 100644 index c4ab535923b..00000000000 --- a/python/nx-cugraph/setup.py +++ /dev/null @@ -1,18 +0,0 @@ -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from setuptools import find_packages, setup - -packages = find_packages(include=["nx_cugraph*"]) -setup( - package_data={key: ["VERSION"] for key in packages}, -) diff --git a/python/pylibcugraph/CMakeLists.txt b/python/pylibcugraph/CMakeLists.txt index e1250cb2edb..6ef3bf9dd40 100644 --- a/python/pylibcugraph/CMakeLists.txt +++ b/python/pylibcugraph/CMakeLists.txt @@ -26,11 +26,7 @@ rapids_cuda_init_architectures(pylibcugraph-python) project( pylibcugraph-python VERSION ${pylibcugraph_version} - LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C - # language to be enabled here. The test project that is built in scikit-build to verify - # various linking options for the python library is hardcoded to build with C, so until - # that is fixed we need to keep C. - C CXX CUDA + LANGUAGES CXX CUDA ) ################################################################################ @@ -52,7 +48,7 @@ else() set(cugraph_FOUND OFF) endif() -include(rapids-cython) +include(rapids-cython-core) if (NOT cugraph_FOUND) set(BUILD_TESTS OFF) diff --git a/python/pylibcugraph/pyproject.toml b/python/pylibcugraph/pyproject.toml index 0f2d742e7c5..1d27d952af1 100644 --- a/python/pylibcugraph/pyproject.toml +++ b/python/pylibcugraph/pyproject.toml @@ -8,11 +8,11 @@ requires = [ "ninja", "pylibraft==24.2.*", "rmm==24.2.*", - "scikit-build>=0.13.1", + "scikit-build-core[pyproject]>=0.7.0", "setuptools>=61.0.0", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. -build-backend = "setuptools.build_meta" +build-backend = "scikit_build_core.build" [tool.pytest.ini_options] testpaths = ["pylibcugraph/tests"] @@ -54,8 +54,15 @@ test = [ Homepage = "https://github.com/rapidsai/cugraph" Documentation = "https://docs.rapids.ai/api/cugraph/stable/" -[tool.setuptools] -license-files = ["LICENSE"] +[tool.scikit-build] +build-dir = "build/{wheel_tag}" +cmake.build-type = "Release" +cmake.minimum-version = "3.26.4" +ninja.make-fallback = true +sdist.reproducible = true +wheel.packages = ["pylibcugraph"] -[tool.setuptools.dynamic] -version = {file = "pylibcugraph/VERSION"} +[tool.scikit-build.metadata.version] +provider = "scikit_build_core.metadata.regex" +input = "pylibcugraph/VERSION" +regex = "(?P.*)" diff --git a/python/pylibcugraph/setup.py b/python/pylibcugraph/setup.py deleted file mode 100644 index a6c1bda3b5b..00000000000 --- a/python/pylibcugraph/setup.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) 2018-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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os - -from setuptools import find_packages, Command -from skbuild import setup - - -class CleanCommand(Command): - """Custom clean command to tidy up the project root.""" - - user_options = [ - ("all", None, None), - ] - - def initialize_options(self): - self.all = None - - def finalize_options(self): - pass - - def run(self): - setupFileDir = os.path.dirname(os.path.abspath(__file__)) - os.chdir(setupFileDir) - os.system("rm -rf build") - os.system("rm -rf dist") - os.system("rm -rf dask-worker-space") - os.system('find . -name "__pycache__" -type d -exec rm -rf {} +') - os.system("rm -rf *.egg-info") - os.system('find . -name "*.cpp" -type f -delete') - os.system('find . -name "*.cpython*.so" -type f -delete') - os.system("rm -rf _skbuild") - - -def exclude_libcxx_symlink(cmake_manifest): - return list( - filter( - lambda name: not ("include/rapids/libcxx/include" in name), cmake_manifest - ) - ) - - -packages = find_packages(include=["pylibcugraph*"]) -setup( - packages=packages, - package_data={key: ["VERSION", "*.pxd"] for key in packages}, - cmake_process_manifest_hook=exclude_libcxx_symlink, - cmdclass={"clean": CleanCommand}, - zip_safe=False, -)