From c22fb0425e969f8ea50fe597f7a9bf32d7667f5c Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Thu, 19 Sep 2024 12:07:42 -0400 Subject: [PATCH 01/13] DOC v24.12 Updates [skip ci] --- .../cuda11.8-conda/devcontainer.json | 6 +- .devcontainer/cuda11.8-pip/devcontainer.json | 6 +- .../cuda12.5-conda/devcontainer.json | 6 +- .devcontainer/cuda12.5-pip/devcontainer.json | 6 +- .github/workflows/build.yaml | 20 +++---- .github/workflows/pr.yaml | 30 +++++----- .github/workflows/test.yaml | 10 ++-- README.md | 6 +- VERSION | 2 +- ci/build_docs.sh | 2 +- .../all_cuda-118_arch-x86_64.yaml | 12 ++-- .../all_cuda-125_arch-x86_64.yaml | 12 ++-- dependencies.yaml | 56 +++++++++---------- .../user_guide/cuproj_api_examples.ipynb | 2 +- .../user_guide/cuspatial_api_examples.ipynb | 4 +- python/cuproj/pyproject.toml | 4 +- python/cuspatial/pyproject.toml | 18 +++--- python/libcuspatial/pyproject.toml | 6 +- 18 files changed, 104 insertions(+), 104 deletions(-) diff --git a/.devcontainer/cuda11.8-conda/devcontainer.json b/.devcontainer/cuda11.8-conda/devcontainer.json index 646640085..221f606cb 100644 --- a/.devcontainer/cuda11.8-conda/devcontainer.json +++ b/.devcontainer/cuda11.8-conda/devcontainer.json @@ -5,17 +5,17 @@ "args": { "CUDA": "11.8", "PYTHON_PACKAGE_MANAGER": "conda", - "BASE": "rapidsai/devcontainers:24.10-cpp-cuda11.8-mambaforge-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.12-cpp-cuda11.8-mambaforge-ubuntu22.04" } }, "runArgs": [ "--rm", "--name", - "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda11.8-conda" + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda11.8-conda" ], "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {} }, "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 b29f6a10e..38d7d2b10 100644 --- a/.devcontainer/cuda11.8-pip/devcontainer.json +++ b/.devcontainer/cuda11.8-pip/devcontainer.json @@ -5,17 +5,17 @@ "args": { "CUDA": "11.8", "PYTHON_PACKAGE_MANAGER": "pip", - "BASE": "rapidsai/devcontainers:24.10-cpp-cuda11.8-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.12-cpp-cuda11.8-ubuntu22.04" } }, "runArgs": [ "--rm", "--name", - "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda11.8-pip" + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda11.8-pip" ], "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.devcontainer/cuda12.5-conda/devcontainer.json b/.devcontainer/cuda12.5-conda/devcontainer.json index 7b5a6efaa..55aa94fb0 100644 --- a/.devcontainer/cuda12.5-conda/devcontainer.json +++ b/.devcontainer/cuda12.5-conda/devcontainer.json @@ -5,17 +5,17 @@ "args": { "CUDA": "12.5", "PYTHON_PACKAGE_MANAGER": "conda", - "BASE": "rapidsai/devcontainers:24.10-cpp-mambaforge-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.12-cpp-mambaforge-ubuntu22.04" } }, "runArgs": [ "--rm", "--name", - "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda12.5-conda" + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda12.5-conda" ], "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.devcontainer/cuda12.5-pip/devcontainer.json b/.devcontainer/cuda12.5-pip/devcontainer.json index 1d3a82749..be5f98bd2 100644 --- a/.devcontainer/cuda12.5-pip/devcontainer.json +++ b/.devcontainer/cuda12.5-pip/devcontainer.json @@ -5,17 +5,17 @@ "args": { "CUDA": "12.5", "PYTHON_PACKAGE_MANAGER": "pip", - "BASE": "rapidsai/devcontainers:24.10-cpp-cuda12.5-ubuntu22.04" + "BASE": "rapidsai/devcontainers:24.12-cpp-cuda12.5-ubuntu22.04" } }, "runArgs": [ "--rm", "--name", - "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.10-cuda12.5-pip" + "${localEnv:USER:anon}-rapids-${localWorkspaceFolderBasename}-24.12-cuda12.5-pip" ], "hostRequirements": {"gpu": "optional"}, "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.10": {} + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:24.12": {} }, "overrideFeatureInstallOrder": [ "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d86122f5a..53277786e 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build-libcuspatial: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: # build for every combination of arch and CUDA version, but only for the latest Python matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) @@ -80,7 +80,7 @@ jobs: wheel-publish-libcuspatial: needs: wheel-build-libcuspatial secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -91,7 +91,7 @@ jobs: wheel-build-cuspatial: needs: wheel-publish-libcuspatial secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -101,7 +101,7 @@ jobs: wheel-publish-cuspatial: needs: wheel-build-cuspatial secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -111,7 +111,7 @@ jobs: package-type: python wheel-build-cuproj: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -121,7 +121,7 @@ jobs: wheel-publish-cuproj: needs: wheel-build-cuproj secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.12 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 94617d953..5f1278333 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -27,47 +27,47 @@ jobs: - wheel-tests-cuproj - devcontainer secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 with: enable_check_generated_files: false conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 with: build_type: pull-request conda-cpp-checks: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12 with: build_type: pull-request enable_check_symbols: true conda-cpp-tests: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 with: build_type: pull-request conda-notebook-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -77,7 +77,7 @@ jobs: docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -87,7 +87,7 @@ jobs: wheel-build-libcuspatial: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: # build for every combination of arch and CUDA version, but only for the latest Python matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber))) @@ -96,34 +96,34 @@ jobs: wheel-build-cuspatial: needs: [checks, wheel-build-libcuspatial] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 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-24.10 + uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.12 with: arch: '["amd64"]' cuda: '["12.5"]' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 493eca446..45218c240 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: conda-cpp-checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-post-build-checks.yaml@branch-24.12 with: build_type: nightly branch: ${{ inputs.branch }} @@ -25,7 +25,7 @@ jobs: enable_check_symbols: true conda-cpp-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 with: build_type: nightly branch: ${{ inputs.branch }} @@ -33,7 +33,7 @@ jobs: sha: ${{ inputs.sha }} conda-python-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 with: build_type: nightly branch: ${{ inputs.branch }} @@ -41,7 +41,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests-cuspatial: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 with: build_type: nightly branch: ${{ inputs.branch }} @@ -50,7 +50,7 @@ jobs: script: ci/test_wheel_cuspatial.sh wheel-tests-cuproj: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.10 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/README.md b/README.md index 6086a7c9e..4193373dd 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:24.10-cuda11.8-py3.10 + nvcr.io/nvidia/rapidsai/notebooks:24.12-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=24.10 python=3.12 cudatoolkit=11.8 + cuspatial=24.12 python=3.12 cudatoolkit=11.8 ``` We also provide nightly Conda packages built from the HEAD of our latest development branch. @@ -155,7 +155,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:24.10, +@misc{cuspatial:24.12, author = {{NVIDIA Corporation}}, title = {cuSpatial: GPU-Accelerated Geospatial and Spatiotemporal Algorithms}, year = {2023}, diff --git a/VERSION b/VERSION index 7c7ba0443..af28c42b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -24.10.00 +24.12.00 diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 80b7c6ca7..3ce57b2d8 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -23,7 +23,7 @@ rapids-print-env export RAPIDS_VERSION="$(rapids-version)" export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)" -export RAPIDS_VERSION_NUMBER="24.10" +export RAPIDS_VERSION_NUMBER="24.12" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build cuSpatial CPP docs" diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 5ac2a6b9c..cac73912d 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,!=3.30.0 - cuda-version=11.8 - cudatoolkit -- cudf==24.10.*,>=0.0.0a0 -- cuml==24.10.*,>=0.0.0a0 +- cudf==24.12.*,>=0.0.0a0 +- cuml==24.12.*,>=0.0.0a0 - cupy>=12.0.0 - curl - cxx-compiler @@ -22,8 +22,8 @@ dependencies: - geopandas>=1.0.0 - ipython - ipywidgets -- libcudf==24.10.*,>=0.0.0a0 -- librmm==24.10.*,>=0.0.0a0 +- libcudf==24.12.*,>=0.0.0a0 +- librmm==24.12.*,>=0.0.0a0 - myst-parser - nbsphinx - ninja @@ -36,13 +36,13 @@ dependencies: - proj >=9.3.0,<9.3.1.0a0 - pydata-sphinx-theme!=0.14.2 - pydeck -- pylibcudf==24.10.*,>=0.0.0a0 +- pylibcudf==24.12.*,>=0.0.0a0 - pytest - pytest-cov - pytest-xdist - python>=3.10,<3.13 - rapids-build-backend>=0.3.0,<0.4.0.dev0 -- rmm==24.10.*,>=0.0.0a0 +- rmm==24.12.*,>=0.0.0a0 - scikit-build-core>=0.10.0 - scikit-image - shapely diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml index 7c2ca25d4..9a8ec1071 100644 --- a/conda/environments/all_cuda-125_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -14,8 +14,8 @@ dependencies: - cuda-nvcc - cuda-nvrtc-dev - cuda-version=12.5 -- cudf==24.10.*,>=0.0.0a0 -- cuml==24.10.*,>=0.0.0a0 +- cudf==24.12.*,>=0.0.0a0 +- cuml==24.12.*,>=0.0.0a0 - cupy>=12.0.0 - curl - cxx-compiler @@ -25,8 +25,8 @@ dependencies: - geopandas>=1.0.0 - ipython - ipywidgets -- libcudf==24.10.*,>=0.0.0a0 -- librmm==24.10.*,>=0.0.0a0 +- libcudf==24.12.*,>=0.0.0a0 +- librmm==24.12.*,>=0.0.0a0 - myst-parser - nbsphinx - ninja @@ -38,13 +38,13 @@ dependencies: - proj >=9.3.0,<9.3.1.0a0 - pydata-sphinx-theme!=0.14.2 - pydeck -- pylibcudf==24.10.*,>=0.0.0a0 +- pylibcudf==24.12.*,>=0.0.0a0 - pytest - pytest-cov - pytest-xdist - python>=3.10,<3.13 - rapids-build-backend>=0.3.0,<0.4.0.dev0 -- rmm==24.10.*,>=0.0.0a0 +- rmm==24.12.*,>=0.0.0a0 - scikit-build-core>=0.10.0 - scikit-image - shapely diff --git a/dependencies.yaml b/dependencies.yaml index 3ac92dfbf..f9796be2e 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -425,7 +425,7 @@ dependencies: common: - output_types: conda packages: - - &rmm_unsuffixed rmm==24.10.*,>=0.0.0a0 + - &rmm_unsuffixed rmm==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -438,20 +438,20 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - rmm-cu12==24.10.*,>=0.0.0a0 + - rmm-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - rmm-cu11==24.10.*,>=0.0.0a0 + - rmm-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*rmm_unsuffixed]} depends_on_cudf: common: - output_types: conda packages: - - &cudf_unsuffixed cudf==24.10.*,>=0.0.0a0 - - &pylibcudf_unsuffixed pylibcudf==24.10.*,>=0.0.0a0 + - &cudf_unsuffixed cudf==24.12.*,>=0.0.0a0 + - &pylibcudf_unsuffixed pylibcudf==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -464,21 +464,21 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - cudf-cu12==24.10.*,>=0.0.0a0 - - pylibcudf-cu12==24.10.*,>=0.0.0a0 + - cudf-cu12==24.12.*,>=0.0.0a0 + - pylibcudf-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - cudf-cu11==24.10.*,>=0.0.0a0 - - pylibcudf-cu11==24.10.*,>=0.0.0a0 + - cudf-cu11==24.12.*,>=0.0.0a0 + - pylibcudf-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*cudf_unsuffixed]} depends_on_libcudf: common: - output_types: conda packages: - - &libcudf_unsuffixed libcudf==24.10.*,>=0.0.0a0 + - &libcudf_unsuffixed libcudf==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -491,19 +491,19 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - libcudf-cu12==24.10.*,>=0.0.0a0 + - libcudf-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - libcudf-cu11==24.10.*,>=0.0.0a0 + - libcudf-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*libcudf_unsuffixed]} depends_on_cuml: common: - output_types: conda packages: - - &cuml_unsuffixed cuml==24.10.*,>=0.0.0a0 + - &cuml_unsuffixed cuml==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -516,19 +516,19 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - cuml-cu12==24.10.*,>=0.0.0a0 + - cuml-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - cuml-cu11==24.10.*,>=0.0.0a0 + - cuml-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*cuml_unsuffixed]} depends_on_cuspatial: common: - output_types: conda packages: - - &cuspatial_unsuffixed cuspatial==24.10.*,>=0.0.0a0 + - &cuspatial_unsuffixed cuspatial==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -541,19 +541,19 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - cuspatial-cu12==24.10.*,>=0.0.0a0 + - cuspatial-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - cuspatial-cu11==24.10.*,>=0.0.0a0 + - cuspatial-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*cuspatial_unsuffixed]} depends_on_cuproj: common: - output_types: conda packages: - - &cuproj_unsuffixed cuproj==24.10.*,>=0.0.0a0 + - &cuproj_unsuffixed cuproj==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -566,12 +566,12 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - cuproj-cu12==24.10.*,>=0.0.0a0 + - cuproj-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - cuproj-cu11==24.10.*,>=0.0.0a0 + - cuproj-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*cuproj_unsuffixed]} depends_on_cupy: @@ -595,12 +595,12 @@ dependencies: common: - output_types: conda packages: - - libcuspatial-tests==24.10.*,>=0.0.0a0 + - libcuspatial-tests==24.12.*,>=0.0.0a0 depends_on_libcuspatial: common: - output_types: conda packages: - - &libcuspatial_unsuffixed libcuspatial==24.10.*,>=0.0.0a0 + - &libcuspatial_unsuffixed libcuspatial==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -613,19 +613,19 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - libcuspatial-cu12==24.10.*,>=0.0.0a0 + - libcuspatial-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - libcuspatial-cu11==24.10.*,>=0.0.0a0 + - libcuspatial-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*libcuspatial_unsuffixed]} depends_on_librmm: common: - output_types: conda packages: - - &librmm_unsuffixed librmm==24.10.*,>=0.0.0a0 + - &librmm_unsuffixed librmm==24.12.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -638,10 +638,10 @@ dependencies: cuda: "12.*" cuda_suffixed: "true" packages: - - librmm-cu12==24.10.*,>=0.0.0a0 + - librmm-cu12==24.12.*,>=0.0.0a0 - matrix: cuda: "11.*" cuda_suffixed: "true" packages: - - librmm-cu11==24.10.*,>=0.0.0a0 + - librmm-cu11==24.12.*,>=0.0.0a0 - {matrix: null, packages: [*librmm_unsuffixed]} diff --git a/docs/cuproj/source/user_guide/cuproj_api_examples.ipynb b/docs/cuproj/source/user_guide/cuproj_api_examples.ipynb index 2c78ac8bb..a78452640 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-24.10 --solver=libmamba -c rapidsai -c conda-forge -c nvidia \\ \n", + "# !conda create -n rapids-24.12 --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/user_guide/cuspatial_api_examples.ipynb b/docs/source/user_guide/cuspatial_api_examples.ipynb index 0a34ea08a..72f7febab 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-24.10 -c rapidsai -c conda-forge -c nvidia \\ \n", - "# cuspatial=24.10 python=3.9 cudatoolkit=11.5 " + "# !conda create -n rapids-24.12 -c rapidsai -c conda-forge -c nvidia \\ \n", + "# cuspatial=24.12 python=3.9 cudatoolkit=11.5 " ] }, { diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index fc4b99d54..d6deefdda 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -43,7 +43,7 @@ classifiers = [ [project.optional-dependencies] test = [ - "cuspatial==24.10.*,>=0.0.0a0", + "cuspatial==24.12.*,>=0.0.0a0", "geopandas>=1.0.0", "numpy>=1.23,<2.0a0", "pyproj>=3.6.0,<3.7a0", @@ -122,7 +122,7 @@ matrix-entry = "cuda_suffixed=true" requires = [ "cmake>=3.26.4,!=3.30.0", "cython>=3.0.0", - "librmm==24.10.*,>=0.0.0a0", + "librmm==24.12.*,>=0.0.0a0", "ninja", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. diff --git a/python/cuspatial/pyproject.toml b/python/cuspatial/pyproject.toml index 3a850030e..9b8b87c8f 100644 --- a/python/cuspatial/pyproject.toml +++ b/python/cuspatial/pyproject.toml @@ -30,12 +30,12 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.10" dependencies = [ - "cudf==24.10.*,>=0.0.0a0", + "cudf==24.12.*,>=0.0.0a0", "geopandas>=1.0.0", - "libcudf==24.10.*,>=0.0.0a0", - "libcuspatial==24.10.*,>=0.0.0a0", + "libcudf==24.12.*,>=0.0.0a0", + "libcuspatial==24.12.*,>=0.0.0a0", "numpy>=1.23,<2.0a0", - "rmm==24.10.*,>=0.0.0a0", + "rmm==24.12.*,>=0.0.0a0", ] # 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", @@ -136,12 +136,12 @@ dependencies-file = "../../dependencies.yaml" matrix-entry = "cuda_suffixed=true" requires = [ "cmake>=3.26.4,!=3.30.0", - "cudf==24.10.*,>=0.0.0a0", + "cudf==24.12.*,>=0.0.0a0", "cython>=3.0.0", - "libcudf==24.10.*,>=0.0.0a0", - "libcuspatial==24.10.*,>=0.0.0a0", - "librmm==24.10.*,>=0.0.0a0", + "libcudf==24.12.*,>=0.0.0a0", + "libcuspatial==24.12.*,>=0.0.0a0", + "librmm==24.12.*,>=0.0.0a0", "ninja", - "rmm==24.10.*,>=0.0.0a0", + "rmm==24.12.*,>=0.0.0a0", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. diff --git a/python/libcuspatial/pyproject.toml b/python/libcuspatial/pyproject.toml index ab64d4cb6..1de8df8c1 100644 --- a/python/libcuspatial/pyproject.toml +++ b/python/libcuspatial/pyproject.toml @@ -39,7 +39,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "libcudf==24.10.*,>=0.0.0a0", + "libcudf==24.12.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project.urls] @@ -70,8 +70,8 @@ dependencies-file = "../../dependencies.yaml" matrix-entry = "cuda_suffixed=true" requires = [ "cmake>=3.26.4,!=3.30.0", - "libcudf==24.10.*,>=0.0.0a0", - "librmm==24.10.*,>=0.0.0a0", + "libcudf==24.12.*,>=0.0.0a0", + "librmm==24.12.*,>=0.0.0a0", "ninja", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. From c45ff5f9fa2855c7123d4cd094c48c2aee527ed0 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 11 Oct 2024 15:06:47 -0500 Subject: [PATCH 02/13] remove unused variables in build_docs script (#1469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributes to https://github.com/rapidsai/build-planning/issues/106 This project doesn't need any of the changes that are being made as part of that issue across most other repos... it's already doing all of its `pip` and `conda` installs in CI in single installs (which is strict and safe) 🎉 This small PR just makes its handling of environment variables in `ci/build_docs.sh` consistent with other RAPIDS repos, in the interest of keeping those scripts looking similar so it's easy to apply changes across all RAPIDS projects. ref: https://github.com/rapidsai/cudf/pull/17013#discussion_r1792163289 Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Mark Harris (https://github.com/harrism) - Mike Sarahan (https://github.com/msarahan) URL: https://github.com/rapidsai/cuspatial/pull/1469 --- ci/build_docs.sh | 3 +-- ci/release/update-version.sh | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 3ce57b2d8..ab2b56c35 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -23,7 +23,6 @@ rapids-print-env export RAPIDS_VERSION="$(rapids-version)" export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)" -export RAPIDS_VERSION_NUMBER="24.12" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build cuSpatial CPP docs" @@ -54,4 +53,4 @@ mkdir -p "${RAPIDS_DOCS_DIR}/cuproj/html" mv _html/* "${RAPIDS_DOCS_DIR}/cuproj/html" popd -rapids-upload-docs +RAPIDS_VERSION_NUMBER="${RAPIDS_VERSION_MAJOR_MINOR}" rapids-upload-docs diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 03c05e9c4..dfd0fe7e3 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -40,7 +40,6 @@ echo "${NEXT_FULL_TAG}" > VERSION for FILE in .github/workflows/*.yaml; do sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}" done -sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_SHORT_TAG}\"/g" ci/build_docs.sh DEPENDENCIES=( pylibcudf From 8314c1365ddde9d630a8d4e22d82fcba4ea926d8 Mon Sep 17 00:00:00 2001 From: Basit Ayantunde Date: Wed, 16 Oct 2024 15:14:39 +0100 Subject: [PATCH 03/13] Updated libcudftestutil CMake linking logic for 24.12 (#1475) This merge request fixes the CMake linking logic to cudftestutil for branch-24.12, allowing you to specify which version of GTest/GBench to use as long as the API is source compatible. Follows up on: https://github.com/rapidsai/cudf/pull/16839 Authors: - Basit Ayantunde (https://github.com/lamarrr) Approvers: - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1475 --- cpp/CMakeLists.txt | 2 +- cpp/benchmarks/CMakeLists.txt | 6 +++++- cpp/cmake/thirdparty/get_cudf.cmake | 4 ++-- cpp/tests/CMakeLists.txt | 28 +++++++++++++++++++++++++++- cpp/tests/test_common.cpp | 15 +++++++++++++++ 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 cpp/tests/test_common.cpp diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 8908617b1..aac5aea43 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -68,7 +68,7 @@ set(CUSPATIAL_BUILD_TESTS ${BUILD_TESTS}) set(CUSPATIAL_BUILD_BENCHMARKS ${BUILD_BENCHMARKS}) set(CUSPATIAL_CXX_FLAGS "") -set(CUSPATIAL_CUDA_FLAGS "") +set(CUSPATIAL_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) set(CUSPATIAL_CXX_DEFINITIONS "") set(CUSPATIAL_CUDA_DEFINITIONS "") diff --git a/cpp/benchmarks/CMakeLists.txt b/cpp/benchmarks/CMakeLists.txt index 10e626f3f..98506d9a4 100644 --- a/cpp/benchmarks/CMakeLists.txt +++ b/cpp/benchmarks/CMakeLists.txt @@ -23,6 +23,9 @@ add_library(cuspatial_benchmark_common OBJECT target_compile_features(cuspatial_benchmark_common PUBLIC cxx_std_17 cuda_std_17) +target_compile_options(cuspatial_benchmark_common PUBLIC "$<$:${CUSPATIAL_CXX_FLAGS}>" + "$<$:${CUSPATIAL_CUDA_FLAGS}>") + set_target_properties(cuspatial_benchmark_common PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$" INSTALL_RPATH "\$ORIGIN/../../../lib" @@ -38,7 +41,8 @@ target_link_libraries(cuspatial_benchmark_common PUBLIC benchmark::benchmark cudf::cudftestutil ranger::ranger - cuspatial) + cuspatial GTest::gtest GTest::gmock + PRIVATE cudf::cudftestutil_impl) target_compile_options(cuspatial_benchmark_common PUBLIC "$<$:${CUSPATIAL_CXX_FLAGS}>" diff --git a/cpp/cmake/thirdparty/get_cudf.cmake b/cpp/cmake/thirdparty/get_cudf.cmake index 3d7232fba..c5d2712c9 100644 --- a/cpp/cmake/thirdparty/get_cudf.cmake +++ b/cpp/cmake/thirdparty/get_cudf.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-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. @@ -27,7 +27,7 @@ function(find_and_configure_cudf) set(cudf_components "") if(BUILD_TESTS OR BUILD_BENCHMARKS) - list(APPEND global_targets cudf::cudftestutil) + list(APPEND global_targets cudf::cudftestutil cudf::cudftestutil_impl) set(cudf_components COMPONENTS testing) endif() diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index f6752c860..7bca36a41 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -17,6 +17,32 @@ ################################################################################################### # - compiler function ----------------------------------------------------------------------------- +# cudftestutil_impl is an interface source library, this empty object +# library is used to speed-up compilation and linking against it, +# otherwise we pay the non-trivial compilation cost repeatedly for each +# test executable +add_library(cuspatial_test_common OBJECT test_common.cpp) + +target_compile_features(cuspatial_test_common PUBLIC cxx_std_17 cuda_std_17) + +set_target_properties(cuspatial_test_common + PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$" + INSTALL_RPATH "\$ORIGIN/../../../lib" + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CUDA_STANDARD 17 + CUDA_STANDARD_REQUIRED ON + POSITION_INDEPENDENT_CODE ON + INTERFACE_POSITION_INDEPENDENT_CODE ON +) + +target_link_libraries(cuspatial_test_common + PUBLIC cudf::cudftestutil GTest::gtest GTest::gmock + PRIVATE cudf::cudftestutil_impl) + +target_compile_options(cuspatial_test_common PUBLIC "$<$:${CUSPATIAL_CXX_FLAGS}>" +"$<$:${CUSPATIAL_CUDA_FLAGS}>") + function(ConfigureTest CMAKE_TEST_NAME) add_executable(${CMAKE_TEST_NAME} ${ARGN}) target_compile_options(${CMAKE_TEST_NAME} @@ -34,7 +60,7 @@ function(ConfigureTest CMAKE_TEST_NAME) CUDA_STANDARD 17 CUDA_STANDARD_REQUIRED ON ) - target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial) + target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial cuspatial_test_common) add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME}) install( TARGETS ${CMAKE_TEST_NAME} diff --git a/cpp/tests/test_common.cpp b/cpp/tests/test_common.cpp new file mode 100644 index 000000000..244bc0c4b --- /dev/null +++ b/cpp/tests/test_common.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (c) 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. + * 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 1bf2527cc3968c178c420ad4d97d674e40c296a1 Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:22:11 +1100 Subject: [PATCH 04/13] Make polygon fixture data valid (#1472) Fixes #1471. Fixes the invalid polygon geometry and improves geometry slicing tests to not depend on hard-coded vertex positions that are also hard-coded in the fixture. Authors: - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) Approvers: - Michael Wang (https://github.com/isVoid) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1472 --- python/cuspatial/cuspatial/testing/helpers.py | 15 ++ python/cuspatial/cuspatial/tests/conftest.py | 93 ++------- .../cuspatial/tests/test_cudf_integration.py | 9 - .../cuspatial/tests/test_from_geopandas.py | 11 +- .../cuspatial/tests/test_geodataframe.py | 16 +- .../cuspatial/tests/test_geoseries.py | 182 +++--------------- 6 files changed, 74 insertions(+), 252 deletions(-) create mode 100644 python/cuspatial/cuspatial/testing/helpers.py diff --git a/python/cuspatial/cuspatial/testing/helpers.py b/python/cuspatial/cuspatial/testing/helpers.py new file mode 100644 index 000000000..a03ab2d57 --- /dev/null +++ b/python/cuspatial/cuspatial/testing/helpers.py @@ -0,0 +1,15 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. +from itertools import chain + +from shapely import get_coordinates + + +def geometry_to_coords(geom, geom_types): + points_list = geom[geom.apply(lambda x: isinstance(x, geom_types))] + # flatten multigeometries, then geometries, then coordinates + points = list(chain(points_list.apply(get_coordinates))) + coords_list = list(chain(*points)) + xy = list(chain(*coords_list)) + x = xy[::2] + y = xy[1::2] + return xy, x, y diff --git a/python/cuspatial/cuspatial/tests/conftest.py b/python/cuspatial/cuspatial/tests/conftest.py index b71b08128..a8ecb11ec 100644 --- a/python/cuspatial/cuspatial/tests/conftest.py +++ b/python/cuspatial/cuspatial/tests/conftest.py @@ -19,48 +19,46 @@ @pytest.fixture def gs(): g0 = Point(-1, 0) - g1 = MultiPoint(((1, 2), (3, 4))) - g2 = MultiPoint(((5, 6), (7, 8))) - g3 = Point(9, 10) + g1 = Point(9, 10) + g2 = MultiPoint(((1, 2), (3, 4))) + g3 = MultiPoint(((5, 6), (7, 8))) g4 = LineString(((11, 12), (13, 14))) g5 = MultiLineString((((15, 16), (17, 18)), ((19, 20), (21, 22)))) g6 = MultiLineString((((23, 24), (25, 26)), ((27, 28), (29, 30)))) g7 = LineString(((31, 32), (33, 34))) g8 = Polygon( - ((35, 36), (37, 38), (39, 40), (41, 42)), + ((35, 36), (38, 36), (41, 39), (41, 42)), ) - # TODO: g9, g10, g11 are invalid - # https://github.com/libgeos/geos/issues/1177 g9 = MultiPolygon( [ ( - ((43, 44), (45, 46), (47, 48)), - [((49, 50), (51, 52), (53, 54))], + ((43, 44), (48, 44), (47, 48)), + [((45, 45), (46, 46), (47, 45))], ), ( - ((55, 56), (57, 58), (59, 60)), - [((61, 62), (63, 64), (65, 66))], + ((55, 56), (60, 56), (59, 60)), + [((57, 57), (58, 58), (59, 57))], ), ] ) g10 = MultiPolygon( [ ( - ((67, 68), (69, 70), (71, 72)), - [((73, 74), (75, 76), (77, 78))], + ((67, 68), (72, 68), (71, 72)), + [((69, 69), (70, 70), (71, 69))], ), ( - ((79, 80), (81, 82), (83, 84)), + ((79, 80), (90, 82), (83, 90)), [ - ((85, 86), (87, 88), (89, 90)), - ((91, 92), (93, 94), (95, 96)), + ((80, 81), (82, 84), (84, 82)), + ((85, 85), (88, 82), (86, 82)), ], ), ] ) g11 = Polygon( ((97, 98), (99, 101), (102, 103), (101, 108)), - [((106, 107), (108, 109), (110, 111), (113, 108))], + [((99, 102), (100, 103), (101, 103), (100, 102))], ) gs = gpd.GeoSeries([g0, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11]) return gs @@ -72,8 +70,10 @@ def gpdf(gs): random_col = int_col np.random.shuffle(random_col) str_col = [str(x) for x in int_col] - key_col = np.repeat(np.arange(4), len(int_col) // 4) + key_col = np.repeat(np.arange(4), (len(int_col) // 4) + 1) + key_col = key_col[: len(int_col)] np.random.shuffle(key_col) + result = gpd.GeoDataFrame( { "geometry": gs, @@ -87,65 +87,6 @@ def gpdf(gs): return result -@pytest.fixture -def polys(): - return np.array( - ( - (35, 36), - (37, 38), - (39, 40), - (41, 42), - (35, 36), - (43, 44), - (45, 46), - (47, 48), - (43, 44), - (49, 50), - (51, 52), - (53, 54), - (49, 50), - (55, 56), - (57, 58), - (59, 60), - (55, 56), - (61, 62), - (63, 64), - (65, 66), - (61, 62), - (67, 68), - (69, 70), - (71, 72), - (67, 68), - (73, 74), - (75, 76), - (77, 78), - (73, 74), - (79, 80), - (81, 82), - (83, 84), - (79, 80), - (85, 86), - (87, 88), - (89, 90), - (85, 86), - (91, 92), - (93, 94), - (95, 96), - (91, 92), - (97, 98), - (99, 101), - (102, 103), - (101, 108), - (97, 98), - (106, 107), - (108, 109), - (110, 111), - (113, 108), - (106, 107), - ) - ) - - @pytest.fixture def gs_sorted(gs): result = pd.concat( diff --git a/python/cuspatial/cuspatial/tests/test_cudf_integration.py b/python/cuspatial/cuspatial/tests/test_cudf_integration.py index 41214e816..0e67733c0 100644 --- a/python/cuspatial/cuspatial/tests/test_cudf_integration.py +++ b/python/cuspatial/cuspatial/tests/test_cudf_integration.py @@ -2,17 +2,10 @@ import geopandas as gpd import numpy as np import pandas as pd -import pytest import cuspatial -reason = ( - "gs fixture contains invalid Polygons/MultiPolygons: " - "https://github.com/libgeos/geos/issues/1177" -) - -@pytest.mark.xfail(reason=reason) def test_sort_index_series(gs): gs.index = np.random.permutation(len(gs)) cugs = cuspatial.from_geopandas(gs) @@ -21,7 +14,6 @@ def test_sort_index_series(gs): gpd.testing.assert_geoseries_equal(got, expected) -@pytest.mark.xfail(reason=reason) def test_sort_index_dataframe(gpdf): gpdf.index = np.random.permutation(len(gpdf)) cugpdf = cuspatial.from_geopandas(gpdf) @@ -30,7 +22,6 @@ def test_sort_index_dataframe(gpdf): gpd.testing.assert_geodataframe_equal(got, expected) -@pytest.mark.xfail(reason=reason) def test_sort_values(gpdf): cugpdf = cuspatial.from_geopandas(gpdf) expected = gpdf.sort_values("random") diff --git a/python/cuspatial/cuspatial/tests/test_from_geopandas.py b/python/cuspatial/cuspatial/tests/test_from_geopandas.py index 1c33e216a..a02ab4a35 100644 --- a/python/cuspatial/cuspatial/tests/test_from_geopandas.py +++ b/python/cuspatial/cuspatial/tests/test_from_geopandas.py @@ -36,15 +36,8 @@ def test_dataframe_column_access(gs): def test_from_geoseries_complex(gs): cugs = cuspatial.from_geopandas(gs) - assert cugs.points.xy.sum() == 18 - assert cugs.lines.xy.sum() == 540 - assert cugs.multipoints.xy.sum() == 36 - assert cugs.polygons.xy.sum() == 7436 - assert cugs._column.polygons._column.base_children[0].sum() == 15 - assert ( - cugs._column.polygons._column.base_children[1].base_children[0].sum() - == 38 - ) + gs_roundtrip = cugs.to_geopandas() + gpd.testing.assert_geoseries_equal(gs_roundtrip, gs) def test_from_geopandas_point(): diff --git a/python/cuspatial/cuspatial/tests/test_geodataframe.py b/python/cuspatial/cuspatial/tests/test_geodataframe.py index f834b35e5..af8b7334e 100644 --- a/python/cuspatial/cuspatial/tests/test_geodataframe.py +++ b/python/cuspatial/cuspatial/tests/test_geodataframe.py @@ -19,6 +19,7 @@ import cudf import cuspatial +from cuspatial.testing.helpers import geometry_to_coords np.random.seed(0) @@ -114,7 +115,7 @@ def test_type_persistence(gpdf): assert type(cugpdf["geometry"]) is cuspatial.GeoSeries -def test_interleaved_point(gpdf, polys): +def test_interleaved_point(gpdf): cugpdf = cuspatial.from_geopandas(gpdf) cugs = cugpdf["geometry"] gs = gpdf["geometry"] @@ -128,7 +129,7 @@ def test_interleaved_point(gpdf, polys): ) -def test_interleaved_multipoint(gpdf, polys): +def test_interleaved_multipoint(gpdf): cugpdf = cuspatial.from_geopandas(gpdf) cugs = cugpdf["geometry"] gs = gpdf["geometry"] @@ -156,7 +157,7 @@ def test_interleaved_multipoint(gpdf, polys): ) -def test_interleaved_lines(gpdf, polys): +def test_interleaved_lines(gpdf): cugpdf = cuspatial.from_geopandas(gpdf) cugs = cugpdf["geometry"] cudf.testing.assert_series_equal( @@ -175,16 +176,19 @@ def test_interleaved_lines(gpdf, polys): ) -def test_interleaved_polygons(gpdf, polys): +def test_interleaved_polygons(gpdf): cugpdf = cuspatial.from_geopandas(gpdf) cugs = cugpdf["geometry"] + gs = gpdf["geometry"] + xy, x, y = geometry_to_coords(gs, (Polygon, MultiPolygon)) + cudf.testing.assert_series_equal( cudf.Series.from_arrow(cugs.polygons.x.to_arrow()), - cudf.Series(polys[:, 0], dtype="float64"), + cudf.Series(x, dtype="float64"), ) cudf.testing.assert_series_equal( cudf.Series.from_arrow(cugs.polygons.y.to_arrow()), - cudf.Series(polys[:, 1], dtype="float64"), + cudf.Series(y, dtype="float64"), ) diff --git a/python/cuspatial/cuspatial/tests/test_geoseries.py b/python/cuspatial/cuspatial/tests/test_geoseries.py index 56f61158e..5304d7ea6 100644 --- a/python/cuspatial/cuspatial/tests/test_geoseries.py +++ b/python/cuspatial/cuspatial/tests/test_geoseries.py @@ -23,6 +23,7 @@ from cudf.testing import assert_series_equal import cuspatial +from cuspatial.testing.helpers import geometry_to_coords np.random.seed(0) @@ -133,7 +134,7 @@ def assert_eq_geo(geo1, geo2): assert result.all() -def test_interleaved_point(gs, polys): +def test_interleaved_point(gs): cugs = cuspatial.from_geopandas(gs) pd.testing.assert_series_equal( cugs.points.x.to_pandas(), @@ -181,13 +182,16 @@ def test_interleaved_point(gs, polys): dtype="float64", ).reset_index(drop=True), ) + + xy, x, y = geometry_to_coords(gs, (MultiPolygon, Polygon)) + cudf.testing.assert_series_equal( cugs.polygons.x.reset_index(drop=True), - cudf.Series(polys[:, 0], dtype="float64").reset_index(drop=True), + cudf.Series(x, dtype="float64").reset_index(drop=True), ) cudf.testing.assert_series_equal( cugs.polygons.y.reset_index(drop=True), - cudf.Series(polys[:, 1], dtype="float64").reset_index(drop=True), + cudf.Series(y, dtype="float64").reset_index(drop=True), ) @@ -350,155 +354,29 @@ def test_size(gs, series_slice): assert len(gi) == len(cugs) -def test_geometry_point_slicing(gs): - cugs = cuspatial.from_geopandas(gs) - assert (cugs[:1].points.x == cudf.Series([-1])).all() - assert (cugs[:1].points.y == cudf.Series([0])).all() - assert (cugs[:1].points.xy == cudf.Series([-1, 0])).all() - assert (cugs[3:].points.x == cudf.Series([9])).all() - assert (cugs[3:].points.y == cudf.Series([10])).all() - assert (cugs[3:].points.xy == cudf.Series([9, 10])).all() - assert (cugs[0:4].points.x == cudf.Series([-1, 9])).all() - assert (cugs[0:4].points.y == cudf.Series([0, 10])).all() - assert (cugs[0:4].points.xy == cudf.Series([-1, 0, 9, 10])).all() - - -def test_geometry_multipoint_slicing(gs): - cugs = cuspatial.from_geopandas(gs) - assert (cugs[:2].multipoints.x == cudf.Series([1, 3])).all() - assert (cugs[:2].multipoints.y == cudf.Series([2, 4])).all() - assert (cugs[:2].multipoints.xy == cudf.Series([1, 2, 3, 4])).all() - assert (cugs[2:].multipoints.x == cudf.Series([5, 7])).all() - assert (cugs[2:].multipoints.y == cudf.Series([6, 8])).all() - assert (cugs[2:].multipoints.xy == cudf.Series([5, 6, 7, 8])).all() - assert (cugs[0:4].multipoints.x == cudf.Series([1, 3, 5, 7])).all() - assert (cugs[0:4].multipoints.y == cudf.Series([2, 4, 6, 8])).all() - assert ( - cugs[0:4].multipoints.xy == cudf.Series([1, 2, 3, 4, 5, 6, 7, 8]) - ).all() - - -def test_geometry_linestring_slicing(gs): - cugs = cuspatial.from_geopandas(gs) - assert (cugs[:5].lines.x == cudf.Series([11, 13])).all() - assert (cugs[:5].lines.y == cudf.Series([12, 14])).all() - assert (cugs[:5].lines.xy == cudf.Series([11, 12, 13, 14])).all() - assert (cugs[:6].lines.x == cudf.Series([11, 13, 15, 17, 19, 21])).all() - assert (cugs[:6].lines.y == cudf.Series([12, 14, 16, 18, 20, 22])).all() - assert ( - cugs[:6].lines.xy - == cudf.Series([11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]) - ).all() - assert (cugs[7:].lines.x == cudf.Series([31, 33])).all() - assert (cugs[7:].lines.y == cudf.Series([32, 34])).all() - assert (cugs[7:].lines.xy == cudf.Series([31, 32, 33, 34])).all() - assert (cugs[6:].lines.x == cudf.Series([23, 25, 27, 29, 31, 33])).all() - assert (cugs[6:].lines.y == cudf.Series([24, 26, 28, 30, 32, 34])).all() - assert ( - cugs[6:].lines.xy - == cudf.Series([23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]) - ).all() - - -def test_geometry_polygon_slicing(gs): - cugs = cuspatial.from_geopandas(gs) - assert (cugs[:9].polygons.x == cudf.Series([35, 37, 39, 41, 35])).all() - assert (cugs[:9].polygons.y == cudf.Series([36, 38, 40, 42, 36])).all() - assert ( - cugs[:9].polygons.xy - == cudf.Series([35, 36, 37, 38, 39, 40, 41, 42, 35, 36]) - ).all() - assert ( - cugs[:10].polygons.x - == cudf.Series( - [ - 35, - 37, - 39, - 41, - 35, - 43, - 45, - 47, - 43, - 49, - 51, - 53, - 49, - 55, - 57, - 59, - 55, - 61, - 63, - 65, - 61, - ] - ) - ).all() - assert ( - cugs[:10].polygons.y - == cudf.Series( - [ - 36, - 38, - 40, - 42, - 36, - 44, - 46, - 48, - 44, - 50, - 52, - 54, - 50, - 56, - 58, - 60, - 56, - 62, - 64, - 66, - 62, - ] - ) - ).all() - assert ( - cugs[11:].polygons.x - == cudf.Series([97, 99, 102, 101, 97, 106, 108, 110, 113, 106]) - ).all() - assert ( - cugs[11:].polygons.y - == cudf.Series([98, 101, 103, 108, 98, 107, 109, 111, 108, 107]) - ).all() - assert ( - cugs[11:].polygons.xy - == cudf.Series( - [ - 97, - 98, - 99, - 101, - 102, - 103, - 101, - 108, - 97, - 98, - 106, - 107, - 108, - 109, - 110, - 111, - 113, - 108, - 106, - 107, - ] - ) - ).all() +@pytest.mark.parametrize( + "geom_access", + [ + # Tuples: accessor, types, slice + # slices here are meant to be supersets of the range in the gs fixture + # that contains the types of geometries being accessed + # Note that cuspatial.GeoSeries provides accessors for "multipoints", + # but not for "multilinestrings" or "multipolygons" + # (inconsistent interface) + ("points", Point, slice(0, 6)), + ("multipoints", MultiPoint, slice(2, 8)), + ("lines", (LineString, MultiLineString), slice(2, 10)), + ("polygons", (Polygon, MultiPolygon), slice(6, 12)), + ], +) +def test_geometry_access_slicing(gs, geom_access): + accessor, types, slice = geom_access + xy, x, y = geometry_to_coords(gs, types) + + cugs = cuspatial.from_geopandas(gs)[slice] + assert (getattr(cugs, accessor).x == cudf.Series(x)).all() + assert (getattr(cugs, accessor).y == cudf.Series(y)).all() + assert (getattr(cugs, accessor).xy == cudf.Series(xy)).all() def test_loc(gs): From d8dd061cf1134f1da250a353ba89a8b995a14c1d Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 16 Oct 2024 22:49:27 -0500 Subject: [PATCH 05/13] Update README architecture and platform support (#1476) A few minor documentation updates to align with the rest of RAPIDS. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cuspatial/pull/1476 --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4193373dd..3fbb9b86c 100644 --- a/README.md +++ b/README.md @@ -102,8 +102,7 @@ gitGraph ## Using cuSpatial **CUDA/GPU requirements** - CUDA 11.2+ with a [compatible, supported driver](https://docs.nvidia.com/datacenter/tesla/drivers/#cuda-drivers) -- Linux native: Pascal architecture or newer ([Compute Capability >=6.0](https://developer.nvidia.com/cuda-gpus)) -- WSL2: Volta architecture or newer ([Compute Capability >=7.0](https://developer.nvidia.com/cuda-gpus)) +- Volta architecture or newer ([Compute Capability >=7.0](https://developer.nvidia.com/cuda-gpus)) ### Quick start: Docker Use the [RAPIDS Release Selector](https://docs.rapids.ai/install#selector), selecting `Docker` as the installation method. All RAPIDS Docker images contain cuSpatial. @@ -113,7 +112,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:24.12-cuda11.8-py3.10 + nvcr.io/nvidia/rapidsai/notebooks:24.12-cuda11.8-py3.12 ``` ### Install with Conda @@ -121,7 +120,7 @@ docker run --gpus all --pull always --rm -it \ To install via conda: > **Note** cuSpatial is supported only on Linux or [through WSL](https://rapids.ai/wsl2.html), and with Python versions 3.10, 3.11, and 3.12. -cuSpatial can be installed with conda (miniconda, or the full Anaconda distribution) from the rapidsai channel: +cuSpatial can be installed with conda from the rapidsai channel: ```shell conda install -c rapidsai -c conda-forge -c nvidia \ From 86ef6753d719a6717513ea4d2e8f88766ce7c59a Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 22 Oct 2024 16:57:20 -0500 Subject: [PATCH 06/13] build wheels without build isolation (#1473) Contributes to https://github.com/rapidsai/build-planning/issues/108 Contributes to https://github.com/rapidsai/build-planning/issues/111 Proposes building `libcuspatial` wheels with `--no-build-isolation`, to improve the rate of `sccache` cache hits and therefore reduce CI times. Also proposes printing `sccache` stats to CI logs after wheel and conda builds. ## Notes for Reviewers # Authors: - James Lamb (https://github.com/jameslamb) - Bradley Dice (https://github.com/bdice) Approvers: - Mike Sarahan (https://github.com/msarahan) - Kyle Edwards (https://github.com/KyleFromNVIDIA) - Vyas Ramasubramani (https://github.com/vyasr) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1473 --- .pre-commit-config.yaml | 2 +- ci/build_cpp.sh | 4 ++++ ci/build_python.sh | 8 ++++++++ ci/build_wheel.sh | 10 +++++++++- ci/build_wheel_libcuspatial.sh | 24 +++++++++++++++++++++++- 5 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3949b4c3d..bd10e977a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,7 +48,7 @@ repos: - id: verify-copyright - id: verify-alpha-spec - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 + rev: v1.16.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index c23dac174..effab796d 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -15,7 +15,11 @@ rapids-print-env rapids-logger "Begin cpp build" +sccache --zero-stats + RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild \ conda/recipes/libcuspatial +sccache --show-adv-stats + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index fc1066fc7..e0ff96639 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -21,6 +21,8 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) rapids-logger "Begin py build cuSpatial" +sccache --zero-stats + # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ @@ -28,8 +30,12 @@ RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuspatial +sccache --show-adv-stats + rapids-logger "Begin py build cuProj" +sccache --zero-stats + # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ @@ -37,4 +43,6 @@ RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuproj +sccache --show-adv-stats + rapids-upload-conda-to-s3 python diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 75328d272..363d10d42 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -35,7 +35,15 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" cd "${package_dir}" -python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check +rapids-logger "Building '${package_name}' wheel" +python -m pip wheel \ + -w dist \ + -v \ + --no-deps \ + --disable-pip-version-check \ + . + +sccache --show-adv-stats mkdir -p final_dist python -m auditwheel repair \ diff --git a/ci/build_wheel_libcuspatial.sh b/ci/build_wheel_libcuspatial.sh index 742a58caa..ed3822207 100755 --- a/ci/build_wheel_libcuspatial.sh +++ b/ci/build_wheel_libcuspatial.sh @@ -3,4 +3,26 @@ set -euo pipefail -ci/build_wheel.sh libcuspatial python/libcuspatial cpp +package_name="libcuspatial" + +rapids-logger "Generating build requirements" +matrix_selectors="cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_build_${package_name}" \ + --file-key "py_rapids_build_${package_name}" \ + --matrix "${matrix_selectors}" \ +| tee /tmp/requirements-build.txt + +rapids-logger "Installing build requirements" +python -m pip install \ + -v \ + --prefer-binary \ + -r /tmp/requirements-build.txt + +# build with '--no-build-isolation', for better sccache hit rate +# 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) +export PIP_NO_BUILD_ISOLATION=0 + +ci/build_wheel.sh "${package_name}" python/libcuspatial cpp From 0a2685d8d9e64341a2f72ad1ee3a9e6d428a4ba7 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Wed, 23 Oct 2024 10:16:48 -0400 Subject: [PATCH 07/13] Prune workflows based on changed files (#1479) Contributes to https://github.com/rapidsai/build-planning/issues/94 Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - James Lamb (https://github.com/jameslamb) URL: https://github.com/rapidsai/cuspatial/pull/1479 --- .github/workflows/pr.yaml | 49 +++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5f1278333..3f6a68b8a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,6 +12,7 @@ concurrency: jobs: pr-builder: needs: + - changed-files - checks - conda-cpp-build - conda-cpp-checks @@ -28,6 +29,39 @@ jobs: - devcontainer secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 + if: always() + with: + needs: ${{ toJSON(needs) }} + changed-files: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 + with: + files_yaml: | + test_cpp: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!java/**' + - '!notebooks/**' + - '!python/**' + test_notebooks: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + test_python: + - '**' + - '!.devcontainer/**' + - '!.pre-commit-config.yaml' + - '!CONTRIBUTING.md' + - '!README.md' + - '!docs/**' + - '!java/**' + - '!notebooks/**' checks: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 @@ -47,9 +81,10 @@ jobs: build_type: pull-request enable_check_symbols: true conda-cpp-tests: - needs: conda-cpp-build + needs: [conda-cpp-build, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp with: build_type: pull-request conda-python-build: @@ -59,15 +94,17 @@ jobs: with: build_type: pull-request conda-python-tests: - needs: conda-python-build + needs: [conda-python-build, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp with: build_type: pull-request conda-notebook-tests: - needs: conda-python-build + needs: [conda-python-build, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_notebooks with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -101,9 +138,10 @@ jobs: build_type: pull-request script: ci/build_wheel_cuspatial.sh wheel-tests-cuspatial: - needs: wheel-build-cuspatial + needs: [wheel-build-cuspatial, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python with: build_type: pull-request script: ci/test_wheel_cuspatial.sh @@ -115,9 +153,10 @@ jobs: build_type: pull-request script: ci/build_wheel_cuproj.sh wheel-tests-cuproj: - needs: [wheel-build-cuspatial, wheel-build-cuproj] + needs: [wheel-build-cuspatial, wheel-build-cuproj, changed-files] secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python with: build_type: pull-request script: ci/test_wheel_cuproj.sh From 724d170a2105441a3533b5eaf9ee82ddcfc49be0 Mon Sep 17 00:00:00 2001 From: Jordan Jacobelli Date: Mon, 28 Oct 2024 14:01:50 +0100 Subject: [PATCH 08/13] devcontainer: replace `VAULT_HOST` with `AWS_ROLE_ARN` (#1478) This PR is replacing the `VAULT_HOST` variable with `AWS_ROLE_ARN`. This is required to use the new token service to get AWS credentials. Authors: - Jordan Jacobelli (https://github.com/jjacobelli) Approvers: - Paul Taylor (https://github.com/trxcllnt) - Bradley Dice (https://github.com/bdice) - Jake Awe (https://github.com/AyodeAwe) URL: https://github.com/rapidsai/cuspatial/pull/1478 --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 974aea1ee..95763953e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,5 +31,5 @@ ENV PYTHONDONTWRITEBYTECODE="1" ENV SCCACHE_REGION="us-east-2" ENV SCCACHE_BUCKET="rapids-sccache-devs" -ENV VAULT_HOST="https://vault.ops.k8s.rapids.ai" +ENV AWS_ROLE_ARN="arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs" ENV HISTFILE="/home/coder/.cache/._bash_history" From 98fda4cb5251492569630f1e3ec61b3c1a1aff15 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 13 Nov 2024 21:32:11 -0600 Subject: [PATCH 09/13] enforce wheel size limits, README formatting in CI (#1482) Contributes to https://github.com/rapidsai/build-planning/issues/110 Proposes adding 2 types of validation on wheels in CI, to ensure we continue to produce wheels that are suitable for PyPI. * checks on wheel size (compressed), - *to be sure they're under PyPI limits* - *and to prompt discussion on PRs that significantly increase wheel sizes* * checks on README formatting - *to ensure they'll render properly as the PyPI project homepages* - *e.g. like how https://github.com/scikit-learn/scikit-learn/blob/main/README.rst becomes https://pypi.org/project/scikit-learn/* Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1482 --- ci/build_wheel_cuproj.sh | 5 ++++- ci/build_wheel_cuspatial.sh | 5 ++++- ci/build_wheel_libcuspatial.sh | 4 +++- ci/validate_wheel.sh | 21 +++++++++++++++++++++ python/cuproj/pyproject.toml | 8 ++++++++ python/cuspatial/pyproject.toml | 8 ++++++++ python/libcuspatial/pyproject.toml | 8 ++++++++ 7 files changed, 56 insertions(+), 3 deletions(-) create mode 100755 ci/validate_wheel.sh diff --git a/ci/build_wheel_cuproj.sh b/ci/build_wheel_cuproj.sh index 6001e44e9..4b29fbb46 100755 --- a/ci/build_wheel_cuproj.sh +++ b/ci/build_wheel_cuproj.sh @@ -3,4 +3,7 @@ set -euo pipefail -ci/build_wheel.sh cuproj python/cuproj python +package_dir="python/cuproj" + +ci/build_wheel.sh cuproj ${package_dir} python +ci/validate_wheel.sh ${package_dir} final_dist diff --git a/ci/build_wheel_cuspatial.sh b/ci/build_wheel_cuspatial.sh index e581a3e76..780ac0710 100755 --- a/ci/build_wheel_cuspatial.sh +++ b/ci/build_wheel_cuspatial.sh @@ -3,6 +3,8 @@ set -euo pipefail +package_dir="python/cuspatial" + RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" # Downloads libcuspatial wheel from this current build, @@ -14,4 +16,5 @@ RAPIDS_PY_WHEEL_NAME="libcuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-whe echo "libcuspatial-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo /tmp/libcuspatial_dist/libcuspatial_*.whl)" > /tmp/constraints.txt export PIP_CONSTRAINT="/tmp/constraints.txt" -ci/build_wheel.sh cuspatial python/cuspatial python +ci/build_wheel.sh cuspatial ${package_dir} python +ci/validate_wheel.sh ${package_dir} final_dist diff --git a/ci/build_wheel_libcuspatial.sh b/ci/build_wheel_libcuspatial.sh index ed3822207..b6582d87f 100755 --- a/ci/build_wheel_libcuspatial.sh +++ b/ci/build_wheel_libcuspatial.sh @@ -3,6 +3,7 @@ set -euo pipefail +package_dir="python/libcuspatial" package_name="libcuspatial" rapids-logger "Generating build requirements" @@ -25,4 +26,5 @@ python -m pip install \ # 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) export PIP_NO_BUILD_ISOLATION=0 -ci/build_wheel.sh "${package_name}" python/libcuspatial cpp +ci/build_wheel.sh "${package_name}" ${package_dir} cpp +ci/validate_wheel.sh ${package_dir} final_dist diff --git a/ci/validate_wheel.sh b/ci/validate_wheel.sh new file mode 100755 index 000000000..5910a5c59 --- /dev/null +++ b/ci/validate_wheel.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +package_dir=$1 +wheel_dir_relative_path=$2 + +cd "${package_dir}" + +rapids-logger "validate packages with 'pydistcheck'" + +pydistcheck \ + --inspect \ + "$(echo ${wheel_dir_relative_path}/*.whl)" + +rapids-logger "validate packages with 'twine'" + +twine check \ + --strict \ + "$(echo ${wheel_dir_relative_path}/*.whl)" diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index 35a95c728..c8049eadb 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -126,3 +126,11 @@ requires = [ "ninja", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + +[tool.pydistcheck] +select = [ + "distro-too-large-compressed", +] + +# PyPI limit is 100 MiB, fail CI before we get too close to that +max_allowed_size_compressed = '75M' diff --git a/python/cuspatial/pyproject.toml b/python/cuspatial/pyproject.toml index c497434c4..662648337 100644 --- a/python/cuspatial/pyproject.toml +++ b/python/cuspatial/pyproject.toml @@ -145,3 +145,11 @@ requires = [ "rmm==24.12.*,>=0.0.0a0", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + +[tool.pydistcheck] +select = [ + "distro-too-large-compressed", +] + +# PyPI limit is 100 MiB, fail CI before we get too close to that +max_allowed_size_compressed = '75M' diff --git a/python/libcuspatial/pyproject.toml b/python/libcuspatial/pyproject.toml index 1de8df8c1..725d2d882 100644 --- a/python/libcuspatial/pyproject.toml +++ b/python/libcuspatial/pyproject.toml @@ -75,3 +75,11 @@ requires = [ "ninja", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + +[tool.pydistcheck] +select = [ + "distro-too-large-compressed", +] + +# PyPI limit is 100 MiB, fail CI before we get too close to that +max_allowed_size_compressed = '75M' From 20abaaa5f5efa9a476fc875b5de5e94d72bfe394 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 14 Nov 2024 16:02:17 -0600 Subject: [PATCH 10/13] prefer wheel-provided libcuspatial.so in load_library(), use RTLD_LOCAL (#1483) Contributes to https://github.com/rapidsai/build-planning/issues/118 Modifies `libcuspatial.load_library()` in the following ways: * prefer wheel-provided `libcuspatial.so` to system installation * expose environment variable `RAPIDS_LIBCUSPATIAL_PREFER_SYSTEM_LIBRARY` for switching that preference * load `libcuspatial.so` with `RTLD_LOCAL`, to prevent adding symbols to the global namespace ([dlopen docs](https://linux.die.net/man/3/dlopen)) ## Notes for Reviewers ### How I tested this See "How I tested this" in https://github.com/rapidsai/cudf/pull/17316 Also opened this PR originally pulling in built packages from https://github.com/rapidsai/cudf/pull/17316 # Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1483 --- python/libcuspatial/libcuspatial/load.py | 75 ++++++++++++++++-------- 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/python/libcuspatial/libcuspatial/load.py b/python/libcuspatial/libcuspatial/load.py index 7842de9a0..78a8590ef 100644 --- a/python/libcuspatial/libcuspatial/load.py +++ b/python/libcuspatial/libcuspatial/load.py @@ -16,8 +16,37 @@ import ctypes import os +# Loading with RTLD_LOCAL adds the library itself to the loader's +# loaded library cache without loading any symbols into the global +# namespace. This allows libraries that express a dependency on +# this library to be loaded later and successfully satisfy this dependency +# without polluting the global symbol table with symbols from +# libcuspatial that could conflict with symbols from other DSOs. +PREFERRED_LOAD_FLAG = ctypes.RTLD_LOCAL + + +def _load_system_installation(soname: str): + """Try to dlopen() the library indicated by ``soname`` + + Raises ``OSError`` if library cannot be loaded. + """ + return ctypes.CDLL(soname, PREFERRED_LOAD_FLAG) + + +def _load_wheel_installation(soname: str): + """Try to dlopen() the library indicated by ``soname`` + + Returns ``None`` if the library cannot be loaded. + """ + if os.path.isfile( + lib := os.path.join(os.path.dirname(__file__), "lib64", soname) + ): + return ctypes.CDLL(lib, PREFERRED_LOAD_FLAG) + return None + def load_library(): + """Dynamically load libcuspatial.so and its dependencies""" try: # libcudf must be loaded before libcuspatial because libcuspatial # references its symbols @@ -33,32 +62,30 @@ def load_library(): # the loader can find it. pass - # Dynamically load libcuspatial.so. Prefer a system library if one is - # present to avoid clobbering symbols that other packages might expect, - # but if no other library is present use the one in the wheel. + prefer_system_installation = ( + os.getenv("RAPIDS_LIBCUSPATIAL_PREFER_SYSTEM_LIBRARY", "false").lower() + != "false" + ) + + soname = "libcuspatial.so" libcuspatial_lib = None - try: - libcuspatial_lib = ctypes.CDLL("libcuspatial.so", ctypes.RTLD_GLOBAL) - except OSError: - # If neither of these directories contain the library, we assume we are - # in an environment where the C++ library is already installed - # somewhere else and the CMake build of the libcuspatial Python package - # was a no-op. - # - # Note that this approach won't work for real editable installs of the - # libcuspatial package. scikit-build-core has limited support for - # importlib.resources so there isn't a clean way to support that case - # yet. - for lib_dir in ("lib", "lib64"): - if os.path.isfile( - lib := os.path.join( - os.path.dirname(__file__), lib_dir, "libcuspatial.so" - ) - ): - libcuspatial_lib = ctypes.CDLL(lib, ctypes.RTLD_GLOBAL) - break + if prefer_system_installation: + # Prefer a system library if one is present to + # avoid clobbering symbols that other packages might expect, but if no + # other library is present use the one in the wheel. + try: + libcuspatial_lib = _load_system_installation(soname) + except OSError: + libcuspatial_lib = _load_wheel_installation(soname) + else: + # Prefer the libraries bundled in this package. If they aren't found + # (which might be the case in builds where the library was prebuilt + # before packaging the wheel), look for a system installation. + libcuspatial_lib = _load_wheel_installation(soname) + if libcuspatial_lib is None: + libcuspatial_lib = _load_system_installation(soname) # The caller almost never needs to do anything with this library, but no # harm in offering the option since this object at least provides a handle - # to inspect where the library was loaded from. + # to inspect where the libcuspatial was loaded from. return libcuspatial_lib From 0a794562fb6385e9dd97bae5c9090f1a41327319 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 15 Nov 2024 15:29:19 -0600 Subject: [PATCH 11/13] fix library-loading issues in editable installs (#1484) Contributes to https://github.com/rapidsai/build-planning/issues/118 The pattern introduced in #1483 breaks editable installs in devcontainers. In that type of build, `libcuspatial.so` is built outside of the wheel but **not installed**, so it can't be found by `ld`. Extension modules in `cuspatial` are able to find it via RPATHs instead. This proposes: * try-catching the entire library-loading attempt, to silently do nothing in cases like that * ~adding an import of the `cuspatial` Python library in the `devcontainers` CI job, as a smoke test to catch issues like this in the future~ *(edit: removed those, [`devcontainer` builds run on CPU nodes](https://github.com/rapidsai/shared-workflows/blob/4e84062f333ce5649bc65029d3979569e2d0a045/.github/workflows/build-in-devcontainer.yaml#L19))* ## Notes for Reviewers ### How I tested this Tested this approach on https://github.com/rapidsai/kvikio/pull/553 # Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1484 --- python/libcuspatial/libcuspatial/load.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python/libcuspatial/libcuspatial/load.py b/python/libcuspatial/libcuspatial/load.py index 78a8590ef..977586669 100644 --- a/python/libcuspatial/libcuspatial/load.py +++ b/python/libcuspatial/libcuspatial/load.py @@ -81,11 +81,17 @@ def load_library(): # Prefer the libraries bundled in this package. If they aren't found # (which might be the case in builds where the library was prebuilt # before packaging the wheel), look for a system installation. - libcuspatial_lib = _load_wheel_installation(soname) - if libcuspatial_lib is None: - libcuspatial_lib = _load_system_installation(soname) + try: + libcuspatial_lib = _load_wheel_installation(soname) + if libcuspatial_lib is None: + libcuspatial_lib = _load_system_installation(soname) + except OSError: + # If none of the searches above succeed, just silently return None + # and rely on other mechanisms (like RPATHs on other DSOs) to + # help the loader find the library. + pass # The caller almost never needs to do anything with this library, but no # harm in offering the option since this object at least provides a handle - # to inspect where the libcuspatial was loaded from. + # to inspect where libcuspatial was loaded from. return libcuspatial_lib From c3141552e1a00e7086315e8f1ce28ef53ab31d6e Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:05:24 -0800 Subject: [PATCH 12/13] Fix performance regression in quadtree_point_in_polygon by 5x (#1446) Improves on a performance regression identified by @trxcllnt when using `quadtree_point_in_polygon` Seems like the core slowdown is that the passed `points` is a `GeoSeries`, and the x/y points are generated by interleaving them in `GeoColumnAccessor.xy` and then slicing x/y back out. Since these points appear to be held in a `cudf.ListDtype` (i.e. `[x, y]`), I tried avoiding interleaving and slicing the the x and y points individually in the lists using the `cudf.Series.list.get` API but this was failing for x/y points for `.polygons.x`/`.polygons.y` since some cuspatial APIs expect these points to be `float` (not sure if it's a cudf bug in `list.get` or how points as structured for polygons) Instead, I was able to get a 5x speedup by * Caching the interleaving step to avoid doing this multiple times * Slicing a cupy array of points instead of a `cudf.Series` (which uselessly slices an `.index` which is not used)
Benchmarking code ```python # 1.3G points.arrow # 722K polys.arrow import cudf import cupy import cuspatial import pyarrow as pa from time import perf_counter_ns polys = pa.ipc.open_stream("polys.arrow").read_all() polys = cudf.DataFrame.from_arrow(polys).rename(columns={"tract": "poly"}) point = polys["poly"].list.leaves.struct.explode() polys = cuspatial.GeoSeries.from_polygons_xy( point.interleave_columns(), polys["poly"]._column.elements.offsets, polys["poly"]._column.offsets, cupy.arange(0, len(polys) + 1) ) point = pa.ipc.open_stream("points.arrow").read_all() point = cudf.DataFrame.from_arrow(point) min_x = point["x"].min() max_x = point["x"].max() min_y = point["y"].min() max_y = point["y"].max() max_size = 0 max_depth = 16 threshold = 10 while max_size <= threshold: max_depth -= 1 max_size = len(point) / pow(4, max_depth) / 4 scale = max(max_x - min_x, max_y - min_y) / (1 << max_depth) point_xy = cuspatial.GeoSeries.from_points_xy(point.interleave_columns()) point_map, quadtree = ( cuspatial.quadtree_on_points(point_xy, min_x, max_x, min_y, max_y, scale, max_depth, max_size)) t0 = perf_counter_ns() cuspatial.quadtree_point_in_polygon( cuspatial.join_quadtree_and_bounding_boxes( quadtree, cuspatial.polygon_bounding_boxes(polys[0:1]), min_x, max_x, min_y, max_y, scale, max_depth ), quadtree, point_map, point_xy, polys[0:1] ) t1 = perf_counter_ns() print(f"{(t1 - t0) / (10 ** 6)}ms") t0 = perf_counter_ns() poly_offsets = cudf.Series(polys[0:1].polygons.part_offset)._column ring_offsets = cudf.Series(polys[0:1].polygons.ring_offset)._column poly_points_x = cudf.Series(polys[0:1].polygons.x)._column poly_points_y = cudf.Series(polys[0:1].polygons.y)._column from cuspatial._lib import spatial_join cudf.DataFrame._from_data( *spatial_join.quadtree_point_in_polygon( cuspatial.join_quadtree_and_bounding_boxes( quadtree, cuspatial.polygon_bounding_boxes(polys[0:1]), min_x, max_x, min_y, max_y, scale, max_depth ), quadtree, point_map._column, point["x"]._column, point["y"]._column, poly_offsets, ring_offsets, poly_points_x, poly_points_y, ) ) t1 = perf_counter_ns() print(f"{(t1 - t0) / (10 ** 6)}ms") # 127.406344ms # this PR # 644.963021ms # branch 24.10 ```
Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - Paul Taylor (https://github.com/trxcllnt) - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cuspatial/pull/1446 --- python/cuspatial/cuspatial/core/geoseries.py | 77 +++++++------------ .../cuspatial/cuspatial/core/spatial/join.py | 17 ++-- 2 files changed, 38 insertions(+), 56 deletions(-) diff --git a/python/cuspatial/cuspatial/core/geoseries.py b/python/cuspatial/cuspatial/core/geoseries.py index b8d7c4945..37da66744 100644 --- a/python/cuspatial/cuspatial/core/geoseries.py +++ b/python/cuspatial/cuspatial/core/geoseries.py @@ -221,37 +221,38 @@ def sizes(self): ) class GeoColumnAccessor: - def __init__(self, list_series, meta): + def __init__(self, list_series, meta, typ): self._series = list_series self._col = self._series._column self._meta = meta - self._type = Feature_Enum.POINT + self._type = typ + # Resample the existing features so that the offsets returned + # by `_offset` methods reflect previous slicing, and match + # the values returned by .xy. + existing_indices = self._meta.union_offsets[ + self._meta.input_types == self._type.value + ] + self._existing_features = self._col.take(existing_indices._column) @property def x(self): - return self.xy[::2].reset_index(drop=True) + return cudf.Series(self.xy.values[::2]) @property def y(self): - return self.xy[1::2].reset_index(drop=True) + return cudf.Series(self.xy.values[1::2]) - @property + @cached_property def xy(self): - features = self._get_current_features(self._type) + features = self.column() if hasattr(features, "leaves"): - return cudf.Series(features.leaves().values) + return cudf.Series._from_column(features.leaves()) else: return cudf.Series() - def _get_current_features(self, type): - # Resample the existing features so that the offsets returned - # by `_offset` methods reflect previous slicing, and match - # the values returned by .xy. - existing_indices = self._meta.union_offsets[ - self._meta.input_types == type.value - ] - existing_features = self._col.take(existing_indices._column) - return existing_features + def column(self): + """Return the ListColumn reordered by union offset.""" + return self._existing_features def point_indices(self): # Return a cupy.ndarray containing the index values that each @@ -265,18 +266,10 @@ def point_indices(self): self._meta.input_types != -1 ] - def column(self): - """Return the ListColumn reordered by union offset.""" - return self._get_current_features(self._type) - class MultiPointGeoColumnAccessor(GeoColumnAccessor): - def __init__(self, list_series, meta): - super().__init__(list_series, meta) - self._type = Feature_Enum.MULTIPOINT - @property def geometry_offset(self): - return self._get_current_features(self._type).offsets.values + return self.column().offsets.values def point_indices(self): # Return a cupy.ndarray containing the index values from the @@ -286,19 +279,13 @@ def point_indices(self): return cp.repeat(self._meta.input_types.index, sizes) class LineStringGeoColumnAccessor(GeoColumnAccessor): - def __init__(self, list_series, meta): - super().__init__(list_series, meta) - self._type = Feature_Enum.LINESTRING - @property def geometry_offset(self): - return self._get_current_features(self._type).offsets.values + return self.column().offsets.values @property def part_offset(self): - return self._get_current_features( - self._type - ).elements.offsets.values + return self.column().elements.offsets.values def point_indices(self): # Return a cupy.ndarray containing the index values from the @@ -308,25 +295,17 @@ def point_indices(self): return cp.repeat(self._meta.input_types.index, sizes) class PolygonGeoColumnAccessor(GeoColumnAccessor): - def __init__(self, list_series, meta): - super().__init__(list_series, meta) - self._type = Feature_Enum.POLYGON - @property def geometry_offset(self): - return self._get_current_features(self._type).offsets.values + return self.column().offsets.values @property def part_offset(self): - return self._get_current_features( - self._type - ).elements.offsets.values + return self.column().elements.offsets.values @property def ring_offset(self): - return self._get_current_features( - self._type - ).elements.elements.offsets.values + return self.column().elements.elements.offsets.values def point_indices(self): # Return a cupy.ndarray containing the index values from the @@ -340,27 +319,29 @@ def point_indices(self): @property def points(self): """Access the `PointsArray` of the underlying `GeoArrowBuffers`.""" - return self.GeoColumnAccessor(self._column.points, self._column._meta) + return self.GeoColumnAccessor( + self._column.points, self._column._meta, Feature_Enum.POINT + ) @property def multipoints(self): """Access the `MultiPointArray` of the underlying `GeoArrowBuffers`.""" return self.MultiPointGeoColumnAccessor( - self._column.mpoints, self._column._meta + self._column.mpoints, self._column._meta, Feature_Enum.MULTIPOINT ) @property def lines(self): """Access the `LineArray` of the underlying `GeoArrowBuffers`.""" return self.LineStringGeoColumnAccessor( - self._column.lines, self._column._meta + self._column.lines, self._column._meta, Feature_Enum.LINESTRING ) @property def polygons(self): """Access the `PolygonArray` of the underlying `GeoArrowBuffers`.""" return self.PolygonGeoColumnAccessor( - self._column.polygons, self._column._meta + self._column.polygons, self._column._meta, Feature_Enum.POLYGON ) def __repr__(self): diff --git a/python/cuspatial/cuspatial/core/spatial/join.py b/python/cuspatial/cuspatial/core/spatial/join.py index c237fe9d3..fdaeb8f4a 100644 --- a/python/cuspatial/cuspatial/core/spatial/join.py +++ b/python/cuspatial/cuspatial/core/spatial/join.py @@ -214,14 +214,15 @@ def quadtree_point_in_polygon( raise ValueError( "`polygons` Geoseries must contains only polygons geometries." ) - - points_x = as_column(points.points.x) - points_y = as_column(points.points.y) - - poly_offsets = as_column(polygons.polygons.part_offset) - ring_offsets = as_column(polygons.polygons.ring_offset) - poly_points_x = as_column(polygons.polygons.x) - poly_points_y = as_column(polygons.polygons.y) + points_data = points.points + points_x = as_column(points_data.x) + points_y = as_column(points_data.y) + + polygon_data = polygons.polygons + poly_offsets = as_column(polygon_data.part_offset) + ring_offsets = as_column(polygon_data.ring_offset) + poly_points_x = as_column(polygon_data.x) + poly_points_y = as_column(polygon_data.y) return DataFrame._from_data( *spatial_join.quadtree_point_in_polygon( From e213bbf99e6eaf2bf1ceec3c4e7f10fdc864b266 Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Wed, 11 Dec 2024 13:11:26 -0500 Subject: [PATCH 13/13] Update Changelog [skip ci] --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abe227bae..16af67f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +# cuspatial 24.12.00 (11 Dec 2024) + +## 🚨 Breaking Changes + +- prefer wheel-provided libcuspatial.so in load_library(), use RTLD_LOCAL ([#1483](https://github.com/rapidsai/cuspatial/pull/1483)) [@jameslamb](https://github.com/jameslamb) + +## 🐛 Bug Fixes + +- fix library-loading issues in editable installs ([#1484](https://github.com/rapidsai/cuspatial/pull/1484)) [@jameslamb](https://github.com/jameslamb) +- Make polygon fixture data valid ([#1472](https://github.com/rapidsai/cuspatial/pull/1472)) [@harrism](https://github.com/harrism) + +## 📖 Documentation + +- Update README architecture and platform support ([#1476](https://github.com/rapidsai/cuspatial/pull/1476)) [@bdice](https://github.com/bdice) + +## 🛠️ Improvements + +- prefer wheel-provided libcuspatial.so in load_library(), use RTLD_LOCAL ([#1483](https://github.com/rapidsai/cuspatial/pull/1483)) [@jameslamb](https://github.com/jameslamb) +- enforce wheel size limits, README formatting in CI ([#1482](https://github.com/rapidsai/cuspatial/pull/1482)) [@jameslamb](https://github.com/jameslamb) +- Prune workflows based on changed files ([#1479](https://github.com/rapidsai/cuspatial/pull/1479)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- devcontainer: replace `VAULT_HOST` with `AWS_ROLE_ARN` ([#1478](https://github.com/rapidsai/cuspatial/pull/1478)) [@jjacobelli](https://github.com/jjacobelli) +- Updated libcudftestutil CMake linking logic for 24.12 ([#1475](https://github.com/rapidsai/cuspatial/pull/1475)) [@lamarrr](https://github.com/lamarrr) +- build wheels without build isolation ([#1473](https://github.com/rapidsai/cuspatial/pull/1473)) [@jameslamb](https://github.com/jameslamb) +- remove unused variables in build_docs script ([#1469](https://github.com/rapidsai/cuspatial/pull/1469)) [@jameslamb](https://github.com/jameslamb) +- Merge branch-24.10 into branch-24.12 ([#1463](https://github.com/rapidsai/cuspatial/pull/1463)) [@jameslamb](https://github.com/jameslamb) +- Fix performance regression in quadtree_point_in_polygon by 5x ([#1446](https://github.com/rapidsai/cuspatial/pull/1446)) [@mroeschke](https://github.com/mroeschke) + # cuspatial 24.10.00 (9 Oct 2024) ## 🚨 Breaking Changes