diff --git a/.devcontainer/cuda11.8-conda/devcontainer.json b/.devcontainer/cuda11.8-conda/devcontainer.json index bd158da3b..c9c17940c 100644 --- a/.devcontainer/cuda11.8-conda/devcontainer.json +++ b/.devcontainer/cuda11.8-conda/devcontainer.json @@ -5,12 +5,12 @@ "args": { "CUDA": "11.8", "PYTHON_PACKAGE_MANAGER": "conda", - "BASE": "rapidsai/devcontainers:23.12-cpp-llvm16-cuda11.8-mambaforge-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.02-cpp-llvm16-cuda11.8-mambaforge-ubuntu22.04" } }, "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.12": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.devcontainer/cuda11.8-pip/devcontainer.json b/.devcontainer/cuda11.8-pip/devcontainer.json index 590d77b8a..0bd958012 100644 --- a/.devcontainer/cuda11.8-pip/devcontainer.json +++ b/.devcontainer/cuda11.8-pip/devcontainer.json @@ -5,12 +5,12 @@ "args": { "CUDA": "11.8", "PYTHON_PACKAGE_MANAGER": "pip", - "BASE": "rapidsai/devcontainers:23.12-cpp-llvm16-cuda11.8-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.02-cpp-llvm16-cuda11.8-ubuntu22.04" } }, "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.12": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.devcontainer/cuda12.0-conda/devcontainer.json b/.devcontainer/cuda12.0-conda/devcontainer.json index a53559f65..83e172198 100644 --- a/.devcontainer/cuda12.0-conda/devcontainer.json +++ b/.devcontainer/cuda12.0-conda/devcontainer.json @@ -5,12 +5,12 @@ "args": { "CUDA": "12.0", "PYTHON_PACKAGE_MANAGER": "conda", - "BASE": "rapidsai/devcontainers:23.12-cpp-mambaforge-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.02-cpp-mambaforge-ubuntu22.04" } }, "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.12": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.devcontainer/cuda12.0-pip/devcontainer.json b/.devcontainer/cuda12.0-pip/devcontainer.json index 8feb29db9..7910122a3 100644 --- a/.devcontainer/cuda12.0-pip/devcontainer.json +++ b/.devcontainer/cuda12.0-pip/devcontainer.json @@ -5,12 +5,12 @@ "args": { "CUDA": "12.0", "PYTHON_PACKAGE_MANAGER": "pip", - "BASE": "rapidsai/devcontainers:23.12-cpp-llvm16-cuda12.0-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.02-cpp-llvm16-cuda12.0-ubuntu22.04" } }, "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.12": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.2": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eb6e338aa..470b74f65 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -37,7 +37,7 @@ jobs: python-build: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -46,7 +46,7 @@ jobs: upload-conda: needs: [cpp-build, python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -56,7 +56,7 @@ jobs: if: github.ref_type == 'branch' needs: python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.02 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build-cuspatial: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -78,7 +78,7 @@ jobs: wheel-publish-cuspatial: needs: wheel-build-cuspatial secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -87,7 +87,7 @@ jobs: package-name: cuspatial wheel-build-cuproj: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -97,7 +97,7 @@ jobs: wheel-publish-cuproj: needs: wheel-build-cuproj secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.02 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c9e64d9fb..60d7fbb77 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,40 +25,40 @@ jobs: - wheel-tests-cuproj - devcontainer secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.02 checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.02 with: enable_check_generated_files: false conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.02 with: build_type: pull-request conda-cpp-tests: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.02 with: build_type: pull-request conda-python-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.02 with: build_type: pull-request conda-python-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.02 with: build_type: pull-request conda-notebook-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.02 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -68,7 +68,7 @@ jobs: docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.02 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -78,34 +78,34 @@ jobs: wheel-build-cuspatial: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02 with: build_type: pull-request script: ci/build_wheel_cuspatial.sh wheel-tests-cuspatial: needs: wheel-build-cuspatial secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.02 with: build_type: pull-request script: ci/test_wheel_cuspatial.sh wheel-build-cuproj: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02 with: build_type: pull-request script: ci/build_wheel_cuproj.sh wheel-tests-cuproj: needs: [wheel-build-cuspatial, wheel-build-cuproj] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.02 with: build_type: pull-request script: ci/test_wheel_cuproj.sh devcontainer: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.02 with: build_command: | sccache -z; diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1c8c6d376..81ac344a6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: conda-cpp-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.02 with: build_type: nightly branch: ${{ inputs.branch }} @@ -24,7 +24,7 @@ jobs: sha: ${{ inputs.sha }} conda-python-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.02 with: build_type: nightly branch: ${{ inputs.branch }} @@ -32,7 +32,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests-cuspatial: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.02 with: build_type: nightly branch: ${{ inputs.branch }} @@ -41,7 +41,7 @@ jobs: script: ci/test_wheel_cuspatial.sh wheel-tests-cuproj: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-23.12 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.02 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f4ae6e253..df1987c30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: args: ["--config pyproject.toml"] additional_dependencies: ["tomli"] - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.5.1 + rev: v1.8.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 5792ecef5..47bad8a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +# cuSpatial 24.02.00 (12 Feb 2024) + +## 🚨 Breaking Changes + +- Update to CCCL 2.2.0. ([#1315](https://github.com/rapidsai/cuspatial/pull/1315)) [@bdice](https://github.com/bdice) +- Switch to scikit-build-core ([#1313](https://github.com/rapidsai/cuspatial/pull/1313)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Exclude tests from builds ([#1339](https://github.com/rapidsai/cuspatial/pull/1339)) [@vyasr](https://github.com/vyasr) +- Make sure cudf uses pyarrow's libarrow during wheel builds ([#1334](https://github.com/rapidsai/cuspatial/pull/1334)) [@vyasr](https://github.com/vyasr) +- Replace cudf _from_columns with a public API ([#1326](https://github.com/rapidsai/cuspatial/pull/1326)) [@mroeschke](https://github.com/mroeschke) +- Update usage of cudf.core.column.arange to cudf.core.column.as_column ([#1323](https://github.com/rapidsai/cuspatial/pull/1323)) [@AjayThorve](https://github.com/AjayThorve) + +## 🚀 New Features + +- Use ListColumn instead of build_list_column ([#1327](https://github.com/rapidsai/cuspatial/pull/1327)) [@mroeschke](https://github.com/mroeschke) + +## 🛠️ Improvements + +- Remove usages of rapids-env-update ([#1321](https://github.com/rapidsai/cuspatial/pull/1321)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Add explicit initial size to all pools and avoid RMM detail APIs ([#1319](https://github.com/rapidsai/cuspatial/pull/1319)) [@harrism](https://github.com/harrism) +- refactor CUDA versions in dependencies.yaml ([#1317](https://github.com/rapidsai/cuspatial/pull/1317)) [@jameslamb](https://github.com/jameslamb) +- Update to CCCL 2.2.0. ([#1315](https://github.com/rapidsai/cuspatial/pull/1315)) [@bdice](https://github.com/bdice) +- Use cuda::proclaim_return_type on device lambdas. ([#1314](https://github.com/rapidsai/cuspatial/pull/1314)) [@bdice](https://github.com/bdice) +- Switch to scikit-build-core ([#1313](https://github.com/rapidsai/cuspatial/pull/1313)) [@vyasr](https://github.com/vyasr) +- Use Cython 3 for cuproj. ([#1309](https://github.com/rapidsai/cuspatial/pull/1309)) [@bdice](https://github.com/bdice) +- Update dependencies.yaml to new pip index ([#1305](https://github.com/rapidsai/cuspatial/pull/1305)) [@vyasr](https://github.com/vyasr) +- Remove CUSPATIAL_BUILD_WHEELS and standardize Python builds ([#1304](https://github.com/rapidsai/cuspatial/pull/1304)) [@vyasr](https://github.com/vyasr) + # cuSpatial 23.12.00 (6 Dec 2023) ## 🐛 Bug Fixes diff --git a/README.md b/README.md index e61317b03..89b2caa40 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ An example command from the Release Selector: docker run --gpus all --pull always --rm -it \ --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \ -p 8888:8888 -p 8787:8787 -p 8786:8786 \ - nvcr.io/nvidia/rapidsai/notebooks:23.12-cuda11.8-py3.10 + nvcr.io/nvidia/rapidsai/notebooks:24.02-cuda11.8-py3.10 ``` ### Install with Conda @@ -125,7 +125,7 @@ cuSpatial can be installed with conda (miniconda, or the full Anaconda distribut ```shell conda install -c rapidsai -c conda-forge -c nvidia \ - cuspatial=23.12 python=3.10 cudatoolkit=11.8 + cuspatial=24.02 python=3.10 cudatoolkit=11.8 ``` We also provide nightly Conda packages built from the HEAD of our latest development branch. @@ -184,7 +184,7 @@ To build and install cuSpatial from source please see the [build documentation]( If you find cuSpatial useful in your published work, please consider citing the repository. ```bibtex -@misc{cuspatial:23.12, +@misc{cuspatial:24.02, author = {{NVIDIA Corporation}}, title = {cuSpatial: GPU-Accelerated Geospatial and Spatiotemporal Algorithms}, year = {2023}, diff --git a/VERSION b/VERSION index 4dc24aa48..3c6c5e2b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -23.12.01 +24.02.00 diff --git a/build.sh b/build.sh index 34a4840d2..664e824e6 100755 --- a/build.sh +++ b/build.sh @@ -182,8 +182,7 @@ fi if (( ${NUMARGS} == 0 )) || hasArg cuspatial; then cd ${REPODIR}/python/cuspatial - SKBUILD_CONFIGURE_OPTIONS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUSPATIAL_BUILD_DIR} ${EXTRA_CMAKE_ARGS}" \ - SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL:-1}" \ + SKBUILD_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX};-DCMAKE_LIBRARY_PATH=${LIBCUSPATIAL_BUILD_DIR};${EXTRA_CMAKE_ARGS}" \ python -m pip install --no-build-isolation --no-deps . fi @@ -191,7 +190,6 @@ fi if (( ${NUMARGS} == 0 )) || hasArg cuproj; then cd ${REPODIR}/python/cuproj - SKBUILD_CONFIGURE_OPTIONS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX} -DCMAKE_LIBRARY_PATH=${LIBCUPROJ_BUILD_DIR} ${EXTRA_CMAKE_ARGS}" \ - SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL:-1}" \ + SKBUILD_CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${INSTALL_PREFIX};-DCMAKE_LIBRARY_PATH=${LIBCUPROJ_BUILD_DIR};${EXTRA_CMAKE_ARGS}" \ python -m pip install --no-build-isolation --no-deps . fi diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index cd40c1df0..a4ae2b872 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -3,7 +3,11 @@ set -euo pipefail -source rapids-env-update +rapids-configure-conda-channels + +source rapids-configure-sccache + +source rapids-date-string export CMAKE_GENERATOR=Ninja diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 427fb23bc..74516e0de 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -27,7 +27,7 @@ rapids-mamba-retry install \ cuspatial \ cuproj -export RAPIDS_VERSION_NUMBER="23.12" +export RAPIDS_VERSION_NUMBER="24.02" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build cuSpatial CPP docs" diff --git a/ci/build_python.sh b/ci/build_python.sh index 8036ea8eb..a0ac89948 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -3,7 +3,11 @@ set -euo pipefail -source rapids-env-update +rapids-configure-conda-channels + +source rapids-configure-sccache + +source rapids-date-string export CMAKE_GENERATOR=Ninja @@ -15,7 +19,7 @@ version=$(rapids-generate-version) commit=$(git rev-parse HEAD) echo "${version}" > VERSION -for package_name in cuspatial cuproj; do +for package_name in cuspatial cuproj; do sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/${package_name}/_version.py" done diff --git a/ci/build_wheel_cuproj.sh b/ci/build_wheel_cuproj.sh index 2e3e724c7..961f4e363 100755 --- a/ci/build_wheel_cuproj.sh +++ b/ci/build_wheel_cuproj.sh @@ -3,6 +3,4 @@ set -euo pipefail -export SKBUILD_CONFIGURE_OPTIONS="-DCUPROJ_BUILD_WHEELS=ON" - ci/build_wheel.sh cuproj python/cuproj diff --git a/ci/build_wheel_cuspatial.sh b/ci/build_wheel_cuspatial.sh index c98184d13..932665e27 100755 --- a/ci/build_wheel_cuspatial.sh +++ b/ci/build_wheel_cuspatial.sh @@ -3,6 +3,6 @@ set -euo pipefail -export SKBUILD_CONFIGURE_OPTIONS="-DCUSPATIAL_BUILD_WHEELS=ON" +export SKBUILD_CMAKE_ARGS="-DUSE_LIBARROW_FROM_PYARROW=ON" ci/build_wheel.sh cuspatial python/cuspatial diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index c30e6fc22..c09a7ae6c 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -11,8 +11,8 @@ dependencies: - cmake>=3.26.4 - cuda-version=11.8 - cudatoolkit -- cudf==23.12.* -- cuml==23.12.* +- cudf==24.2.* +- cuml==24.2.* - cupy>=12.0.0 - curl - cxx-compiler @@ -24,8 +24,8 @@ dependencies: - gtest>=1.13.0 - ipython - ipywidgets -- libcudf==23.12.* -- librmm==23.12.* +- libcudf==24.2.* +- librmm==24.2.* - myst-parser - nbsphinx - ninja @@ -40,10 +40,9 @@ dependencies: - pytest-cov - pytest-xdist - python>=3.9,<3.11 -- rmm==23.12.* -- scikit-build>=0.13.1 +- rmm==24.2.* +- scikit-build-core>=0.7.0 - scikit-image -- setuptools - shapely - sphinx<6 - sqlite diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index 7b4949c32..66fa869cc 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -14,8 +14,8 @@ dependencies: - cuda-nvcc - cuda-nvrtc-dev - cuda-version=12.0 -- cudf==23.12.* -- cuml==23.12.* +- cudf==24.2.* +- cuml==24.2.* - cupy>=12.0.0 - curl - cxx-compiler @@ -27,8 +27,8 @@ dependencies: - gtest>=1.13.0 - ipython - ipywidgets -- libcudf==23.12.* -- librmm==23.12.* +- libcudf==24.2.* +- librmm==24.2.* - myst-parser - nbsphinx - ninja @@ -42,10 +42,9 @@ dependencies: - pytest-cov - pytest-xdist - python>=3.9,<3.11 -- rmm==23.12.* -- scikit-build>=0.13.1 +- rmm==24.2.* +- scikit-build-core>=0.7.0 - scikit-image -- setuptools - shapely - sphinx<6 - sqlite diff --git a/conda/recipes/cuproj/meta.yaml b/conda/recipes/cuproj/meta.yaml index b2343b926..532d349c2 100644 --- a/conda/recipes/cuproj/meta.yaml +++ b/conda/recipes/cuproj/meta.yaml @@ -53,10 +53,10 @@ requirements: host: - cuda-version ={{ cuda_version }} - cmake {{ cmake_version }} - - cython >=0.29,<0.30 + - cython >=3.0.0 - python - rmm ={{ minor_version }} - - scikit-build >=0.13.1 + - scikit-build-core >=0.7.0 - setuptools - proj - sqlite diff --git a/conda/recipes/cuspatial/meta.yaml b/conda/recipes/cuspatial/meta.yaml index 468d0f45f..9e2cb33da 100644 --- a/conda/recipes/cuspatial/meta.yaml +++ b/conda/recipes/cuspatial/meta.yaml @@ -58,7 +58,7 @@ requirements: - libcuspatial ={{ version }} - python - rmm ={{ minor_version }} - - scikit-build >=0.13.1 + - scikit-build-core >=0.7.0 - setuptools run: {% if cuda_major == "11" %} diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index bdda9fa0d..0b3116b89 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -25,7 +25,7 @@ include(rapids-find) rapids_cuda_init_architectures(CUSPATIAL) -project(CUSPATIAL VERSION 23.12.01 LANGUAGES C CXX CUDA) +project(CUSPATIAL VERSION 24.02.00 LANGUAGES C CXX CUDA) # Needed because GoogleBenchmark changes the state of FindThreads.cmake, # causing subsequent runs to have different values for the `Threads::Threads` target. diff --git a/cpp/benchmarks/fixture/benchmark_fixture.hpp b/cpp/benchmarks/fixture/benchmark_fixture.hpp index 560838932..25b7cdfb5 100644 --- a/cpp/benchmarks/fixture/benchmark_fixture.hpp +++ b/cpp/benchmarks/fixture/benchmark_fixture.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-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. @@ -14,12 +14,16 @@ * limitations under the License. */ -#include +#pragma once + +#include #include #include #include #include +#include + namespace cuspatial { namespace { @@ -28,7 +32,8 @@ inline auto make_cuda() { return std::make_shared inline auto make_pool() { - return rmm::mr::make_owning_wrapper(make_cuda()); + return rmm::mr::make_owning_wrapper( + make_cuda(), rmm::percent_of_free_device_memory(50)); } } // namespace diff --git a/cpp/benchmarks/fixture/rmm_pool_raii.hpp b/cpp/benchmarks/fixture/rmm_pool_raii.hpp index 7d9098dde..da3b35a05 100644 --- a/cpp/benchmarks/fixture/rmm_pool_raii.hpp +++ b/cpp/benchmarks/fixture/rmm_pool_raii.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, NVIDIA CORPORATION. + * Copyright (c) 2022-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. @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#pragma once +#include #include #include #include @@ -48,7 +50,8 @@ class rmm_pool_raii { inline auto make_pool() { - return rmm::mr::make_owning_wrapper(make_cuda()); + return rmm::mr::make_owning_wrapper( + make_cuda(), rmm::percent_of_free_device_memory(50)); } public: diff --git a/cpp/cuproj/CMakeLists.txt b/cpp/cuproj/CMakeLists.txt index b9b5a9340..2e1531b09 100644 --- a/cpp/cuproj/CMakeLists.txt +++ b/cpp/cuproj/CMakeLists.txt @@ -25,7 +25,7 @@ include(rapids-find) rapids_cuda_init_architectures(CUPROJ) -project(CUPROJ VERSION 23.12.01 LANGUAGES C CXX CUDA) +project(CUPROJ VERSION 24.02.00 LANGUAGES C CXX CUDA) # Needed because GoogleBenchmark changes the state of FindThreads.cmake, # causing subsequent runs to have different values for the `Threads::Threads` target. diff --git a/cpp/cuproj/benchmarks/fixture/benchmark_fixture.hpp b/cpp/cuproj/benchmarks/fixture/benchmark_fixture.hpp index 08e5dff51..a41e69393 100644 --- a/cpp/cuproj/benchmarks/fixture/benchmark_fixture.hpp +++ b/cpp/cuproj/benchmarks/fixture/benchmark_fixture.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-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. @@ -14,12 +14,16 @@ * limitations under the License. */ -#include +#pragma once + +#include #include #include #include #include +#include + namespace cuspatial { namespace { @@ -28,7 +32,8 @@ inline auto make_cuda() { return std::make_shared inline auto make_pool() { - return rmm::mr::make_owning_wrapper(make_cuda()); + return rmm::mr::make_owning_wrapper( + make_cuda(), rmm::percent_of_free_device_memory(50)); } } // namespace diff --git a/cpp/cuproj/doxygen/Doxyfile b/cpp/cuproj/doxygen/Doxyfile index 73b77084a..3a3332fca 100644 --- a/cpp/cuproj/doxygen/Doxyfile +++ b/cpp/cuproj/doxygen/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = libcuproj # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 23.12.01 +PROJECT_NUMBER = 24.02.00 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -2345,7 +2345,7 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/23.12 "libcudf.tag=https://docs.rapids.ai/api/libcudf/23.12" +TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/24.02 "libcudf.tag=https://docs.rapids.ai/api/libcudf/24.02" # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to diff --git a/cpp/doxygen/Doxyfile b/cpp/doxygen/Doxyfile index 025058551..3e8ec740d 100644 --- a/cpp/doxygen/Doxyfile +++ b/cpp/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "libcuspatial" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 23.12.01 +PROJECT_NUMBER = 24.02.00 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -2171,7 +2171,7 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/23.12 "libcudf.tag=https://docs.rapids.ai/api/libcudf/23.12" +TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/24.02 "libcudf.tag=https://docs.rapids.ai/api/libcudf/24.02" # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to diff --git a/cpp/include/cuspatial/column/geometry_column_view.hpp b/cpp/include/cuspatial/column/geometry_column_view.hpp index f872c4d37..56845b271 100644 --- a/cpp/include/cuspatial/column/geometry_column_view.hpp +++ b/cpp/include/cuspatial/column/geometry_column_view.hpp @@ -16,7 +16,6 @@ #pragma once -#include #include #include diff --git a/cpp/include/cuspatial/detail/index/construction/phase_1.cuh b/cpp/include/cuspatial/detail/index/construction/phase_1.cuh index 83866e01f..b06dbc6bb 100644 --- a/cpp/include/cuspatial/detail/index/construction/phase_1.cuh +++ b/cpp/include/cuspatial/detail/index/construction/phase_1.cuh @@ -38,6 +38,8 @@ #include #include +#include + #include #include #include @@ -73,14 +75,14 @@ compute_point_keys_and_sorted_indices(PointIt points_first, points_first, points_last, keys.begin(), - [=] __device__(vec_2d const& point) { + cuda::proclaim_return_type([=] __device__(vec_2d const& point) { if (point.x < min.x || point.x > max.x || point.y < min.y || point.y > max.y) { // If the point is outside the bbox, return a max_level key return static_cast((1 << (2 * max_depth)) - 1); } return cuspatial::detail::utility::z_order(static_cast((point.x - min.x) / scale), static_cast((point.y - min.y) / scale)); - }); + })); rmm::device_uvector indices(keys.size(), stream, mr); @@ -145,7 +147,9 @@ inline std::tuple, std::vector> buil // iterator for the parent level's quad node keys auto parent_keys = thrust::make_transform_iterator( - keys_begin, [] __device__(uint32_t const child_key) { return (child_key >> 2); }); + keys_begin, cuda::proclaim_return_type([] __device__(uint32_t const child_key) { + return (child_key >> 2); + })); // iterator for the current level's quad node point and child counts auto child_nodes = thrust::make_zip_iterator(quad_point_count_begin, quad_child_count_begin); diff --git a/cpp/include/cuspatial/detail/join/quadtree_bbox_filtering.cuh b/cpp/include/cuspatial/detail/join/quadtree_bbox_filtering.cuh index 9ba8744d0..c3009b1b2 100644 --- a/cpp/include/cuspatial/detail/join/quadtree_bbox_filtering.cuh +++ b/cpp/include/cuspatial/detail/join/quadtree_bbox_filtering.cuh @@ -24,6 +24,8 @@ #include +#include + #include #include @@ -47,10 +49,10 @@ join_quadtree_and_bounding_boxes(point_quadtree_ref quadtree, // Count the number of top-level nodes to start. // This could be provided explicitly, but count_if should be fast enough. - auto num_top_level_leaves = thrust::count_if(rmm::exec_policy(stream), - quadtree.level_begin(), - quadtree.level_end(), - thrust::placeholders::_1 == 0); + int32_t num_top_level_leaves = thrust::count_if(rmm::exec_policy(stream), + quadtree.level_begin(), + quadtree.level_end(), + thrust::placeholders::_1 == 0); auto num_pairs = num_top_level_leaves * num_boxes; @@ -89,10 +91,14 @@ join_quadtree_and_bounding_boxes(point_quadtree_ref quadtree, bounding_boxes_first, // The top-level node indices detail::make_counting_transform_iterator( - 0, [=] __device__(auto i) { return i % num_top_level_leaves; }), + 0, cuda::proclaim_return_type([=] __device__(auto i) { + return i % num_top_level_leaves; + })), // The top-level bbox indices detail::make_counting_transform_iterator( - 0, [=] __device__(auto i) { return i / num_top_level_leaves; }), + 0, cuda::proclaim_return_type([=] __device__(auto i) { + return i / num_top_level_leaves; + })), make_current_level_iter(), // intermediate intersections or parent // quadrants found during traversal // found intersecting quadrant and bbox indices for output diff --git a/cpp/include/cuspatial/detail/join/quadtree_point_to_nearest_linestring.cuh b/cpp/include/cuspatial/detail/join/quadtree_point_to_nearest_linestring.cuh index bdd0c611e..f594f51a3 100644 --- a/cpp/include/cuspatial/detail/join/quadtree_point_to_nearest_linestring.cuh +++ b/cpp/include/cuspatial/detail/join/quadtree_point_to_nearest_linestring.cuh @@ -34,6 +34,8 @@ #include #include +#include + #include namespace cuspatial { @@ -247,7 +249,8 @@ quadtree_point_to_nearest_linestring(LinestringIndexIterator linestring_indices_ auto all_point_indices = thrust::make_transform_iterator(all_point_linestring_indices_and_distances, - [] __device__(auto const& x) { return thrust::get<0>(x); }); + cuda::proclaim_return_type( + [] __device__(auto const& x) { return thrust::get<0>(x); })); // Allocate vectors for the distances min reduction auto num_points = std::distance(point_indices_first, point_indices_last); @@ -272,22 +275,23 @@ quadtree_point_to_nearest_linestring(LinestringIndexIterator linestring_indices_ thrust::make_discard_iterator(), output_linestring_idxs.begin(), output_distances.begin()), thrust::equal_to(), // comparator // binop to select the point/linestring pair with the smallest distance - [] __device__(auto const& lhs, auto const& rhs) { - T const& d_lhs = thrust::get<2>(lhs); - T const& d_rhs = thrust::get<2>(rhs); - // If lhs distance is 0, choose rhs - if (d_lhs == T{0}) { return rhs; } - // if rhs distance is 0, choose lhs - if (d_rhs == T{0}) { return lhs; } - // If distances to lhs/rhs are the same, choose linestring with smallest id - if (d_lhs == d_rhs) { - auto const& i_lhs = thrust::get<1>(lhs); - auto const& i_rhs = thrust::get<1>(rhs); - return i_lhs < i_rhs ? lhs : rhs; - } - // Otherwise choose linestring with smallest distance - return d_lhs < d_rhs ? lhs : rhs; - }); + cuda::proclaim_return_type>( + [] __device__(auto const& lhs, auto const& rhs) { + T const& d_lhs = thrust::get<2>(lhs); + T const& d_rhs = thrust::get<2>(rhs); + // If lhs distance is 0, choose rhs + if (d_lhs == T{0}) { return rhs; } + // if rhs distance is 0, choose lhs + if (d_rhs == T{0}) { return lhs; } + // If distances to lhs/rhs are the same, choose linestring with smallest id + if (d_lhs == d_rhs) { + auto const& i_lhs = thrust::get<1>(lhs); + auto const& i_rhs = thrust::get<1>(rhs); + return i_lhs < i_rhs ? lhs : rhs; + } + // Otherwise choose linestring with smallest distance + return d_lhs < d_rhs ? lhs : rhs; + })); auto const num_distances = thrust::distance(point_idxs.begin(), point_idxs_end.first); diff --git a/cpp/include/cuspatial/detail/point_quadtree.cuh b/cpp/include/cuspatial/detail/point_quadtree.cuh index 3e70d1fe2..ebe9b02e6 100644 --- a/cpp/include/cuspatial/detail/point_quadtree.cuh +++ b/cpp/include/cuspatial/detail/point_quadtree.cuh @@ -30,6 +30,8 @@ #include #include +#include + #include namespace cuspatial { @@ -108,9 +110,9 @@ inline point_quadtree make_quad_tree(rmm::device_uvector& keys, offsets_iter + num_valid_nodes, offsets.begin(), // return is_internal_node ? lhs : rhs - [] __device__(auto const& t) { + cuda::proclaim_return_type([] __device__(auto const& t) { return thrust::get<0>(t) ? thrust::get<1>(t) : thrust::get<2>(t); - }); + })); return std::move(offsets); }(); @@ -126,9 +128,9 @@ inline point_quadtree make_quad_tree(rmm::device_uvector& keys, lengths_iter + num_valid_nodes, lengths.begin(), // return bool ? lhs : rhs - [] __device__(auto const& t) { + cuda::proclaim_return_type([] __device__(auto const& t) { return thrust::get<0>(t) ? thrust::get<1>(t) : thrust::get<2>(t); - }); + })); // Shrink keys to the number of valid nodes keys.resize(num_valid_nodes, stream); diff --git a/cpp/include/cuspatial_test/vector_factories.cuh b/cpp/include/cuspatial_test/vector_factories.cuh index cbf1d8f56..139d411c5 100644 --- a/cpp/include/cuspatial_test/vector_factories.cuh +++ b/cpp/include/cuspatial_test/vector_factories.cuh @@ -68,12 +68,6 @@ auto make_device_uvector(std::initializer_list inl, return res; } -template -auto make_host_vector(std::initializer_list inl) -{ - return thrust::host_vector{inl.begin(), inl.end()}; -} - /** * @brief Owning object of a multipolygon array following geoarrow layout. * diff --git a/cpp/src/join/quadtree_point_in_polygon.cu b/cpp/src/join/quadtree_point_in_polygon.cu index 452b4fe21..2d94504af 100644 --- a/cpp/src/join/quadtree_point_in_polygon.cu +++ b/cpp/src/join/quadtree_point_in_polygon.cu @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "rmm/device_buffer.hpp" #include #include #include @@ -29,6 +28,7 @@ #include #include +#include namespace cuspatial { namespace detail { diff --git a/cpp/tests/distance/hausdorff_test.cu b/cpp/tests/distance/hausdorff_test.cu index 453ee02f3..6ef18341f 100644 --- a/cpp/tests/distance/hausdorff_test.cu +++ b/cpp/tests/distance/hausdorff_test.cu @@ -30,6 +30,8 @@ #include #include +#include + #include template @@ -43,7 +45,7 @@ struct HausdorffTest : public ::testing::Test { auto const d_space_offsets = rmm::device_vector{space_offsets}; auto const num_distances = space_offsets.size() * space_offsets.size(); - auto distances = rmm::device_vector{num_distances}; + auto distances = rmm::device_vector(num_distances); auto const distances_end = cuspatial::directed_hausdorff_distance(d_points.begin(), d_points.end(), @@ -150,10 +152,12 @@ void generic_hausdorff_test() auto zero_iter = thrust::make_constant_iterator({0, 0}); auto counting_iter = thrust::make_counting_iterator(0); auto space_offset_iter = thrust::make_transform_iterator( - counting_iter, [] __device__(auto idx) { return idx * elements_per_space; }); + counting_iter, cuda::proclaim_return_type([] __device__(auto idx) { + return idx * elements_per_space; + })); - auto distances = rmm::device_vector{num_distances}; - auto expected = rmm::device_vector{num_distances, 0}; + auto distances = rmm::device_vector(num_distances); + auto expected = rmm::device_vector(num_distances, 0); auto distances_end = cuspatial::directed_hausdorff_distance(zero_iter, zero_iter + num_points, diff --git a/cpp/tests/distance/haversine_test.cu b/cpp/tests/distance/haversine_test.cu index b0798a37d..3af600876 100644 --- a/cpp/tests/distance/haversine_test.cu +++ b/cpp/tests/distance/haversine_test.cu @@ -59,8 +59,8 @@ TYPED_TEST(HaversineTest, Zero) auto a_lonlat = rmm::device_vector(1, Location{0, 0}); auto b_lonlat = rmm::device_vector(1, Location{0, 0}); - auto distance = rmm::device_vector{1, -1}; - auto expected = rmm::device_vector{1, 0}; + auto distance = rmm::device_vector(1, -1); + auto expected = rmm::device_vector(1, 0); auto distance_end = cuspatial::haversine_distance( a_lonlat.begin(), a_lonlat.end(), b_lonlat.begin(), distance.begin()); diff --git a/cpp/tests/distance/linestring_distance_test.cu b/cpp/tests/distance/linestring_distance_test.cu index cb9836392..0748d9c59 100644 --- a/cpp/tests/distance/linestring_distance_test.cu +++ b/cpp/tests/distance/linestring_distance_test.cu @@ -209,8 +209,8 @@ TYPED_TEST(PairwiseLinestringDistanceTest, FromLongInputs) auto offset = rmm::device_vector{std::vector{0, 100, 200, 300, 400, num_points}}; - auto got = rmm::device_vector{num_pairs}; - auto expected = rmm::device_vector{std::vector{42.0, 42.0, 42.0, 42.0, 42.0}}; + auto got = rmm::device_vector(num_pairs); + auto expected = rmm::device_vector{{42.0, 42.0, 42.0, 42.0, 42.0}}; auto mlinestrings1 = make_multilinestring_range(num_pairs, thrust::make_counting_iterator(0), diff --git a/cpp/tests/index/point_quadtree_test.cu b/cpp/tests/index/point_quadtree_test.cu index dd22df218..27b911628 100644 --- a/cpp/tests/index/point_quadtree_test.cu +++ b/cpp/tests/index/point_quadtree_test.cu @@ -97,7 +97,7 @@ TYPED_TEST(QuadtreeOnPointIndexingTest, test_single) max_size, {0}, {0}, - cuspatial::test::make_host_vector({false}), + thrust::host_vector{{false}}, {1}, {0}); } @@ -120,7 +120,7 @@ TYPED_TEST(QuadtreeOnPointIndexingTest, test_two) max_size, {0, 3}, {0, 0}, - cuspatial::test::make_host_vector({false, false}), + thrust::host_vector{{false, false}}, {1, 1}, {0, 1}); } @@ -142,7 +142,7 @@ TYPED_TEST(QuadtreeOnPointIndexingTest, test_all_lowest_level_quads) max_size, {3, 12, 15}, {0, 1, 1}, - cuspatial::test::make_host_vector({true, false, false}), + thrust::host_vector{{true, false, false}}, {2, 1, 1}, {1, 0, 1}); } @@ -203,20 +203,20 @@ TYPED_TEST(QuadtreeOnPointIndexingTest, test_small) max_size, {0, 1, 2, 0, 1, 3, 4, 7, 5, 6, 13, 14, 28, 31}, {0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2}, - cuspatial::test::make_host_vector({true, - true, - false, - false, - true, - true, - false, - true, - false, - false, - false, - false, - false, - false}), + thrust::host_vector{{true, + true, + false, + false, + true, + true, + false, + true, + false, + false, + false, + false, + false, + false}}, {3, 2, 11, 7, 2, 2, 9, 2, 9, 7, 5, 8, 8, 7}, {3, 6, 60, 0, 8, 10, 36, 12, 7, 16, 23, 28, 45, 53}); } diff --git a/cpp/tests/intersection/linestring_intersection_test.cu b/cpp/tests/intersection/linestring_intersection_test.cu index a2e5b3693..7f758821c 100644 --- a/cpp/tests/intersection/linestring_intersection_test.cu +++ b/cpp/tests/intersection/linestring_intersection_test.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-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. @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/cpp/tests/point_in_polygon/pairwise_point_in_polygon_test.cu b/cpp/tests/point_in_polygon/pairwise_point_in_polygon_test.cu index 0dc955204..af9117021 100644 --- a/cpp/tests/point_in_polygon/pairwise_point_in_polygon_test.cu +++ b/cpp/tests/point_in_polygon/pairwise_point_in_polygon_test.cu @@ -98,9 +98,8 @@ TYPED_TEST(PairwisePointInPolygonTest, OnePolygonOneRing) poly_point.size(), poly_point.begin()); - auto got = rmm::device_vector(1); - auto expected = - cuspatial::test::make_host_vector({false, false, false, false, true, true, true, true}); + auto got = rmm::device_vector(1); + auto expected = thrust::host_vector{{false, false, false, false, true, true, true, true}}; for (size_t i = 0; i < point_list.size(); ++i) { auto p = point_list[i]; diff --git a/cpp/tests/trajectory/trajectory_distances_and_speeds_test.cu b/cpp/tests/trajectory/trajectory_distances_and_speeds_test.cu index 666b3c20b..819dae901 100644 --- a/cpp/tests/trajectory/trajectory_distances_and_speeds_test.cu +++ b/cpp/tests/trajectory/trajectory_distances_and_speeds_test.cu @@ -29,6 +29,8 @@ #include #include +#include + #include #include @@ -66,7 +68,8 @@ struct TrajectoryDistancesAndSpeedsTest : public ::testing::Test { thrust::reduce(expected_speeds.begin(), expected_speeds.end(), std::numeric_limits::lowest(), - [] __device__(T const& a, T const& b) { return max(abs(a), abs(b)); }); + cuda::proclaim_return_type( + [] __device__(T const& a, T const& b) { return max(abs(a), abs(b)); })); // We expect the floating point error (in ulps) due to be proportional to the number of // operations to compute the relevant quantity. For distance, this computation is diff --git a/cpp/tests/trajectory/trajectory_test_utils.cuh b/cpp/tests/trajectory/trajectory_test_utils.cuh index 679674674..847748fc6 100644 --- a/cpp/tests/trajectory/trajectory_test_utils.cuh +++ b/cpp/tests/trajectory/trajectory_test_utils.cuh @@ -296,7 +296,7 @@ struct trajectory_test_data { auto id_and_position = thrust::make_zip_iterator(ids_sorted.begin(), points_sorted.begin()); - auto distance_per_step = rmm::device_vector{points.size()}; + auto distance_per_step = rmm::device_vector(points.size()); thrust::transform(rmm::exec_policy(), id_and_position, diff --git a/cpp/tests/utility_test/test_float_equivalent.cu b/cpp/tests/utility_test/test_float_equivalent.cu index ef462178f..8fe74c357 100644 --- a/cpp/tests/utility_test/test_float_equivalent.cu +++ b/cpp/tests/utility_test/test_float_equivalent.cu @@ -65,7 +65,7 @@ void run_test(T base) rmm::device_vector d_first(first); rmm::device_vector d_second(second); - auto expected = make_host_vector({true, false, true, false}); + auto expected = thrust::host_vector{{true, false, true, false}}; rmm::device_vector got(4); thrust::transform( diff --git a/dependencies.yaml b/dependencies.yaml index c7f520cab..bf12858b3 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -8,7 +8,8 @@ files: includes: - build_cpp - build_python - - cudatoolkit + - cuda + - cuda_version - develop - docs - py_version @@ -23,18 +24,18 @@ files: test_cpp: output: none includes: - - cudatoolkit + - cuda_version test_python: output: none includes: - - cudatoolkit + - cuda_version - py_version - test_python_cuspatial - test_python_cuproj test_notebooks: output: none includes: - - cudatoolkit + - cuda_version - depends_on_cuml - notebooks - py_version @@ -46,7 +47,7 @@ files: docs: output: none includes: - - cudatoolkit + - cuda_version - docs - py_version py_build_cuspatial: @@ -85,7 +86,7 @@ files: includes: - depends_on_rmm - build_cpp_cuproj - - build_python_cuproj + - build_python - build_wheels py_run_cuproj: output: [pyproject] @@ -123,8 +124,8 @@ dependencies: - cxx-compiler - gmock>=1.13.0 - gtest>=1.13.0 - - libcudf==23.12.* - - librmm==23.12.* + - libcudf==24.2.* + - librmm==24.2.* - proj - sqlite specific: @@ -155,7 +156,6 @@ dependencies: - matrix: cuda: "12.0" packages: - - cuda-version=12.0 - cuda-nvcc build_cpp_cuproj: common: @@ -169,7 +169,7 @@ dependencies: - cxx-compiler - gmock>=1.13.0 - gtest>=1.13.0 - - librmm==23.12.* + - librmm==24.2.* - proj - sqlite specific: @@ -200,35 +200,18 @@ dependencies: - matrix: cuda: "12.0" packages: - - cuda-version=12.0 - cuda-nvcc build_python: common: - output_types: [conda, requirements, pyproject] packages: - cython>=3.0.0 - - scikit-build>=0.13.1 - - setuptools - specific: - output_types: conda - matrices: - - matrix: - arch: x86_64 - packages: - - *gcc_amd64 - - *sysroot_amd64 - - matrix: - arch: aarch64 - packages: - - *gcc_aarch64 - - *sysroot_aarch64 - build_python_cuproj: - common: - - output_types: [conda, requirements, pyproject] packages: - - cython>=3.0.0 - - scikit-build>=0.13.1 - - setuptools + - scikit-build-core>=0.7.0 + - output_types: [requirements, pyproject] + packages: + - scikit-build-core[pyproject]>=0.7.0 specific: - output_types: conda matrices: @@ -248,36 +231,43 @@ dependencies: packages: - wheel - setuptools - cudatoolkit: + cuda_version: specific: - output_types: conda matrices: - matrix: - cuda: "12.0" + cuda: "11.2" packages: - - cuda-version=12.0 - - cuda-cudart-dev - - cuda-nvrtc-dev - - cuda-cupti-dev + - cuda-version=11.2 - matrix: - cuda: "11.8" + cuda: "11.4" packages: - - cuda-version=11.8 - - cudatoolkit + - cuda-version=11.4 - matrix: cuda: "11.5" packages: - cuda-version=11.5 - - cudatoolkit - matrix: - cuda: "11.4" + cuda: "11.8" packages: - - cuda-version=11.4 - - cudatoolkit + - cuda-version=11.8 - matrix: - cuda: "11.2" + cuda: "12.0" + packages: + - cuda-version=12.0 + cuda: + specific: + - output_types: conda + matrices: + - matrix: + cuda: "12.*" + packages: + - cuda-cudart-dev + - cuda-cupti-dev + - cuda-nvrtc-dev + - matrix: + cuda: "11.*" packages: - - cuda-version=11.2 - cudatoolkit develop: common: @@ -360,22 +350,23 @@ dependencies: common: - output_types: conda packages: - - &rmm_conda rmm==23.12.* + - &rmm_conda rmm==24.2.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple specific: - output_types: [requirements, pyproject] matrices: - matrix: {cuda: "12.2"} packages: &rmm_packages_pip_cu12 - - rmm-cu12==23.12.* + - rmm-cu12==24.2.* - {matrix: {cuda: "12.1"}, packages: *rmm_packages_pip_cu12} - {matrix: {cuda: "12.0"}, packages: *rmm_packages_pip_cu12} - matrix: {cuda: "11.8"} packages: &rmm_packages_pip_cu11 - - rmm-cu11==23.12.* + - rmm-cu11==24.2.* - {matrix: {cuda: "11.5"}, packages: *rmm_packages_pip_cu11} - {matrix: {cuda: "11.4"}, packages: *rmm_packages_pip_cu11} - {matrix: {cuda: "11.2"}, packages: *rmm_packages_pip_cu11} @@ -385,22 +376,23 @@ dependencies: common: - output_types: conda packages: - - &cudf_conda cudf==23.12.* + - &cudf_conda cudf==24.2.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple specific: - output_types: [requirements, pyproject] matrices: - matrix: {cuda: "12.2"} packages: &cudf_packages_pip_cu12 - - cudf-cu12==23.12.* + - cudf-cu12==24.2.* - {matrix: {cuda: "12.1"}, packages: *cudf_packages_pip_cu12} - {matrix: {cuda: "12.0"}, packages: *cudf_packages_pip_cu12} - matrix: {cuda: "11.8"} packages: &cudf_packages_pip_cu11 - - cudf-cu11==23.12.* + - cudf-cu11==24.2.* - {matrix: {cuda: "11.5"}, packages: *cudf_packages_pip_cu11} - {matrix: {cuda: "11.4"}, packages: *cudf_packages_pip_cu11} - {matrix: {cuda: "11.2"}, packages: *cudf_packages_pip_cu11} @@ -410,22 +402,23 @@ dependencies: common: - output_types: conda packages: - - &cuml_conda cuml==23.12.* + - &cuml_conda cuml==24.2.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple specific: - output_types: [requirements, pyproject] matrices: - matrix: {cuda: "12.2"} packages: &cuml_packages_pip_cu12 - - cuml-cu12==23.12.* + - cuml-cu12==24.2.* - {matrix: {cuda: "12.1"}, packages: *cuml_packages_pip_cu12} - {matrix: {cuda: "12.0"}, packages: *cuml_packages_pip_cu12} - matrix: {cuda: "11.8"} packages: &cuml_packages_pip_cu11 - - cuml-cu11==23.12.* + - cuml-cu11==24.2.* - {matrix: {cuda: "11.5"}, packages: *cuml_packages_pip_cu11} - {matrix: {cuda: "11.4"}, packages: *cuml_packages_pip_cu11} - {matrix: {cuda: "11.2"}, packages: *cuml_packages_pip_cu11} @@ -435,22 +428,23 @@ dependencies: common: - output_types: conda packages: - - &cuspatial_conda cuspatial==23.12.* + - &cuspatial_conda cuspatial==24.2.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple specific: - output_types: [requirements, pyproject] matrices: - matrix: {cuda: "12.2"} packages: &cuspatial_packages_pip_cu12 - - cuspatial-cu12==23.12.* + - cuspatial-cu12==24.2.* - {matrix: {cuda: "12.1"}, packages: *cuspatial_packages_pip_cu12} - {matrix: {cuda: "12.0"}, packages: *cuspatial_packages_pip_cu12} - matrix: {cuda: "11.8"} packages: &cuspatial_packages_pip_cu11 - - cuspatial-cu11==23.12.* + - cuspatial-cu11==24.2.* - {matrix: {cuda: "11.5"}, packages: *cuspatial_packages_pip_cu11} - {matrix: {cuda: "11.4"}, packages: *cuspatial_packages_pip_cu11} - {matrix: {cuda: "11.2"}, packages: *cuspatial_packages_pip_cu11} diff --git a/docs/cuproj/source/conf.py b/docs/cuproj/source/conf.py index 6ae4bf5ae..e6c3cb45f 100644 --- a/docs/cuproj/source/conf.py +++ b/docs/cuproj/source/conf.py @@ -50,9 +50,9 @@ # built documents. # # The short X.Y version. -version = '23.12' +version = '24.02' # The full version, including alpha/beta/rc tags. -release = '23.12.01' +release = '24.02.00' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/cuproj/source/user_guide/cuproj_api_examples.ipynb b/docs/cuproj/source/user_guide/cuproj_api_examples.ipynb index c9d11941f..9311b11ad 100644 --- a/docs/cuproj/source/user_guide/cuproj_api_examples.ipynb +++ b/docs/cuproj/source/user_guide/cuproj_api_examples.ipynb @@ -45,7 +45,7 @@ "metadata": {}, "outputs": [], "source": [ - "# !conda create -n rapids-23.12 --solver=libmamba -c rapidsai -c conda-forge -c nvidia \\ \n", + "# !conda create -n rapids-24.02 --solver=libmamba -c rapidsai -c conda-forge -c nvidia \\ \n", "# cuproj-23.12 python=3.10 cuda-version=12.0" ] }, diff --git a/docs/source/conf.py b/docs/source/conf.py index a8f485219..71d359a6b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,9 +50,9 @@ # built documents. # # The short X.Y version. -version = '23.12' +version = '24.02' # The full version, including alpha/beta/rc tags. -release = '23.12.01' +release = '24.02.00' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/user_guide/cuspatial_api_examples.ipynb b/docs/source/user_guide/cuspatial_api_examples.ipynb index 027428a04..836df1456 100644 --- a/docs/source/user_guide/cuspatial_api_examples.ipynb +++ b/docs/source/user_guide/cuspatial_api_examples.ipynb @@ -57,8 +57,8 @@ "metadata": {}, "outputs": [], "source": [ - "# !conda create -n rapids-23.12 -c rapidsai -c conda-forge -c nvidia \\ \n", - "# cuspatial=23.12 python=3.9 cudatoolkit=11.5 " + "# !conda create -n rapids-24.02 -c rapidsai -c conda-forge -c nvidia \\ \n", + "# cuspatial=24.02 python=3.9 cudatoolkit=11.5 " ] }, { diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index dc02bb365..9c1a36541 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -12,7 +12,7 @@ # the License. # ============================================================================= if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUSPATIAL_RAPIDS.cmake) - file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.12/RAPIDS.cmake + file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.02/RAPIDS.cmake ${CMAKE_BINARY_DIR}/CUSPATIAL_RAPIDS.cmake ) endif() diff --git a/python/cuproj/CMakeLists.txt b/python/cuproj/CMakeLists.txt index cb6871804..ba105e594 100644 --- a/python/cuproj/CMakeLists.txt +++ b/python/cuproj/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuproj_version 23.12.01) +set(cuproj_version 24.02.00) include(../../fetch_rapids.cmake) include(rapids-cuda) @@ -23,17 +23,11 @@ rapids_cuda_init_architectures(cuproj-python) project( cuproj-python VERSION ${cuproj_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) option(FIND_CUPROJ_CPP "Search for existing cuproj C++ installations before defaulting to local files" OFF) -option(CUPROJ_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF) - # If the user requested it we attempt to find cuproj. if(FIND_CUPROJ_CPP) find_package(cuproj ${cuproj_version}) @@ -44,37 +38,20 @@ endif() if(NOT cuproj_FOUND) set(BUILD_TESTS OFF) set(BUILD_BENCHMARKS OFF) - set(_exclude_from_all "") - if(CUPROJ_BUILD_WHEELS) - - # Statically link cudart if building wheels - set(CUDA_STATIC_RUNTIME ON) - - # Need to set this so all the cuproj targets are global, not only cuproj::cuproj - # https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_TARGETS_GLOBAL.html#variable:CMAKE_FIND_PACKAGE_TARGETS_GLOBAL - set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON) - - # Don't install the cuProj C++ targets into wheels - set(_exclude_from_all EXCLUDE_FROM_ALL) - endif() + set(CUDA_STATIC_RUNTIME ON) - add_subdirectory(../../cpp/cuproj cuproj-cpp ${_exclude_from_all}) - - set(cython_lib_dir cuproj) - - if(CUPROJ_BUILD_WHEELS) - include(../cuspatial/cmake/Modules/WheelHelpers.cmake) - endif() + add_subdirectory(../../cpp/cuproj cuproj-cpp EXCLUDE_FROM_ALL) # Since there are multiple subpackages of cuproj._lib that require access to libcuspatial, we place the # library in the cuproj directory as a single source of truth and modify the other rpaths # appropriately. + set(cython_lib_dir cuproj) install(TARGETS cuproj DESTINATION ${cython_lib_dir}) endif() add_subdirectory(cuproj/cuprojshim) -include(rapids-cython) +include(rapids-cython-core) rapids_cython_init() add_subdirectory(cuproj/_lib) diff --git a/python/cuproj/cuproj/cuprojshim/CMakeLists.txt b/python/cuproj/cuproj/cuprojshim/CMakeLists.txt index 6699b8877..315945c1d 100644 --- a/python/cuproj/cuproj/cuprojshim/CMakeLists.txt +++ b/python/cuproj/cuproj/cuprojshim/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuproj_version 23.12.01) +set(cuproj_version 24.02.00) include(../../../../fetch_rapids.cmake) include(rapids-cmake) diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index 48f75b442..aef974ee4 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -13,13 +13,13 @@ # limitations under the License. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "scikit_build_core.build" requires = [ "cmake>=3.26.4", "cython>=3.0.0", "ninja", - "rmm==23.12.*", - "scikit-build>=0.13.1", + "rmm==24.2.*", + "scikit-build-core[pyproject]>=0.7.0", "setuptools", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -34,7 +34,7 @@ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ "cupy-cuda11x>=12.0.0", - "rmm==23.12.*", + "rmm==24.2.*", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ "Intended Audience :: Developers", @@ -48,7 +48,7 @@ classifiers = [ [project.optional-dependencies] test = [ - "cuspatial==23.12.*", + "cuspatial==24.2.*", "geopandas>=0.11.0", "pyproj>=3.6.0,<3.7a0", "pytest", @@ -60,12 +60,6 @@ test = [ Homepage = "https://github.com/rapidsai/cuspatial/python/cuproj" Documentation = "https://docs.rapids.ai/api/cuproj/stable/" -[tool.setuptools] -license-files = ["LICENSE"] - -[tool.setuptools.dynamic] -version = {file = "cuproj/VERSION"} - [tool.isort] line_length = 79 multi_line_output = 3 @@ -100,3 +94,18 @@ skip = [ "dist", "__init__.py", ] + +[tool.scikit-build] +build-dir = "build/{wheel_tag}" +cmake.build-type = "Release" +cmake.minimum-version = "3.26.4" +ninja.make-fallback = true +sdist.exclude = ["*tests*"] +sdist.reproducible = true +wheel.exclude = ["*.clang-format"] +wheel.packages = ["cuproj"] + +[tool.scikit-build.metadata.version] +provider = "scikit_build_core.metadata.regex" +input = "cuproj/VERSION" +regex = "(?P.*)" diff --git a/python/cuproj/setup.py b/python/cuproj/setup.py deleted file mode 100644 index bb97c04ec..000000000 --- a/python/cuproj/setup.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. -from setuptools import find_packages -from skbuild import setup - -packages = find_packages(include=["cuproj*"]) - -setup( - packages=packages, - package_data={ - key: ["VERSION", "*.pxd", "*.hpp", "*.cuh"] for key in packages - }, - zip_safe=False, -) diff --git a/python/cuspatial/CMakeLists.txt b/python/cuspatial/CMakeLists.txt index 1e9067b30..a23af3125 100644 --- a/python/cuspatial/CMakeLists.txt +++ b/python/cuspatial/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuspatial_version 23.12.01) +set(cuspatial_version 24.02.00) include(../../fetch_rapids.cmake) include(rapids-cuda) @@ -23,17 +23,11 @@ rapids_cuda_init_architectures(cuspatial-python) project( cuspatial-python VERSION ${cuspatial_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) option(FIND_CUSPATIAL_CPP "Search for existing cuspatial C++ installations before defaulting to local files" OFF) -option(CUSPATIAL_BUILD_WHEELS "Whether this build is generating a Python wheel." OFF) - # If the user requested it we attempt to find cuspatial. if(FIND_CUSPATIAL_CPP) find_package(cuspatial ${cuspatial_version}) @@ -44,43 +38,25 @@ endif() if(NOT cuspatial_FOUND) set(BUILD_TESTS OFF) set(BUILD_BENCHMARKS OFF) - set(_exclude_from_all "") - if(CUSPATIAL_BUILD_WHEELS) - - # Statically link cudart if building wheels - set(CUDA_STATIC_RUNTIME ON) - set(CUSPATIAL_USE_CUDF_STATIC ON) - set(CUSPATIAL_EXCLUDE_CUDF_FROM_ALL ON) - - # Always build wheels against the pyarrow libarrow. - set(USE_LIBARROW_FROM_PYARROW ON) - - # Need to set this so all the nvcomp targets are global, not only nvcomp::nvcomp - # https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_PACKAGE_TARGETS_GLOBAL.html#variable:CMAKE_FIND_PACKAGE_TARGETS_GLOBAL - set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON) + set(CUDA_STATIC_RUNTIME ON) + set(CUSPATIAL_USE_CUDF_STATIC ON) + set(CUSPATIAL_EXCLUDE_CUDF_FROM_ALL ON) - # Don't install the cuSpatial C++ targets into wheels - set(_exclude_from_all EXCLUDE_FROM_ALL) - endif() - - add_subdirectory(../../cpp cuspatial-cpp ${_exclude_from_all}) + add_subdirectory(../../cpp cuspatial-cpp EXCLUDE_FROM_ALL) set(cython_lib_dir cuspatial) - - if(CUSPATIAL_BUILD_WHEELS) - include(cmake/Modules/WheelHelpers.cmake) - get_target_property(_nvcomp_link_libs nvcomp::nvcomp INTERFACE_LINK_LIBRARIES) - # Ensure all the shared objects we need at runtime are in the wheel - add_target_libs_to_wheel(LIB_DIR ${cython_lib_dir} TARGETS arrow_shared nvcomp::nvcomp ${_nvcomp_link_libs}) - endif() - - # Since there are multiple subpackages of cuspatial._lib that require access to libcuspatial, we place the - # library in the cuspatial directory as a single source of truth and modify the other rpaths - # appropriately. - install(TARGETS cuspatial DESTINATION ${cython_lib_dir}) + include(cmake/Modules/WheelHelpers.cmake) + # TODO: This install is currently overzealous. We should only install the libraries that are + # downloaded by CPM during the build, not libraries that were found on the system. However, in + # practice this would only be a problem if libcudf was not found but some of the + # dependencies were, and we have no real use cases where that happens. + install_aliased_imported_targets( + TARGETS cuspatial arrow_shared nvcomp::nvcomp nvcomp::nvcomp_gdeflate nvcomp::nvcomp_bitcomp + DESTINATION ${cython_lib_dir} + ) endif() -include(rapids-cython) +include(rapids-cython-core) rapids_cython_init() add_subdirectory(cuspatial/_lib) diff --git a/python/cuspatial/cmake/Modules/WheelHelpers.cmake b/python/cuspatial/cmake/Modules/WheelHelpers.cmake index 41d720c52..278d6751c 100644 --- a/python/cuspatial/cmake/Modules/WheelHelpers.cmake +++ b/python/cuspatial/cmake/Modules/WheelHelpers.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. +# 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 @@ -14,15 +14,15 @@ include_guard(GLOBAL) # Making libraries available inside wheels by installing the associated targets. -function(add_target_libs_to_wheel) - list(APPEND CMAKE_MESSAGE_CONTEXT "add_target_libs_to_wheel") +function(install_aliased_imported_targets) + list(APPEND CMAKE_MESSAGE_CONTEXT "install_aliased_imported_targets") set(options "") - set(one_value "LIB_DIR") + set(one_value "DESTINATION") set(multi_value "TARGETS") cmake_parse_arguments(_ "${options}" "${one_value}" "${multi_value}" ${ARGN}) - message(VERBOSE "Installing targets '${__TARGETS}' into lib_dir '${__LIB_DIR}'") + message(VERBOSE "Installing targets '${__TARGETS}' into lib_dir '${__DESTINATION}'") foreach(target IN LISTS __TARGETS) @@ -38,34 +38,22 @@ function(add_target_libs_to_wheel) get_target_property(is_imported ${target} IMPORTED) if(NOT is_imported) - # If the target isn't imported, install it into the the wheel - install(TARGETS ${target} DESTINATION ${__LIB_DIR}) - message(VERBOSE "install(TARGETS ${target} DESTINATION ${__LIB_DIR})") + # If the target isn't imported, install it into the wheel + install(TARGETS ${target} DESTINATION ${__DESTINATION}) + message(VERBOSE "install(TARGETS ${target} DESTINATION ${__DESTINATION})") else() # If the target is imported, make sure it's global - get_target_property(already_global ${target} IMPORTED_GLOBAL) - if(NOT already_global) - set_target_properties(${target} PROPERTIES IMPORTED_GLOBAL TRUE) + get_target_property(type ${target} TYPE) + if(${type} STREQUAL "UNKNOWN_LIBRARY") + install(FILES $ DESTINATION ${__DESTINATION}) + message(VERBOSE "install(FILES $ DESTINATION ${__DESTINATION})") + else() + install(IMPORTED_RUNTIME_ARTIFACTS ${target} DESTINATION ${__DESTINATION}) + message( + VERBOSE + "install(IMPORTED_RUNTIME_ARTIFACTS $ DESTINATION ${__DESTINATION})" + ) endif() - - # Find the imported target's library so we can copy it into the wheel - set(lib_loc) - foreach(prop IN ITEMS IMPORTED_LOCATION IMPORTED_LOCATION_RELEASE IMPORTED_LOCATION_DEBUG) - get_target_property(lib_loc ${target} ${prop}) - if(lib_loc) - message(VERBOSE "Found ${prop} for ${target}: ${lib_loc}") - break() - endif() - message(VERBOSE "${target} has no value for property ${prop}") - endforeach() - - if(NOT lib_loc) - message(FATAL_ERROR "Found no libs to install for target ${target}") - endif() - - # Copy the imported library into the wheel - install(FILES ${lib_loc} DESTINATION ${__LIB_DIR}) - message(VERBOSE "install(FILES ${lib_loc} DESTINATION ${__LIB_DIR})") endif() endforeach() endfunction() diff --git a/python/cuspatial/cuspatial/core/_column/geocolumn.py b/python/cuspatial/cuspatial/core/_column/geocolumn.py index 01f51f03b..5ad1ffb55 100644 --- a/python/cuspatial/cuspatial/core/_column/geocolumn.py +++ b/python/cuspatial/cuspatial/core/_column/geocolumn.py @@ -8,7 +8,7 @@ import pyarrow as pa import cudf -from cudf.core.column import ColumnBase, arange, as_column, build_list_column +from cudf.core.column import ColumnBase, ListColumn, as_column from cuspatial.core._column.geometa import Feature_Enum, GeoMeta from cuspatial.utils.column_utils import empty_geometry_column @@ -178,10 +178,11 @@ def _from_multipoints_xy( if not multipoints_xy.dtype.kind == "f": raise ValueError("Coordinates must be floating point numbers.") - multipoint_col = build_list_column( - indices=geometry_offsets, - elements=_xy_as_variable_sized_list(multipoints_xy), + multi_elements = _xy_as_variable_sized_list(multipoints_xy) + multipoint_col = ListColumn( + dtype=cudf.ListDtype(multi_elements.dtype), size=len(geometry_offsets) - 1, + children=(geometry_offsets, multi_elements), ) num_multipoints = len(multipoint_col) @@ -232,15 +233,16 @@ def _from_linestrings_xy( if not linestrings_xy.dtype.kind == "f": raise ValueError("Coordinates must be floating point numbers.") - parts_col = build_list_column( - indices=part_offsets, - elements=_xy_as_variable_sized_list(linestrings_xy), + parts_elements = _xy_as_variable_sized_list(linestrings_xy) + parts_col = ListColumn( + dtype=cudf.ListDtype(parts_elements.dtype), size=len(part_offsets) - 1, + children=(part_offsets, parts_elements), ) - linestrings_col = build_list_column( - indices=geometry_offsets, - elements=parts_col, + linestrings_col = ListColumn( + dtype=cudf.ListDtype(parts_col.dtype), size=len(geometry_offsets) - 1, + children=(geometry_offsets, parts_col), ) num_linestrings = len(linestrings_col) @@ -292,20 +294,21 @@ def _from_polygons_xy( if not polygons_xy.dtype.kind == "f": raise ValueError("Coordinates must be floating point numbers.") - rings_col = build_list_column( - indices=ring_offsets, - elements=_xy_as_variable_sized_list(polygons_xy), + ring_elements = _xy_as_variable_sized_list(polygons_xy) + rings_col = ListColumn( + dtype=cudf.ListDtype(ring_elements.dtype), size=len(ring_offsets) - 1, + children=(ring_offsets, ring_elements), ) - parts_col = build_list_column( - indices=part_offsets, - elements=rings_col, + parts_col = ListColumn( + dtype=cudf.ListDtype(rings_col.dtype), size=len(part_offsets) - 1, + children=(part_offsets, rings_col), ) - polygons_col = build_list_column( - indices=geometry_offsets, - elements=parts_col, + polygons_col = ListColumn( + dtype=cudf.ListDtype(parts_col.dtype), size=len(geometry_offsets) - 1, + children=(geometry_offsets, parts_col), ) num_polygons = len(polygons_col) @@ -364,5 +367,7 @@ def _xy_as_variable_sized_list(xy: ColumnBase): raise ValueError("xy must have an even number of elements") num_points = len(xy) // 2 - indices = arange(0, num_points * 2 + 1, 2, dtype="int32") - return build_list_column(indices=indices, elements=xy, size=num_points) + indices = as_column(range(0, num_points * 2 + 1, 2), dtype="int32") + return ListColumn( + dtype=cudf.ListDtype(xy.dtype), size=num_points, children=(indices, xy) + ) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index 15e3aaa81..c19953107 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -1,5 +1,5 @@ import cudf -from cudf.core.column import arange, full +from cudf.core.column import as_column, full from cuspatial._lib.distance import ( pairwise_linestring_distance, @@ -190,8 +190,8 @@ def __call__(self): float("nan"), dtype="float64", ) - scatter_map = arange( - len(self._res_index), dtype="int32" + scatter_map = as_column( + range(len(self._res_index)), dtype="int32" ).apply_boolean_mask(self._non_null_mask) result[scatter_map] = dist diff --git a/python/cuspatial/cuspatial/core/binops/intersection.py b/python/cuspatial/cuspatial/core/binops/intersection.py index 731e03f09..b043121aa 100644 --- a/python/cuspatial/cuspatial/core/binops/intersection.py +++ b/python/cuspatial/cuspatial/core/binops/intersection.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING import cudf -from cudf.core.column import arange, build_list_column +from cudf.core.column import ListColumn, as_column from cuspatial._lib.intersection import ( pairwise_linestring_intersection as c_pairwise_linestring_intersection, @@ -84,18 +84,21 @@ def pairwise_linestring_intersection( # Organize the look back ids into list column (lhs_linestring_id, lhs_segment_id, rhs_linestring_id, rhs_segment_id,) = [ - build_list_column( - indices=geometry_collection_offset, - elements=id_, + ListColumn( + dtype=cudf.ListDtype(id_.dtype), size=len(geometry_collection_offset) - 1, + children=(geometry_collection_offset, id_), ) for id_ in look_back_ids ] - linestring_column = build_list_column( - indices=arange(0, len(segments) + 1, dtype="int32"), - elements=segments, - size=len(segments), + linestring_column = ListColumn( + dtype=cudf.ListDtype(segments.dtype), + size=segments.size, + children=( + as_column(range(0, len(segments) + 1), dtype="int32"), + segments, + ), ) coord_dtype = points.dtype.leaf_type diff --git a/python/cuspatial/cuspatial/core/spatial/distance.py b/python/cuspatial/cuspatial/core/spatial/distance.py index 309e88e21..f9a0b1d6b 100644 --- a/python/cuspatial/cuspatial/core/spatial/distance.py +++ b/python/cuspatial/cuspatial/core/spatial/distance.py @@ -91,7 +91,9 @@ def directed_hausdorff_distance(multipoints: GeoSeries): as_column(multipoints.multipoints.geometry_offset[:-1]), ) - return DataFrame._from_columns(result, range(num_spaces)) + # the column label of each column in result should be its int position + # e.g. a dict of {0: result[0], 1, result[1], ...} + return DataFrame._from_data(dict(enumerate(result))) def haversine_distance(p1: GeoSeries, p2: GeoSeries): diff --git a/python/cuspatial/pyproject.toml b/python/cuspatial/pyproject.toml index f2e464088..08e0c7ff9 100644 --- a/python/cuspatial/pyproject.toml +++ b/python/cuspatial/pyproject.toml @@ -13,14 +13,14 @@ # limitations under the License. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "scikit_build_core.build" requires = [ "cmake>=3.26.4", - "cudf==23.12.*", + "cudf==24.2.*", "cython>=3.0.0", "ninja", - "rmm==23.12.*", - "scikit-build>=0.13.1", + "rmm==24.2.*", + "scikit-build-core[pyproject]>=0.7.0", "setuptools", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -36,9 +36,9 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ - "cudf==23.12.*", + "cudf==24.2.*", "geopandas>=0.11.0", - "rmm==23.12.*", + "rmm==24.2.*", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ "Intended Audience :: Developers", @@ -61,12 +61,6 @@ test = [ Homepage = "https://github.com/rapidsai/cuspatial" Documentation = "https://docs.rapids.ai/api/cuspatial/stable/" -[tool.setuptools] -license-files = ["LICENSE"] - -[tool.setuptools.dynamic] -version = {file = "cuspatial/VERSION"} - [tool.isort] line_length = 79 multi_line_output = 3 @@ -110,3 +104,17 @@ skip = [ "dist", "__init__.py", ] + +[tool.scikit-build] +build-dir = "build/{wheel_tag}" +cmake.build-type = "Release" +cmake.minimum-version = "3.26.4" +ninja.make-fallback = true +sdist.exclude = ["*tests*"] +sdist.reproducible = true +wheel.packages = ["cuspatial"] + +[tool.scikit-build.metadata.version] +provider = "scikit_build_core.metadata.regex" +input = "cuspatial/VERSION" +regex = "(?P.*)" diff --git a/python/cuspatial/setup.py b/python/cuspatial/setup.py deleted file mode 100644 index 1c4d94f37..000000000 --- a/python/cuspatial/setup.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. -from setuptools import find_packages -from skbuild import setup - -packages = find_packages(include=["cuspatial*"]) - -setup( - packages=packages, - package_data={ - key: ["VERSION", "*.pxd", "*.hpp", "*.cuh"] for key in packages - }, - zip_safe=False, -)