From 8d88bed89118786640ab4785b37872a2907188a2 Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Fri, 21 Jul 2023 10:04:42 -0400 Subject: [PATCH 01/21] v23.10 Updates [skip ci] --- .github/workflows/build.yaml | 12 ++++---- .github/workflows/pr.yaml | 20 ++++++------- .github/workflows/test.yaml | 6 ++-- ci/build_docs.sh | 2 +- .../all_cuda-118_arch-x86_64.yaml | 10 +++---- .../all_cuda-120_arch-x86_64.yaml | 10 +++---- cpp/CMakeLists.txt | 2 +- cpp/cuproj/CMakeLists.txt | 2 +- cpp/doxygen/Doxyfile | 4 +-- dependencies.yaml | 30 +++++++++---------- docs/source/conf.py | 4 +-- fetch_rapids.cmake | 2 +- python/cuspatial/CMakeLists.txt | 2 +- python/cuspatial/cuspatial/__init__.py | 2 +- python/cuspatial/pyproject.toml | 10 +++---- 15 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a872e289f..b36dd86ea 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.10 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-action-workflows/.github/workflows/conda-python-build.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@branch-23.10 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-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-upload-packages.yaml@branch-23.10 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-action-workflows/.github/workflows/custom-job.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.10 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.10 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -80,7 +80,7 @@ jobs: wheel-publish: needs: wheel-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-publish.yml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-publish.yml@branch-23.10 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 53cc04bd2..6c63e1046 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -22,40 +22,40 @@ jobs: - wheel-build - wheel-tests secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.10 checks: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/checks.yaml@branch-23.10 with: enable_check_generated_files: false conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-build.yaml@branch-23.10 with: build_type: pull-request conda-cpp-tests: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.10 with: build_type: pull-request conda-python-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-build.yaml@branch-23.10 with: build_type: pull-request conda-python-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.10 with: build_type: pull-request conda-notebook-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.10 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -65,7 +65,7 @@ jobs: docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/custom-job.yaml@branch-23.10 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -75,7 +75,7 @@ jobs: wheel-build: needs: checks secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.10 with: build_type: pull-request package-dir: python/cuspatial @@ -84,7 +84,7 @@ jobs: wheel-tests: needs: wheel-build secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.10 with: build_type: pull-request package-name: cuspatial diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 00a4c0446..d2ec061ab 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-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-cpp-tests.yaml@branch-23.10 with: build_type: nightly branch: ${{ inputs.branch }} @@ -24,7 +24,7 @@ jobs: sha: ${{ inputs.sha }} conda-python-tests: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.10 with: build_type: nightly branch: ${{ inputs.branch }} @@ -32,7 +32,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests: secrets: inherit - uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08 + uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.10 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/ci/build_docs.sh b/ci/build_docs.sh index c4f318f26..bea85b9dc 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -26,7 +26,7 @@ rapids-mamba-retry install \ libcuspatial \ cuspatial -export RAPIDS_VERSION_NUMBER="23.08" +export RAPIDS_VERSION_NUMBER="23.10" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build 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 a6a12dc2e..1b743a7b1 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -10,8 +10,8 @@ dependencies: - cmake>=3.26.4 - cuda-version=11.8 - cudatoolkit -- cudf==23.8.* -- cuml==23.8.* +- cudf==23.10.* +- cuml==23.10.* - cxx-compiler - cython>=0.29,<0.30 - doxygen @@ -21,8 +21,8 @@ dependencies: - gtest>=1.13.0 - ipython - ipywidgets -- libcudf==23.8.* -- librmm==23.8.* +- libcudf==23.10.* +- librmm==23.10.* - myst-parser - nbsphinx - ninja @@ -37,7 +37,7 @@ dependencies: - pytest-cov - pytest-xdist - python>=3.9,<3.11 -- rmm==23.8.* +- rmm==23.10.* - scikit-build>=0.13.1 - scikit-image - setuptools diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index b385a9e14..30b8ecd2f 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -12,8 +12,8 @@ dependencies: - cuda-nvcc - cuda-nvrtc-dev - cuda-version=12.0 -- cudf==23.8.* -- cuml==23.8.* +- cudf==23.10.* +- cuml==23.10.* - cxx-compiler - cython>=0.29,<0.30 - doxygen @@ -23,8 +23,8 @@ dependencies: - gtest>=1.13.0 - ipython - ipywidgets -- libcudf==23.8.* -- librmm==23.8.* +- libcudf==23.10.* +- librmm==23.10.* - myst-parser - nbsphinx - ninja @@ -38,7 +38,7 @@ dependencies: - pytest-cov - pytest-xdist - python>=3.9,<3.11 -- rmm==23.8.* +- rmm==23.10.* - scikit-build>=0.13.1 - scikit-image - setuptools diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f71a2f120..e35232147 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.08.00 LANGUAGES C CXX CUDA) +project(CUSPATIAL VERSION 23.10.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/CMakeLists.txt b/cpp/cuproj/CMakeLists.txt index 57be97a19..18646bbf0 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.08.00 LANGUAGES C CXX CUDA) +project(CUPROJ VERSION 23.10.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/doxygen/Doxyfile b/cpp/doxygen/Doxyfile index 2c3b7bb66..0a37670cf 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.08.00 +PROJECT_NUMBER = 23.10.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.08 "libcudf.tag=https://docs.rapids.ai/api/libcudf/23.08" +TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/23.10 "libcudf.tag=https://docs.rapids.ai/api/libcudf/23.10" # 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/dependencies.yaml b/dependencies.yaml index 66f19f6a1..f355a5de9 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -83,8 +83,8 @@ dependencies: - cxx-compiler - gmock>=1.13.0 - gtest>=1.13.0 - - libcudf==23.8.* - - librmm==23.8.* + - libcudf==23.10.* + - librmm==23.10.* - proj - sqlite specific: @@ -126,8 +126,8 @@ dependencies: - setuptools - output_types: conda packages: &build_python_packages_conda - - &cudf_conda cudf==23.8.* - - &rmm_conda rmm==23.8.* + - &cudf_conda cudf==23.10.* + - &rmm_conda rmm==23.10.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -150,12 +150,12 @@ dependencies: matrices: - matrix: {cuda: "12.0"} packages: - - cudf-cu12==23.8.* - - rmm-cu12==23.8.* + - cudf-cu12==23.10.* + - rmm-cu12==23.10.* - matrix: {cuda: "11.8"} packages: &build_python_packages_cu11 - - &cudf_cu11 cudf-cu11==23.8.* - - &rmm_cu11 rmm-cu11==23.8.* + - &cudf_cu11 cudf-cu11==23.10.* + - &rmm_cu11 rmm-cu11==23.10.* - {matrix: {cuda: "11.5"}, packages: *build_python_packages_cu11} - {matrix: {cuda: "11.4"}, packages: *build_python_packages_cu11} - {matrix: {cuda: "11.2"}, packages: *build_python_packages_cu11} @@ -226,17 +226,17 @@ dependencies: - scikit-image - output_types: conda packages: - - &cuml_conda cuml==23.8.* + - &cuml_conda cuml==23.10.* specific: - output_types: [requirements, pyproject] matrices: - {matrix: null, packages: [*cuml_conda]} - matrix: {cuda: "12.0"} packages: - - cuml-cu12==23.8.* + - cuml-cu12==23.10.* - matrix: {cuda: "11.8"} packages: ¬ebooks_packages_cu11 - - &cuml_cu11 cuml-cu11==23.8.* + - &cuml_cu11 cuml-cu11==23.10.* - {matrix: {cuda: "11.5"}, packages: *notebooks_packages_cu11} - {matrix: {cuda: "11.4"}, packages: *notebooks_packages_cu11} - {matrix: {cuda: "11.2"}, packages: *notebooks_packages_cu11} @@ -274,12 +274,12 @@ dependencies: matrices: - matrix: {cuda: "12.0"} packages: - - cudf-cu12==23.8.* - - rmm-cu12==23.8.* + - cudf-cu12==23.10.* + - rmm-cu12==23.10.* - matrix: {cuda: "11.8"} packages: &run_python_packages_cu11 - - cudf-cu11==23.8.* - - rmm-cu11==23.8.* + - cudf-cu11==23.10.* + - rmm-cu11==23.10.* - {matrix: {cuda: "11.5"}, packages: *run_python_packages_cu11} - {matrix: {cuda: "11.4"}, packages: *run_python_packages_cu11} - {matrix: {cuda: "11.2"}, packages: *run_python_packages_cu11} diff --git a/docs/source/conf.py b/docs/source/conf.py index 6851fe052..89d88301a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,9 +50,9 @@ # built documents. # # The short X.Y version. -version = '23.08' +version = '23.10' # The full version, including alpha/beta/rc tags. -release = '23.08.00' +release = '23.10.00' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake index 99da99888..0d7bf678a 100644 --- a/fetch_rapids.cmake +++ b/fetch_rapids.cmake @@ -11,7 +11,7 @@ # or implied. See the License for the specific language governing permissions and limitations under # the License. # ============================================================================= -file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.08/RAPIDS.cmake +file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.10/RAPIDS.cmake ${CMAKE_BINARY_DIR}/RAPIDS.cmake ) include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) diff --git a/python/cuspatial/CMakeLists.txt b/python/cuspatial/CMakeLists.txt index bf9f575a8..7ef7f58af 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.08.00) +set(cuspatial_version 23.10.00) include(../../fetch_rapids.cmake) include(rapids-cuda) diff --git a/python/cuspatial/cuspatial/__init__.py b/python/cuspatial/cuspatial/__init__.py index d8f07d5d0..cd11e4950 100644 --- a/python/cuspatial/cuspatial/__init__.py +++ b/python/cuspatial/cuspatial/__init__.py @@ -29,4 +29,4 @@ ) from .io.geopandas import from_geopandas -__version__ = "23.08.00" +__version__ = "23.10.00" diff --git a/python/cuspatial/pyproject.toml b/python/cuspatial/pyproject.toml index 8db1ffa61..80ea51489 100644 --- a/python/cuspatial/pyproject.toml +++ b/python/cuspatial/pyproject.toml @@ -16,10 +16,10 @@ build-backend = "setuptools.build_meta" requires = [ "cmake>=3.26.4", - "cudf==23.8.*", + "cudf==23.10.*", "cython>=0.29,<0.30", "ninja", - "rmm==23.8.*", + "rmm==23.10.*", "scikit-build>=0.13.1", "setuptools", "wheel", @@ -27,7 +27,7 @@ requires = [ [project] name = "cuspatial" -version = "23.8.0" +version = "23.10.0" description = "cuSpatial: GPU-Accelerated Spatial and Trajectory Data Management and Analytics Library" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -36,9 +36,9 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ - "cudf==23.8.*", + "cudf==23.10.*", "geopandas>=0.11.0", - "rmm==23.8.*", + "rmm==23.10.*", ] # 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", From 278de0382748241dac755de9ba877bf1894e39be Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Fri, 4 Aug 2023 10:41:57 -0500 Subject: [PATCH 02/21] All 23.10 version updates? --- README.md | 10 +++---- cpp/cuproj/doxygen/Doxyfile | 4 +-- dependencies.yaml | 10 +++---- docs/cuproj/source/conf.py | 4 +-- python/cuproj/CMakeLists.txt | 2 +- python/cuproj/cuproj/__init__.py | 2 +- .../cuproj/cuproj/cuprojshim/CMakeLists.txt | 2 +- python/cuproj/pyproject.toml | 28 ++++++------------- 8 files changed, 25 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 1a0fbe89a..c2fc696ae 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ > cuSpatial depends on [cuDF](https://github.com/rapidsai/cudf) and [RMM](https://github.com/rapidsai/rmm) from [RAPIDS](https://rapids.ai/). ## cuProj - GPU-accelerated Coordinate Reference System (CRS) Transformations -cuProj is a new RAPIDS library housed within the cuSpatial repo that provides GPU-accelerated transformations of coordinates between coordinate reference systems (CRS). cuProj is available as of release 23.08 with support for transformations of WGS84 coordinates to and from Universal Transverse Mercator (UTM) :globe_with_meridians:. +cuProj is a new RAPIDS library housed within the cuSpatial repo that provides GPU-accelerated transformations of coordinates between coordinate reference systems (CRS). cuProj is available as of release 23.10 with support for transformations of WGS84 coordinates to and from Universal Transverse Mercator (UTM) :globe_with_meridians:. To learn more about cuProj, see the [Python cuProj README](python/cuproj/README.md) or the [c++ libcuproj README](cpp/cuproj/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.08-cuda11.8-py3.10 + nvcr.io/nvidia/rapidsai/notebooks:23.10-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.08 python=3.10 cudatoolkit=11.8 + cuspatial=23.10 python=3.10 cudatoolkit=11.8 ``` We also provide nightly Conda packages built from the HEAD of our latest development branch. @@ -142,7 +142,7 @@ The cuSpatial pip packages can be installed from NVIDIA's PyPI index. pip instal - If your installation has a CUDA 12 driver but a CUDA 11 toolkit, use the `-cu11` wheels. ```shell pip install cuspatial-cu12 --extra-index-url=https://pypi.nvidia.com -pip install cuspatial-cu11 --extra-index-url=https://pypi.nvidia.com +pip install cuspatial-cu11 --extra-index-url=https://pypi.nvidia.com ``` #### Troubleshooting Fiona/GDAL versions @@ -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.08, +@misc{cuspatial:23.10, author = {{NVIDIA Corporation}}, title = {cuSpatial: GPU-Accelerated Geospatial and Spatiotemporal Algorithms}, year = {2023}, diff --git a/cpp/cuproj/doxygen/Doxyfile b/cpp/cuproj/doxygen/Doxyfile index 2b4cffa10..9c7069507 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.08.00 +PROJECT_NUMBER = 23.10.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.08 "libcudf.tag=https://docs.rapids.ai/api/libcudf/23.08" +TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/23.10 "libcudf.tag=https://docs.rapids.ai/api/libcudf/23.10" # 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/dependencies.yaml b/dependencies.yaml index bfd4c1588..364af471a 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -158,7 +158,7 @@ dependencies: - cxx-compiler - gmock>=1.13.0 - gtest>=1.13.0 - - librmm==23.8.* + - librmm==23.10.* - proj - sqlite specific: @@ -266,7 +266,7 @@ dependencies: matrices: - matrix: {cuda: "12.0"} packages: - - rmm-cu12==23.8.* + - rmm-cu12==23.10.* - matrix: {cuda: "11.8"} packages: - *rmm_cu11 @@ -419,10 +419,10 @@ dependencies: matrices: - matrix: {cuda: "12.0"} packages: - - rmm-cu12==23.8.* + - rmm-cu12==23.10.* - matrix: {cuda: "11.8"} packages: &run_python_cuproj_packages_cu11 - - rmm-cu11==23.8.* + - rmm-cu11==23.10.* - {matrix: {cuda: "11.5"}, packages: *run_python_cuproj_packages_cu11} - {matrix: {cuda: "11.4"}, packages: *run_python_cuproj_packages_cu11} - {matrix: {cuda: "11.2"}, packages: *run_python_cuproj_packages_cu11} @@ -442,4 +442,4 @@ dependencies: - pytest-cov - pytest-xdist - geopandas>=0.11.0 - - cuspatial==23.8.* + - cuspatial==23.10.* diff --git a/docs/cuproj/source/conf.py b/docs/cuproj/source/conf.py index 2ad6ee00a..7d3dcdd53 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.08' +version = '23.10' # The full version, including alpha/beta/rc tags. -release = '23.08.00' +release = '23.10.00' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/python/cuproj/CMakeLists.txt b/python/cuproj/CMakeLists.txt index 6a0eaa20a..771200aad 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.08.00) +set(cuproj_version 23.10.00) include(../../fetch_rapids.cmake) include(rapids-cuda) diff --git a/python/cuproj/cuproj/__init__.py b/python/cuproj/cuproj/__init__.py index 1f9a1c4bc..3bc512666 100644 --- a/python/cuproj/cuproj/__init__.py +++ b/python/cuproj/cuproj/__init__.py @@ -2,4 +2,4 @@ from .transformer import Transformer -__version__ = "23.08.00" +__version__ = "23.10.00" diff --git a/python/cuproj/cuproj/cuprojshim/CMakeLists.txt b/python/cuproj/cuproj/cuprojshim/CMakeLists.txt index e59a7e8db..2a63a03fb 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.08.00) +set(cuproj_version 23.10.00) include(../../../../fetch_rapids.cmake) include(rapids-cmake) diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index 3d828b14c..d4c1738ab 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -18,7 +18,7 @@ requires = [ "cmake>=3.26.4", "cython>=0.29,<0.30", "ninja", - "rmm==23.8.*", + "rmm==23.10.*", "scikit-build>=0.13.1", "setuptools", "wheel", @@ -26,17 +26,15 @@ requires = [ [project] name = "cuproj" -version = "23.8.0" +version = "23.10.0" description = "cuProj: GPU-Accelerated Coordinate Projection" readme = { file = "README.md", content-type = "text/markdown" } -authors = [ - { name = "NVIDIA Corporation" }, -] +authors = [{ name = "NVIDIA Corporation" }] license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ "cupy-cuda11x>=12.0.0", - "rmm==23.8.*", + "rmm==23.10.*", ] # 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", @@ -50,7 +48,7 @@ classifiers = [ [project.optional-dependencies] test = [ - "cuspatial==23.8.*", + "cuspatial==23.10.*", "geopandas>=0.11.0", "pytest", "pytest-cov", @@ -71,19 +69,9 @@ include_trailing_comma = true force_grid_wrap = 0 combine_as_imports = true order_by_type = true -known_dask = [ - "dask", - "distributed", - "dask_cuda", -] -known_rapids = [ - "rmm", - "cudf", -] -known_first_party = [ - "cuspatial", - "cuproj", -] +known_dask = ["dask", "distributed", "dask_cuda"] +known_rapids = ["rmm", "cudf"] +known_first_party = ["cuspatial", "cuproj"] default_section = "THIRDPARTY" sections = [ "FUTURE", From 817736732c4b64f5f3a51bf05516b0cf2ee4b7a8 Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Fri, 4 Aug 2023 15:46:33 -0500 Subject: [PATCH 03/21] Remove cuspatial=23.10 dependency from cuproj. --- dependencies.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/dependencies.yaml b/dependencies.yaml index 364af471a..050a7de21 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -442,4 +442,3 @@ dependencies: - pytest-cov - pytest-xdist - geopandas>=0.11.0 - - cuspatial==23.10.* From 48b34067e34c088dfc13f6606710e0c35ab7cc52 Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Fri, 4 Aug 2023 15:57:12 -0500 Subject: [PATCH 04/21] Remove cuspatial from pyproject.toml as well --- python/cuproj/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index d4c1738ab..7a25d921a 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -48,7 +48,6 @@ classifiers = [ [project.optional-dependencies] test = [ - "cuspatial==23.10.*", "geopandas>=0.11.0", "pytest", "pytest-cov", From 19fff3876889614e06f615e531089b9d64f771bf Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Fri, 4 Aug 2023 16:17:06 -0500 Subject: [PATCH 05/21] Drop cuspatial from cuproj test. --- python/cuproj/cuproj/tests/test_transform.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/cuproj/cuproj/tests/test_transform.py b/python/cuproj/cuproj/tests/test_transform.py index d90d3297e..a02e66fb2 100644 --- a/python/cuproj/cuproj/tests/test_transform.py +++ b/python/cuproj/cuproj/tests/test_transform.py @@ -1,16 +1,18 @@ import cupy as cp -import geopandas as gpd +# import geopandas as gpd import numpy as np import pytest from cupy.testing import assert_allclose from pyproj import Transformer from pyproj.enums import TransformDirection -from shapely.geometry import Point -import cuspatial +# import cuspatial from cuproj import Transformer as cuTransformer +# from shapely.geometry import Point + + valid_crs_combos = [ (4326, 32756), (32756, 4326), @@ -176,6 +178,7 @@ def test_wgs84_to_utm_grid(dtype, container_type, dtype, container_type, min_corner, max_corner, crs_to) +""" Temporary fix to repair 23.08 -> 23.10 automerge # test __cuda_array_interface__ support by using cuspatial geoseries as input def test_geoseries_input(): s = gpd.GeoSeries( @@ -197,3 +200,4 @@ def test_geoseries_input(): assert_allclose(cuproj_x, pyproj_x) assert_allclose(cuproj_y, pyproj_y) +""" From 52238a0c7fb3204aa12d8478ad1c69ea130a3ba3 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 7 Aug 2023 08:13:48 -0700 Subject: [PATCH 06/21] Update to Cython 3.0.0 (#1235) The cuspatial Python code appears to need no updates to build without warnings (with the exception of upstream cuda-python issues that we expect to be fixed in an upcoming release). Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Ray Douglass (https://github.com/raydouglass) - Michael Wang (https://github.com/isVoid) - H. Thomson Comer (https://github.com/thomcom) URL: https://github.com/rapidsai/cuspatial/pull/1235 --- .../all_cuda-118_arch-x86_64.yaml | 2 +- .../all_cuda-120_arch-x86_64.yaml | 2 +- conda/recipes/cuspatial/meta.yaml | 2 +- cpp/.clangd | 42 +++++++------------ dependencies.yaml | 2 +- python/cuspatial/pyproject.toml | 2 +- 6 files changed, 21 insertions(+), 31 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 1b743a7b1..4464e6708 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -13,7 +13,7 @@ dependencies: - cudf==23.10.* - cuml==23.10.* - cxx-compiler -- cython>=0.29,<0.30 +- cython>=3.0.0 - doxygen - gcc_linux-64=11.* - geopandas>=0.11.0 diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index 30b8ecd2f..2e02a6f69 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -15,7 +15,7 @@ dependencies: - cudf==23.10.* - cuml==23.10.* - cxx-compiler -- cython>=0.29,<0.30 +- cython>=3.0.0 - doxygen - gcc_linux-64=11.* - geopandas>=0.11.0 diff --git a/conda/recipes/cuspatial/meta.yaml b/conda/recipes/cuspatial/meta.yaml index 96f02de87..125243807 100644 --- a/conda/recipes/cuspatial/meta.yaml +++ b/conda/recipes/cuspatial/meta.yaml @@ -54,7 +54,7 @@ requirements: - cuda-version ={{ cuda_version }} - cmake {{ cmake_version }} - cudf ={{ minor_version }} - - cython >=0.29,<0.30 + - cython >=3.0.0 - libcuspatial ={{ version }} - python - rmm ={{ minor_version }} diff --git a/cpp/.clangd b/cpp/.clangd index 2d2ed314a..b066cf511 100644 --- a/cpp/.clangd +++ b/cpp/.clangd @@ -1,60 +1,50 @@ -# https://clangd.llvm.org/config - -# Apply a config conditionally to all C files +# Apply this config conditionally to all C files If: PathMatch: .*\.(c|h)$ +CompileFlags: + Compiler: /nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.8/envs/rapids/bin/gcc --- -# Apply a config conditionally to all C++ files +# Apply this config conditionally to all C++ headers If: - PathMatch: .*\.(c|h)pp + PathMatch: .*\.(c|h)pp$ +CompileFlags: + Compiler: /nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.8/envs/rapids/bin/g++ --- -# Apply a config conditionally to all CUDA files +# Apply this config conditionally to all CUDA headers If: - PathMatch: .*\.cuh? + PathMatch: .*\.cuh?$ CompileFlags: - Add: - - "-x" - - "cuda" - # No error on unknown CUDA versions - - "-Wno-unknown-cuda-version" - # Allow variadic CUDA functions - - "-Xclang=-fcuda-allow-variadic-functions" + Compiler: /usr/local/cuda/bin/nvcc --- # Tweak the clangd parse settings for all files CompileFlags: Add: - - "-stdlib=libc++" # report all errors - "-ferror-limit=0" - - "-fmacro-backtrace-limit=0" - - "-ftemplate-backtrace-limit=0" Remove: - - "-stdpar*" # strip CUDA fatbin args - "-Xfatbin*" - - "-Xcompiler*" - - "-gpu=*" - - "--diag_suppress*" # strip CUDA arch flags - "-arch*" - "-gencode*" - "--generate-code*" - # strip gcc's -fcoroutines - - -fcoroutines # strip CUDA flags unknown to clang - - "-ccbin*" - - "-Xcudafe=*" - - "--compiler-options*" - "--expt-extended-lambda" - "--expt-relaxed-constexpr" - "-forward-unknown-to-host-compiler" - "-Werror=cross-execution-space-call" +Hover: + ShowAKA: No +InlayHints: + Enabled: No Diagnostics: Suppress: + - "variadic_device_fn" - "attributes_not_allowed" + - "-Wdeprecated-declarations" diff --git a/dependencies.yaml b/dependencies.yaml index f355a5de9..880bea8f7 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -121,7 +121,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - cython>=0.29,<0.30 + - cython>=3.0.0 - scikit-build>=0.13.1 - setuptools - output_types: conda diff --git a/python/cuspatial/pyproject.toml b/python/cuspatial/pyproject.toml index 80ea51489..14db3feae 100644 --- a/python/cuspatial/pyproject.toml +++ b/python/cuspatial/pyproject.toml @@ -17,7 +17,7 @@ build-backend = "setuptools.build_meta" requires = [ "cmake>=3.26.4", "cudf==23.10.*", - "cython>=0.29,<0.30", + "cython>=3.0.0", "ninja", "rmm==23.10.*", "scikit-build>=0.13.1", From 4220ab110328d4b27ebe822cc74fa951f5ba1950 Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Wed, 9 Aug 2023 23:08:59 -0500 Subject: [PATCH 07/21] Change path to trajectories_extracted.p to improve CI run consistency. (#1247) Changes the URL to `trajectories_extracted.p` to a `data.rapids.ai` url, which should improve CI run stability for notebooks. @taureandyernv Authors: - H. Thomson Comer (https://github.com/thomcom) - Michael Wang (https://github.com/isVoid) Approvers: - Michael Wang (https://github.com/isVoid) URL: https://github.com/rapidsai/cuspatial/pull/1247 --- CHANGELOG.md | 2 +- notebooks/trajectory_clustering.ipynb | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33af7fa6e..0dd4eea2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ - Forward merge `branch-23.06` into `branch-23.08` ([#1190](https://github.com/rapidsai/cuspatial/pull/1190)) [@raydouglass](https://github.com/raydouglass) - use rapids-upload-docs script ([#1181](https://github.com/rapidsai/cuspatial/pull/1181)) [@AyodeAwe](https://github.com/AyodeAwe) - Remove Stale Demo Scripts ([#1180](https://github.com/rapidsai/cuspatial/pull/1180)) [@isVoid](https://github.com/isVoid) -- Updates Build Instructions to Adjust for Devcontainer Instructions and Remove Stale Infomation ([#1179](https://github.com/rapidsai/cuspatial/pull/1179)) [@isVoid](https://github.com/isVoid) +- Updates Build Instructions to Adjust for Devcontainer Instructions and Remove Stale Information ([#1179](https://github.com/rapidsai/cuspatial/pull/1179)) [@isVoid](https://github.com/isVoid) - Fix branch-23.06 forward-merge into branch-23.08 ([#1175](https://github.com/rapidsai/cuspatial/pull/1175)) [@trxcllnt](https://github.com/trxcllnt) - Remove documentation build scripts for Jenkins ([#1169](https://github.com/rapidsai/cuspatial/pull/1169)) [@ajschmidt8](https://github.com/ajschmidt8) - cuSpatial: Build CUDA 12 packages ([#1044](https://github.com/rapidsai/cuspatial/pull/1044)) [@isVoid](https://github.com/isVoid) diff --git a/notebooks/trajectory_clustering.ipynb b/notebooks/trajectory_clustering.ipynb index 654c5d1ef..b31576eb3 100644 --- a/notebooks/trajectory_clustering.ipynb +++ b/notebooks/trajectory_clustering.ipynb @@ -1,7 +1,6 @@ { "cells": [ { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -45,7 +44,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -53,7 +51,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -82,7 +79,7 @@ } ], "source": [ - "!if [ ! -f \"trajectories_extracted.p\" ]; then wget -O trajectories_extracted.p \"https://drive.google.com/uc?export=download&id=1GE-_z9HgLp3eV7Lgo_KOl53QuMgiCUMS\"; else echo \"trajectories_extracted.p found\"; fi" + "!if [ ! -f \"trajectories_extracted.p\" ]; then wget -O trajectories_extracted.p \"https://data.rapids.ai/cuspatial/datasets/trajectories_extracted.p\"; else echo \"trajectories_extracted.p found\"; fi" ] }, { @@ -98,7 +95,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -170,7 +166,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -206,7 +201,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -252,7 +246,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -301,7 +294,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -407,7 +399,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -480,7 +471,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -551,7 +541,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -623,7 +612,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -718,7 +706,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.10" + "version": "3.10.12" }, "vscode": { "interpreter": { From 88ee1bb38ea7aa9bb57ebc113acfd09d1f44c7a1 Mon Sep 17 00:00:00 2001 From: Mark Harris <783069+harrism@users.noreply.github.com> Date: Sat, 19 Aug 2023 16:58:41 +1000 Subject: [PATCH 08/21] Add back deleted conda env files (#1261) The yaml files in conda/environments were accidentally deleted in #1251 . This PR adds them back. Authors: - Mark Harris (https://github.com/harrism) Approvers: - Ray Douglass (https://github.com/raydouglass) - H. Thomson Comer (https://github.com/thomcom) URL: https://github.com/rapidsai/cuspatial/pull/1261 --- .../all_cuda-118_arch-x86_64.yaml | 49 ++++++++++++++++++ .../all_cuda-120_arch-x86_64.yaml | 51 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 conda/environments/all_cuda-118_arch-x86_64.yaml create mode 100644 conda/environments/all_cuda-120_arch-x86_64.yaml diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml new file mode 100644 index 000000000..88b40d1cd --- /dev/null +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -0,0 +1,49 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- conda-forge +- nvidia +dependencies: +- c-compiler +- cmake>=3.26.4 +- cuda-version=11.8 +- cudatoolkit +- cudf==23.10.* +- cuml==23.10.* +- cupy>=12.0.0 +- cxx-compiler +- cython>=3.0.0 +- doxygen +- gcc_linux-64=11.* +- geopandas>=0.11.0 +- gmock>=1.13.0 +- gtest>=1.13.0 +- ipython +- ipywidgets +- libcudf==23.10.* +- librmm==23.10.* +- myst-parser +- nbsphinx +- ninja +- notebook +- numpydoc +- nvcc_linux-64=11.8 +- pre-commit +- proj +- pydata-sphinx-theme +- pydeck +- pytest +- pytest-cov +- pytest-xdist +- python>=3.9,<3.11 +- rmm==23.10.* +- scikit-build>=0.13.1 +- scikit-image +- setuptools +- shapely +- sphinx<6 +- sqlite +- sysroot_linux-64==2.17 +name: all_cuda-118_arch-x86_64 diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml new file mode 100644 index 000000000..312191cf9 --- /dev/null +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -0,0 +1,51 @@ +# This file is generated by `rapids-dependency-file-generator`. +# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +channels: +- rapidsai +- rapidsai-nightly +- conda-forge +- nvidia +dependencies: +- c-compiler +- cmake>=3.26.4 +- cuda-cudart-dev +- cuda-cupti-dev +- cuda-nvcc +- cuda-nvrtc-dev +- cuda-version=12.0 +- cudf==23.10.* +- cuml==23.10.* +- cupy>=12.0.0 +- cxx-compiler +- cython>=3.0.0 +- doxygen +- gcc_linux-64=11.* +- geopandas>=0.11.0 +- gmock>=1.13.0 +- gtest>=1.13.0 +- ipython +- ipywidgets +- libcudf==23.10.* +- librmm==23.10.* +- myst-parser +- nbsphinx +- ninja +- notebook +- numpydoc +- pre-commit +- proj +- pydata-sphinx-theme +- pydeck +- pytest +- pytest-cov +- pytest-xdist +- python>=3.9,<3.11 +- rmm==23.10.* +- scikit-build>=0.13.1 +- scikit-image +- setuptools +- shapely +- sphinx<6 +- sqlite +- sysroot_linux-64==2.17 +name: all_cuda-120_arch-x86_64 From 7237565d2c845843a2a67abd027922a073cc2605 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 28 Aug 2023 09:46:05 -0400 Subject: [PATCH 09/21] Use `copy-pr-bot` (#1262) This PR replaces the `copy_prs` functionality from the `ops-bot` with the new dedicated `copy-pr-bot` GitHub application. Thorough documentation for the new `copy-pr-bot` application can be viewed below. - https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ **Important**: `copy-pr-bot` enforces signed commits. If an organization member opens a PR that contains unsigned commits, it will be deemed untrusted and therefore require an `/ok to test` comment. See the GitHub docs [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) for information on how to set up commit signing. Any time a PR is deemed untrusted, it will receive a comment that looks like this: https://github.com/rapidsai/ci-imgs/pull/63#issuecomment-1688973208. Every subsequent commit on an untrusted PR will require an additional `/ok to test` comment. Any existing PRs that have unsigned commits after this change is merged will require an `/ok to test` comment for each subsequent commit _or_ the PR can be rebased to include signed commits as mentioned in the docs below: https://docs.gha-runners.nvidia.com/cpr/contributors. This information is all included on the documentation page linked above. _I've skipped CI on this PR since it's not a change that is tested._ [skip ci] --- .github/copy-pr-bot.yaml | 4 ++++ .github/ops-bot.yaml | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .github/copy-pr-bot.yaml diff --git a/.github/copy-pr-bot.yaml b/.github/copy-pr-bot.yaml new file mode 100644 index 000000000..895ba83ee --- /dev/null +++ b/.github/copy-pr-bot.yaml @@ -0,0 +1,4 @@ +# Configuration file for `copy-pr-bot` GitHub App +# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ + +enabled: true diff --git a/.github/ops-bot.yaml b/.github/ops-bot.yaml index 2d1444c59..9a0b41550 100644 --- a/.github/ops-bot.yaml +++ b/.github/ops-bot.yaml @@ -5,5 +5,4 @@ auto_merger: true branch_checker: true label_checker: true release_drafter: true -copy_prs: true recently_updated: true From a87d21f0cf70116576bf7dbdd42db2bcfd50e7d4 Mon Sep 17 00:00:00 2001 From: Taurean Dyer <46935140+taureandyernv@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:02:04 -0700 Subject: [PATCH 10/21] [REVIEW] Add cudf example code for haversine distance into 23.10 (#1260) Authors: - Taurean Dyer (https://github.com/taureandyernv) Approvers: - Michael Wang (https://github.com/isVoid) - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cuspatial/pull/1260 --- .../user_guide/cuspatial_api_examples.ipynb | 200 ++++++++++++------ .../cuspatial/core/spatial/distance.py | 30 ++- 2 files changed, 159 insertions(+), 71 deletions(-) diff --git a/docs/source/user_guide/cuspatial_api_examples.ipynb b/docs/source/user_guide/cuspatial_api_examples.ipynb index 083da03f9..b85399729 100644 --- a/docs/source/user_guide/cuspatial_api_examples.ipynb +++ b/docs/source/user_guide/cuspatial_api_examples.ipynb @@ -166,8 +166,8 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/3038749724.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", - " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\n" + "/tmp/ipykernel_5364/3038749724.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] }, { @@ -270,7 +270,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/567044009.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/567044009.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] } @@ -308,7 +308,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/1940355512.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/1940355512.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] }, @@ -547,7 +547,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/1016569337.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/1016569337.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] } @@ -647,7 +647,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/2658722012.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/2658722012.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] } @@ -768,7 +768,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/491857862.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/491857862.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] }, @@ -808,6 +808,68 @@ "cudf.Series(distances_in_meters).head()" ] }, + { + "cell_type": "markdown", + "id": "f21c1709-dfc1-411b-b9d5-ec5dc345367f", + "metadata": {}, + "source": [ + "This above method reads the GeoPandas data from CPU memory into GPU memory and then cuSpatial processes it. If the data is already in a cuDF GPU dataframe, you can quickly calculate Haversine distances using the method below. This maximizes speed by keeping all the processing on the GPU and is very useful when working on large datasets." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "c32741b0-c550-4d0f-b494-45191f5b60fd", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " latitude longitude atlanta_lat atlanta_lng atlanta_dist\n", + "0 17.1167 -61.7833 33.749 -84.388 11961.556540\n", + "1 17.1333 -61.7833 33.749 -84.388 11963.392729\n", + "2 25.3330 55.5170 33.749 -84.388 12243.126130\n", + "3 25.2550 55.3640 33.749 -84.388 12233.867463\n", + "4 24.4330 54.6510 33.749 -84.388 12139.822218\n", + "5 24.2620 55.6090 33.749 -84.388 12124.483127\n", + "6 35.3170 69.0170 33.749 -84.388 13418.538383\n", + "7 34.2100 62.2280 33.749 -84.388 13258.725239\n", + "8 34.5660 69.2120 33.749 -84.388 13336.375942\n", + "9 31.5000 65.8500 33.749 -84.388 12976.749248\n", + "10 36.7167 3.2500 33.749 -84.388 13547.245294\n", + "11 30.5667 2.8667 33.749 -84.388 12866.528267\n", + "12 28.0500 9.6331 33.749 -84.388 12554.544289\n", + "13 22.8000 5.4331 33.749 -84.388 11990.825098\n", + "14 35.7297 0.6500 33.749 -84.388 13451.775999\n", + "15 36.9700 7.7900 33.749 -84.388 13553.372737\n", + "16 36.7800 3.0700 33.749 -84.388 13555.211584\n", + "17 36.8000 3.0300 33.749 -84.388 13557.641136\n", + "18 36.8000 3.0400 33.749 -84.388 13557.588738\n", + "19 36.7200 4.0500 33.749 -84.388 13543.496327\n" + ] + } + ], + "source": [ + "# Generate data to be used to create a cuDF dataframe. \n", + "# The data to be processed by Haversine MUST be a Float.\n", + "a = {\"latitude\":[17.1167, 17.1333, 25.333, 25.255, 24.433, 24.262, 35.317, 34.21, 34.566, 31.5, 36.7167, 30.5667, 28.05, 22.8, 35.7297, 36.97, 36.78, 36.8, 36.8, 36.72],\n", + " \"longitude\": [-61.7833, -61.7833, 55.517, 55.364, 54.651, 55.609, 69.017, 62.228, 69.212, 65.85, 3.25, 2.8667, 9.6331, 5.4331, 0.65, 7.79, 3.07, 3.03, 3.04, 4.05]}\n", + "df = cudf.DataFrame(data=a)\n", + "\n", + "# Create cuSpatial GeoSeries from cuDF Dataframe\n", + "cuGeoSeries = cuspatial.GeoSeries.from_points_xy(df[['longitude', 'latitude']].interleave_columns())\n", + "\n", + "# Create Comparator cuSpatial GeoSeries from a comparator point\n", + "df['atlanta_lat'] = 33.7490\n", + "df['atlanta_lng'] = -84.3880\n", + "atlGeoSeries = cuspatial.GeoSeries.from_points_xy(df[['atlanta_lat', 'atlanta_lng']].interleave_columns())\n", + "\n", + "# Calculate Haversine Distance of cuDF dataframe to comparator point\n", + "df['atlanta_dist'] = cuspatial.haversine_distance(cuGeoSeries, atlGeoSeries)\n", + "print(df.head())" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -832,12 +894,20 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "id": "35dfb7c9-1914-488a-b22e-8d0067ea7a8b", "metadata": { "tags": [] }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_5364/1097934054.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" + ] + }, { "name": "stdout", "output_type": "stream", @@ -855,14 +925,6 @@ "4 75.821029\n", "dtype: float64\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/tmp/ipykernel_261438/1097934054.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", - " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" - ] } ], "source": [ @@ -899,7 +961,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "id": "40e9a41e-21af-47cc-a142-b19a67941f7f", "metadata": { "tags": [] @@ -909,7 +971,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/2846028812.py:2: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/2846028812.py:2: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\")).to_crs(3857)\n" ] }, @@ -968,7 +1030,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "id": "258c9a8c-7fe3-4047-80b7-00878d9fb2f1", "metadata": { "tags": [] @@ -978,9 +1040,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/3261459244.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_cities' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/3261459244.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_cities' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " cities = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_cities\")).to_crs(3857)\n", - "/tmp/ipykernel_261438/3261459244.py:2: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/3261459244.py:2: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " countries = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\")).to_crs(3857)\n" ] }, @@ -1099,7 +1161,7 @@ "(GPU)" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -1134,7 +1196,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 19, "id": "5863871e", "metadata": {}, "outputs": [ @@ -1208,7 +1270,7 @@ "4 Broadway LINESTRING (-8235369.475 4980617.398, -8235373..." ] }, - "execution_count": 4, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -1234,7 +1296,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 20, "id": "f4c67464", "metadata": {}, "outputs": [ @@ -1301,7 +1363,7 @@ "0 POLYGON ((-8236139.639 4975314.625, -8235990.3..." ] }, - "execution_count": 5, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -1326,7 +1388,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 21, "id": "d4e68e87", "metadata": {}, "outputs": [ @@ -1433,7 +1495,7 @@ "[1864 rows x 2 columns]" ] }, - "execution_count": 7, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -1460,7 +1522,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "id": "951625da", "metadata": {}, "outputs": [ @@ -1468,7 +1530,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/3213563529.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/3213563529.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " countries = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\")).to_crs(3857)\n" ] } @@ -1483,7 +1545,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "id": "2f0e1118", "metadata": {}, "outputs": [ @@ -1592,7 +1654,7 @@ "9 Sudan Iran 1.625828e+06" ] }, - "execution_count": 22, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -1628,12 +1690,20 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 24, "id": "d1ade9da-c9e2-45c4-9685-dffeda3fd358", "metadata": { "tags": [] }, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_5364/3414785716.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" + ] + }, { "name": "stdout", "output_type": "stream", @@ -1645,14 +1715,6 @@ "4 POINT (39.20222 -4.67677)\n", "dtype: geometry\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/tmp/ipykernel_261438/3414785716.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", - " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" - ] } ], "source": [ @@ -1704,7 +1766,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 25, "id": "cc72a44d-a9bf-4432-9898-de899ac45869", "metadata": { "tags": [] @@ -1714,7 +1776,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/199363072.py:3: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/199363072.py:3: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] } @@ -1731,7 +1793,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "id": "1125fd17-afe1-4b9c-b48d-8842dd3700b3", "metadata": { "tags": [] @@ -1740,7 +1802,7 @@ { "data": { "text/plain": [ - "\n", + "\n", "[\n", " 0,\n", " 142\n", @@ -1748,7 +1810,7 @@ "dtype: int32" ] }, - "execution_count": 25, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -1761,7 +1823,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "id": "b281e3bb-42d4-4d60-9cb2-b7dcc20b4776", "metadata": { "tags": [] @@ -1776,15 +1838,15 @@ "3 POINT (-129.98000 55.28500)\n", "4 POINT (-130.53611 54.80278)\n", " ... \n", - "137 LINESTRING (-82.69009 41.67511, -82.43928 41.6...\n", - "138 LINESTRING (-117.03121 49.00000, -107.05000 49...\n", - "139 LINESTRING (-83.89077 46.11693, -83.61613 46.1...\n", - "140 LINESTRING (-120.00000 49.00000, -117.03121 49...\n", - "141 LINESTRING (-122.84000 49.00000, -120.00000 49...\n", + "137 LINESTRING (-120.00000 49.00000, -117.03121 49...\n", + "138 LINESTRING (-122.84000 49.00000, -120.00000 49...\n", + "139 LINESTRING (-117.03121 49.00000, -107.05000 49...\n", + "140 LINESTRING (-83.89077 46.11693, -83.61613 46.1...\n", + "141 LINESTRING (-82.69009 41.67511, -82.43928 41.6...\n", "Length: 142, dtype: geometry" ] }, - "execution_count": 26, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -1796,7 +1858,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "id": "e19873b9-2614-4242-ad67-caa47f807d04", "metadata": { "tags": [] @@ -1833,9 +1895,9 @@ " \n", " 0\n", " [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ...\n", - " [18, 16, 18, 15, 17, 137, 14, 16, 13, 15, 14, ...\n", + " [18, 16, 18, 15, 17, 14, 16, 13, 15, 14, 11, 1...\n", " [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...\n", - " [9, 10, 10, 11, 11, 28, 12, 12, 13, 13, 14, 15...\n", + " [9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15...\n", " \n", " \n", "\n", @@ -1846,16 +1908,16 @@ "0 [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, ... \n", "\n", " lhs_segment_id \\\n", - "0 [18, 16, 18, 15, 17, 137, 14, 16, 13, 15, 14, ... \n", + "0 [18, 16, 18, 15, 17, 14, 16, 13, 15, 14, 11, 1... \n", "\n", " rhs_linestring_id \\\n", "0 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... \n", "\n", " rhs_segment_id \n", - "0 [9, 10, 10, 11, 11, 28, 12, 12, 13, 13, 14, 15... " + "0 [9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15... " ] }, - "execution_count": 27, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -1889,7 +1951,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 29, "id": "bf7b2256", "metadata": { "tags": [] @@ -1899,7 +1961,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/1271339229.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/1271339229.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_dataframe = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n" ] }, @@ -1914,7 +1976,7 @@ "dtype: int64" ] }, - "execution_count": 28, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -2001,7 +2063,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "id": "e3a0a9a3-0bdd-4f05-bcb5-7db4b99a44a3", "metadata": { "tags": [] @@ -2066,7 +2128,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "id": "023bd25a-35be-435d-ab0b-ecbd7a47e147", "metadata": { "tags": [] @@ -2126,7 +2188,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "id": "784aff8e-c9ed-4a81-aa87-bf301b3b90af", "metadata": { "tags": [] @@ -2136,9 +2198,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_261438/2951982051.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/2951982051.py:1: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_countries = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_lowres\"))\n", - "/tmp/ipykernel_261438/2951982051.py:2: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_cities' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", + "/tmp/ipykernel_5364/2951982051.py:2: FutureWarning: The geopandas.dataset module is deprecated and will be removed in GeoPandas 1.0. You can get the original 'naturalearth_cities' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/.\n", " host_cities = geopandas.read_file(geopandas.datasets.get_path(\"naturalearth_cities\"))\n" ] } @@ -2152,7 +2214,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "id": "fea24c78-cf5c-45c6-b860-338238e61323", "metadata": { "tags": [] @@ -2238,7 +2300,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/python/cuspatial/cuspatial/core/spatial/distance.py b/python/cuspatial/cuspatial/core/spatial/distance.py index 5ab1d1c7b..fa53bacee 100644 --- a/python/cuspatial/cuspatial/core/spatial/distance.py +++ b/python/cuspatial/cuspatial/core/spatial/distance.py @@ -101,14 +101,40 @@ def haversine_distance(p1: GeoSeries, p2: GeoSeries): Parameters ---------- p1: GeoSeries - Series of points + Series of points as floats p2: GeoSeries - Series of points + Series of points as floats Returns ------- result : cudf.Series The distance between pairs of points between `p1` and `p2` + >>> import cudf + >>> import cuspatial + >>> a = {"latitude":[0.0,0.0,1.0,1.0], + ... "longitude": [0.0,1.0,0.0,1.0]} + >>> df = cudf.DataFrame(data=a) + + >>> # Create cuSpatial GeoSeries from cuDF Dataframe + >>> gs = cuspatial.GeoSeries.from_points_xy( + ... df[['longitude', 'latitude']].interleave_columns() + ... ) + + >>> # Create Comparator cuSpatial GeoSeries from a comparator point + >>> df['compare_lat'] = 2.0 # this will broadcast the value to all rows + >>> df['compare_lng'] = 2.0 + >>> cmp_gs = cuspatial.GeoSeries.from_points_xy( + ... df[['compare_lat', 'compare_lng']].interleave_columns() + ... ) + + >>> # Calculate Haversine Distance of cuDF dataframe to comparator point + >>> df['compare_dist'] = cuspatial.haversine_distance(gs, cmp_gs) + >>> df.head() + latitude longitude compare_lat compare_lng compare_dist + 0 0.0 0.0 2.0 2.0 314.474805 + 1 0.0 1.0 2.0 2.0 248.629315 + 2 1.0 0.0 2.0 2.0 248.568719 + 3 1.0 1.0 2.0 2.0 157.225432 """ if any([not contains_only_points(p1), not contains_only_points(p2)]): From 56f7cfc8eeee3e6166acb53bbcd3d6e404f5caba Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 8 Sep 2023 13:41:37 -0500 Subject: [PATCH 11/21] Use `conda mambabuild` not `mamba mambabuild` (#1265) With the release of conda 23.7.3, `mamba mambabuild` stopped working. With boa installed, `conda mambabuild` uses the mamba solver, so just use that instead. See also https://github.com/rapidsai/cudf/issues/14068. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/cuspatial/pull/1265 --- ci/build_cpp.sh | 2 +- ci/build_python.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 529a8f450..007eb17ee 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -11,7 +11,7 @@ rapids-print-env rapids-logger "Begin cpp build" -rapids-mamba-retry mambabuild \ +rapids-conda-retry mambabuild \ conda/recipes/libcuspatial rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 37d4b566a..de5c3fef8 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -15,7 +15,7 @@ rapids-logger "Begin py build cuSpatial" # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -rapids-mamba-retry mambabuild \ +rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuspatial @@ -24,7 +24,7 @@ rapids-logger "Begin py build cuProj" # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -rapids-mamba-retry mambabuild \ +rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuproj From a8adea4e46af40b7e762360dc715a0ba40c6e331 Mon Sep 17 00:00:00 2001 From: Divye Gala Date: Fri, 8 Sep 2023 17:07:03 -0400 Subject: [PATCH 12/21] Simplify wheel build scripts and allow alphas of RAPIDS dependencies (#1264) This PR: 1. Removes `ci/apply_wheel_modifications.sh` and uses it inline in wheel build scripts 2. Allows for specifying alpha versioned dependencies of RAPIDS projects Authors: - Divye Gala (https://github.com/divyegala) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/cuspatial/pull/1264 --- ci/build_wheel.sh | 53 +++++++++++++++++++++++++ ci/build_wheel_cuproj.sh | 22 +--------- ci/build_wheel_cuspatial.sh | 22 +--------- ci/release/apply_wheel_modifications.sh | 21 ---------- 4 files changed, 57 insertions(+), 61 deletions(-) create mode 100755 ci/build_wheel.sh delete mode 100755 ci/release/apply_wheel_modifications.sh diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh new file mode 100755 index 000000000..6801137e3 --- /dev/null +++ b/ci/build_wheel.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright (c) 2023, NVIDIA CORPORATION. + +set -euo pipefail + +package_name=$1 +package_dir=$2 + +source rapids-configure-sccache +source rapids-date-string + +# Use gha-tools rapids-pip-wheel-version to generate wheel version then +# update the necessary files +version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" + +RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" + +# This is the version of the suffix with a preceding hyphen. It's used +# everywhere except in the final wheel name. +PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" + +# Patch project metadata files to include the CUDA version suffix and version override. +pyproject_file="${package_dir}/pyproject.toml" + +sed -i "s/^version = .*/version = \"${version_override}\"/g" ${pyproject_file} +sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} + +# For nightlies we want to ensure that we're pulling in alphas as well. The +# easiest way to do so is to augment the spec with a constraint containing a +# min alpha version that doesn't affect the version bounds but does allow usage +# of alpha versions for that dependency without --pre +alpha_spec='' +if ! rapids-is-release-build; then + alpha_spec=',>=0.0.0a0' +fi + +sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file} +if [[ ${package_name} == "cuspatial" ]]; then + sed -r -i "s/cudf==(.*)\"/cudf${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} +fi + +if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then + sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} +fi + +cd "${package_dir}" + +python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check + +mkdir -p final_dist +python -m auditwheel repair -w final_dist dist/* + +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist diff --git a/ci/build_wheel_cuproj.sh b/ci/build_wheel_cuproj.sh index 02a749b76..2e3e724c7 100755 --- a/ci/build_wheel_cuproj.sh +++ b/ci/build_wheel_cuproj.sh @@ -3,24 +3,6 @@ set -euo pipefail -source rapids-configure-sccache -source rapids-date-string +export SKBUILD_CONFIGURE_OPTIONS="-DCUPROJ_BUILD_WHEELS=ON" -# Use gha-tools rapids-pip-wheel-version to generate wheel version then -# update the necessary files -version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" - -RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - -ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}" -echo "The package name and/or version was modified in the package source. The git diff is:" -git diff - -cd python/cuproj - -SKBUILD_CONFIGURE_OPTIONS="-DCUPROJ_BUILD_WHEELS=ON" python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check - -mkdir -p final_dist -python -m auditwheel repair -w final_dist dist/* - -RAPIDS_PY_WHEEL_NAME="cuproj_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist +ci/build_wheel.sh cuproj python/cuproj diff --git a/ci/build_wheel_cuspatial.sh b/ci/build_wheel_cuspatial.sh index 34924f48b..c98184d13 100755 --- a/ci/build_wheel_cuspatial.sh +++ b/ci/build_wheel_cuspatial.sh @@ -3,24 +3,6 @@ set -euo pipefail -source rapids-configure-sccache -source rapids-date-string +export SKBUILD_CONFIGURE_OPTIONS="-DCUSPATIAL_BUILD_WHEELS=ON" -# Use gha-tools rapids-pip-wheel-version to generate wheel version then -# update the necessary files -version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" - -RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - -ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}" -echo "The package name and/or version was modified in the package source. The git diff is:" -git diff - -cd python/cuspatial - -SKBUILD_CONFIGURE_OPTIONS="-DCUSPATIAL_BUILD_WHEELS=ON" python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check - -mkdir -p final_dist -python -m auditwheel repair -w final_dist dist/* - -RAPIDS_PY_WHEEL_NAME="cuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist +ci/build_wheel.sh cuspatial python/cuspatial diff --git a/ci/release/apply_wheel_modifications.sh b/ci/release/apply_wheel_modifications.sh deleted file mode 100755 index 3a15466ca..000000000 --- a/ci/release/apply_wheel_modifications.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. -# -# Usage: bash apply_wheel_modifications.sh - -VERSION=${1} -CUDA_SUFFIX=${2} - -sed -i "s/^version = .*/version = \"${VERSION}\"/g" python/cuspatial/pyproject.toml -sed -i "s/^name = \"cuspatial\"/name = \"cuspatial${CUDA_SUFFIX}\"/g" python/cuspatial/pyproject.toml -sed -i "s/rmm==/rmm${CUDA_SUFFIX}==/g" python/cuspatial/pyproject.toml -sed -i "s/cudf==/cudf${CUDA_SUFFIX}==/g" python/cuspatial/pyproject.toml - -sed -i "s/^version = .*/version = \"${VERSION}\"/g" python/cuproj/pyproject.toml -sed -i "s/^name = \"cuproj\"/name = \"cuproj${CUDA_SUFFIX}\"/g" python/cuproj/pyproject.toml -sed -i "s/rmm==/rmm${CUDA_SUFFIX}==/g" python/cuproj/pyproject.toml -sed -i "s/cuspatial==/cuspatial${CUDA_SUFFIX}==/g" python/cuproj/pyproject.toml - -if [[ $CUDA_SUFFIX == "-cu12" ]]; then - sed -i "s/cupy-cuda11x/cupy-cuda12x/g" python/cuproj/pyproject.toml -fi From 7f14fb25e726e1b0f84ed3cd5dffe56e5444cbd9 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 19 Sep 2023 07:50:26 -0500 Subject: [PATCH 13/21] Update to clang 16.0.6. (#1266) This PR updates cuspatial to use clang 16.0.6. This aligns with the major version 16 being used elsewhere in RAPIDS, with a bugfix version that avoids clang-format issues around `*` multiplication operators. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cuspatial/pull/1266 --- .pre-commit-config.yaml | 2 +- cpp/scripts/run-clang-format.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d2fb2b29..f4ae6e253 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: hooks: - id: cython-lint - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v15.0.7 + rev: v16.0.6 hooks: - id: clang-format types_or: [c, c++, cuda] diff --git a/cpp/scripts/run-clang-format.py b/cpp/scripts/run-clang-format.py index f47ac53a2..18d9f9b76 100644 --- a/cpp/scripts/run-clang-format.py +++ b/cpp/scripts/run-clang-format.py @@ -22,7 +22,7 @@ import tempfile -EXPECTED_VERSION = "15.0.7" +EXPECTED_VERSION = "16.0.6" VERSION_REGEX = re.compile(r"clang-format version ([0-9.]+)") # NOTE: populate this list with more top-level dirs as we add more of them to the cuspatial repo DEFAULT_DIRS = ["cpp/include", From b063e085769679dbcc8049fddafbb76fe46c7433 Mon Sep 17 00:00:00 2001 From: Jake Awe <50372925+AyodeAwe@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:03:34 -0500 Subject: [PATCH 14/21] Update image names (#1269) PR updates `rapidsai/ci` references to `rapidsai/ci-conda` Authors: - Jake Awe (https://github.com/AyodeAwe) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) URL: https://github.com/rapidsai/cuspatial/pull/1269 --- .github/workflows/build.yaml | 2 +- .github/workflows/pr.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9929002e9..bec60c0c4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -61,7 +61,7 @@ jobs: arch: "amd64" branch: ${{ inputs.branch }} build_type: ${{ inputs.build_type || 'branch' }} - container_image: "rapidsai/ci:latest" + container_image: "rapidsai/ci-conda:latest" date: ${{ inputs.date }} node_type: "gpu-v100-latest-1" run_script: "ci/build_docs.sh" diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5c9ba5adc..213950723 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -62,7 +62,7 @@ jobs: build_type: pull-request node_type: "gpu-v100-latest-1" arch: "amd64" - container_image: "rapidsai/ci:latest" + container_image: "rapidsai/ci-conda:latest" run_script: "ci/test_notebooks.sh" docs-build: needs: conda-python-build @@ -72,7 +72,7 @@ jobs: build_type: pull-request node_type: "gpu-v100-latest-1" arch: "amd64" - container_image: "rapidsai/ci:latest" + container_image: "rapidsai/ci-conda:latest" run_script: "ci/build_docs.sh" wheel-build-cuspatial: needs: checks From 73412e6c4537ebfd638eed619a26bda7ed84a684 Mon Sep 17 00:00:00 2001 From: Paul Taylor <178183+trxcllnt@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:10:01 -0700 Subject: [PATCH 15/21] Update devcontainers to align with other RAPIDS repositories (#1263) Removes the unified and isolated devcontainers in favor of just the single one. The unified devcontainers are [still available](https://github.com/rapidsai/devcontainers/blob/d970ac17a894f5d1047fcfd17cffa6d14fe66ec8/.devcontainer/cuda12.0-conda/devcontainer.json#L23-L31) in the [`rapidsai/devcontainers`](https://github.com/rapidsai/devcontainers) repository. Adds an optional job to the `pr.yaml` to [build the cuGraph libs in each devcontainer](https://github.com/trxcllnt/cuspatial/blob/fea/devcontainers/.github/workflows/pr.yaml#L106-L111), so the build caches are populated for devs by CI. Other PRs: * https://github.com/rapidsai/rmm/pull/1328 * https://github.com/rapidsai/kvikio/pull/273 * https://github.com/rapidsai/cudf/pull/14015 * https://github.com/rapidsai/raft/pull/1791 * https://github.com/rapidsai/cumlprims_mg/pull/149 * https://github.com/rapidsai/cuml/pull/5568 * https://github.com/rapidsai/cugraph-ops/pull/538 * https://github.com/rapidsai/cugraph/pull/3838 Authors: - Paul Taylor (https://github.com/trxcllnt) - H. Thomson Comer (https://github.com/thomcom) Approvers: - Mark Harris (https://github.com/harrism) - Jake Awe (https://github.com/AyodeAwe) URL: https://github.com/rapidsai/cuspatial/pull/1263 --- .devcontainer/Dockerfile | 20 +- .devcontainer/README.md | 75 ------ .../isolated/.devcontainer/devcontainer.json | 93 ------- .../single/.devcontainer/devcontainer.json | 95 -------- .../unified/.devcontainer/devcontainer.json | 103 -------- .../cuda11.8-conda/devcontainer.json | 37 +++ .devcontainer/cuda11.8-pip/devcontainer.json | 36 +++ .../cuda12.0-conda/devcontainer.json | 37 +++ .devcontainer/cuda12.0-pip/devcontainer.json | 36 +++ .devcontainer/devcontainer.json | 89 ------- .devcontainer/launch.sh | 52 ---- .../isolated/.devcontainer/devcontainer.json | 92 ------- .../single/.devcontainer/devcontainer.json | 96 -------- .../unified/.devcontainer/devcontainer.json | 102 -------- .github/workflows/pr.yaml | 9 + .gitignore | 1 + ci/release/update-version.sh | 10 +- .../all_cuda-118_arch-x86_64.yaml | 1 + .../all_cuda-120_arch-x86_64.yaml | 1 + cpp/.clangd | 61 +++-- cpp/cuproj/CMakeLists.txt | 4 + dependencies.yaml | 226 ++++++++++-------- python/cuproj/pyproject.toml | 3 +- 23 files changed, 344 insertions(+), 935 deletions(-) delete mode 100644 .devcontainer/conda/isolated/.devcontainer/devcontainer.json delete mode 100644 .devcontainer/conda/single/.devcontainer/devcontainer.json delete mode 100644 .devcontainer/conda/unified/.devcontainer/devcontainer.json create mode 100644 .devcontainer/cuda11.8-conda/devcontainer.json create mode 100644 .devcontainer/cuda11.8-pip/devcontainer.json create mode 100644 .devcontainer/cuda12.0-conda/devcontainer.json create mode 100644 .devcontainer/cuda12.0-pip/devcontainer.json delete mode 100644 .devcontainer/devcontainer.json delete mode 100755 .devcontainer/launch.sh delete mode 100644 .devcontainer/pip/isolated/.devcontainer/devcontainer.json delete mode 100644 .devcontainer/pip/single/.devcontainer/devcontainer.json delete mode 100644 .devcontainer/pip/unified/.devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 68194d0f9..974aea1ee 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,18 +1,20 @@ # syntax=docker/dockerfile:1.5 -ARG CUDA=12.0 -ARG LLVM=16 -ARG RAPIDS=23.08 -ARG DISTRO=ubuntu22.04 -ARG REPO=rapidsai/devcontainers - +ARG BASE ARG PYTHON_PACKAGE_MANAGER=conda -FROM ${REPO}:${RAPIDS}-cpp-llvm${LLVM}-cuda${CUDA}-${DISTRO} as pip-base +FROM ${BASE} as pip-base + +ENV DEFAULT_VIRTUAL_ENV=rapids + +RUN apt update -y \ + && DEBIAN_FRONTEND=noninteractive apt install -y \ + sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev \ + && rm -rf /tmp/* /var/tmp/* /var/cache/apt/* /var/lib/apt/lists/*; -FROM ${REPO}:${RAPIDS}-cpp-mambaforge-${DISTRO} as conda-base +FROM ${BASE} as conda-base -COPY --from=pip-base /etc/skel/.config/clangd/config.yaml /etc/skel/.config/clangd/config.yaml +ENV DEFAULT_CONDA_ENV=rapids FROM ${PYTHON_PACKAGE_MANAGER}-base diff --git a/.devcontainer/README.md b/.devcontainer/README.md index c2f5fe9bc..18243943c 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -9,11 +9,6 @@ This container is a turnkey development environment for building and testing the * [Prerequisites](#prerequisites) * [Host bind mounts](#host-bind-mounts) * [Launch a Dev Container](#launch-a-dev-container) - * [via VSCode](#via-vscode) - * [via `launch.sh`](#via-launchsh) - * [Single mode](#single-mode) - * [Unified mode](#unified-mode) - * [Isolated mode](#isolated-mode) ## Prerequisites @@ -35,76 +30,6 @@ This ensures caches, configurations, dependencies, and your commits are persiste ## Launch a Dev Container -A devcontainer can be launched directly by VSCode, or via a custom `launch.sh` shell script. - -### via VSCode - To launch a devcontainer from VSCode, open the cuSpatial repo and select the "Reopen in Container" button in the bottom right:
Alternatively, open the VSCode command palette (typically `cmd/ctrl + shift + P`) and run the "Rebuild and Reopen in Container" command. - -### via `launch.sh` - -Use the `.devcontainer/launch.sh` script to start a new instance of the development container and launch a fresh VSCode window connected to it. - -VSCode extends its [single-window-per-folder](https://github.com/microsoft/vscode/issues/2686) process model to devcontainers. Opening the same devcontainer in separate windows doesn't create two separate containers -- instead you have two VSCode windows each connected to the same running container. - -`launch.sh` takes two arguments, a `mode` and a `package manager`. - -* The `mode` argument determines how the devcontainer interacts with the files on the host. -* The `package manager` argument can be either `conda`, or `pip`. This determines whether the devcontainer uses `conda` or `pip` to install the dependencies (the default is `conda`). `pip` is experimental/not working for normal dev, and is currently meant to aid in pip packaging work. - -#### Single mode - -`.devcontainer/launch.sh single` launches the devcontainer with the [default bind mounts](#host-bind-mounts). RMM and cuDF are installed via the package manager. - -Example: -```bash -# Launch a devcontainer that only mounts cuspatial and installs dependencies via conda -$ .devcontainer/launch.sh single conda - -# or installs dependencies via pip -$ .devcontainer/launch.sh single pip -``` - -#### Unified mode - -`.devcontainer/launch.sh unified` launches the devcontainer with the [default bind mounts](#host-bind-mounts), as well as additional `rmm` and `cudf` bind mounts (assumes RMM and cuDF are siblings to the cuspatial repository): - -* `${repo}/../.rmm:/home/coder/rmm` -* `${repo}/../.cudf:/home/coder/cudf` - -In this mode, RMM and cuDF will not be installed, but the devcontainer will install the dependencies necessary to build all three. - -Example: -```bash -# Launch a devcontainer that mounts rmm, cudf, and cuspatial from the host and installs dependencies via conda -$ .devcontainer/launch.sh unified conda - -# or installs dependencies via pip -$ .devcontainer/launch.sh unified pip -``` - -#### Isolated mode - -`.devcontainer/launch.sh isolated` launches the devcontainer without the deps/repo bind mounts, and instead contains a unique copy of the `cuspatial` source in a Docker [volume](https://docs.docker.com/storage/volumes/). - -Use this mode to launch multiple isolated development containers that can be checked out to separate branches of `cuspatial`. - -The Docker volume persists after the devcontainer is removed, ensuring you don't pending lose work by accidentally removing the devcontainer. - -However, you will need to manually remove the volume once you've committed and pushed your changes: - -* Use the [`docker volume ls`](https://docs.docker.com/engine/reference/commandline/volume_ls/) command to list all volumes -* Use [`docker volume rm`](https://docs.docker.com/engine/reference/commandline/volume_rm/) or [`docker volume prune`](https://docs.docker.com/engine/reference/commandline/volume_prune/) to clean up unused volumes - -Alternatively, use the "Dev Volumes" tab of the VSCode Dev Containers extension to view and remove unused volumes. - -Examples: -```bash -# Launch a devcontainer that is isolated from changes on the host and installs dependencies via conda -$ .devcontainer/launch.sh isolated conda - -# or installs dependencies via pip -$ .devcontainer/launch.sh isolated pip -``` diff --git a/.devcontainer/conda/isolated/.devcontainer/devcontainer.json b/.devcontainer/conda/isolated/.devcontainer/devcontainer.json deleted file mode 100644 index e55b955e4..000000000 --- a/.devcontainer/conda/isolated/.devcontainer/devcontainer.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "conda" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs}" - ], - - "updateContentCommand": [ - "/bin/bash", "-c", "sudo chown -R $(id -u):$(id -g) /home/coder/${localWorkspaceFolderBasename} && mkdir -m 0755 -p ~/.config/clangd && cp -n /etc/skel/.config/clangd/config.yaml ~/.config/clangd/config.yaml && cp -ar /workspaces/${localWorkspaceFolderBasename} /home/coder/ && rapids-make-vscode-workspace --update" - ], - - "containerEnv": { - "DEFAULT_CONDA_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", - "source=${localWorkspaceFolderBasename}-conda-isolated-${devcontainerId},target=/home/coder/${localWorkspaceFolderBasename},type=volume" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.devcontainer/conda/single/.devcontainer/devcontainer.json b/.devcontainer/conda/single/.devcontainer/devcontainer.json deleted file mode 100644 index 7b0865cf1..000000000 --- a/.devcontainer/conda/single/.devcontainer/devcontainer.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "conda" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}/single}" - ], - - "updateContentCommand": [ - "/bin/bash", - "-c", - "mkdir -m 0755 -p ~/.config/clangd && cp -n /etc/skel/.config/clangd/config.yaml ~/.config/clangd/config.yaml" - ], - - "containerEnv": { - "DEFAULT_CONDA_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}/single,target=/home/coder/.conda/envs,type=bind,consistency=consistent" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.devcontainer/conda/unified/.devcontainer/devcontainer.json b/.devcontainer/conda/unified/.devcontainer/devcontainer.json deleted file mode 100644 index da741fc06..000000000 --- a/.devcontainer/conda/unified/.devcontainer/devcontainer.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "conda" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/unified} ${localWorkspaceFolder}/../{rmm,kvikio,cudf,raft,cumlprims_mg,cuml,cugraph-ops,cugraph,cuspatial}" - ], - - "updateContentCommand": [ - "/bin/bash", - "-c", - "mkdir -m 0755 -p ~/.config/clangd && cp -n /etc/skel/.config/clangd/config.yaml ~/.config/clangd/config.yaml" - ], - - "containerEnv": { - "DEFAULT_CONDA_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../rmm,target=/home/coder/rmm,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../kvikio,target=/home/coder/kvikio,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cudf,target=/home/coder/cudf,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../raft,target=/home/coder/raft,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cumlprims_mg,target=/home/coder/cumlprims_mg,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cuml,target=/home/coder/cuml,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cugraph-ops,target=/home/coder/cugraph-ops,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cugraph,target=/home/coder/cugraph,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/unified,target=/home/coder/.conda/envs,type=bind,consistency=consistent" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.devcontainer/cuda11.8-conda/devcontainer.json b/.devcontainer/cuda11.8-conda/devcontainer.json new file mode 100644 index 000000000..a39cea813 --- /dev/null +++ b/.devcontainer/cuda11.8-conda/devcontainer.json @@ -0,0 +1,37 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "11.8", + "PYTHON_PACKAGE_MANAGER": "conda", + "BASE": "rapidsai/devcontainers:23.10-cpp-llvm16-cuda11.8-mambaforge-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda11.8-envs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/cuspatial,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}-cuda11.8-envs,target=/home/coder/.conda/envs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda11.8-pip/devcontainer.json b/.devcontainer/cuda11.8-pip/devcontainer.json new file mode 100644 index 000000000..15c5136c5 --- /dev/null +++ b/.devcontainer/cuda11.8-pip/devcontainer.json @@ -0,0 +1,36 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "11.8", + "PYTHON_PACKAGE_MANAGER": "pip", + "BASE": "rapidsai/devcontainers:23.10-cpp-llvm16-cuda11.8-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda11.8-venvs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/cuspatial,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.local/share/${localWorkspaceFolderBasename}-cuda11.8-venvs,target=/home/coder/.local/share/venvs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda12.0-conda/devcontainer.json b/.devcontainer/cuda12.0-conda/devcontainer.json new file mode 100644 index 000000000..949e4d2f8 --- /dev/null +++ b/.devcontainer/cuda12.0-conda/devcontainer.json @@ -0,0 +1,37 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "12.0", + "PYTHON_PACKAGE_MANAGER": "conda", + "BASE": "rapidsai/devcontainers:23.10-cpp-mambaforge-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}-cuda12.0-envs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/cuspatial,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}-cuda12.0-envs,target=/home/coder/.conda/envs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/cuda12.0-pip/devcontainer.json b/.devcontainer/cuda12.0-pip/devcontainer.json new file mode 100644 index 000000000..113e80533 --- /dev/null +++ b/.devcontainer/cuda12.0-pip/devcontainer.json @@ -0,0 +1,36 @@ +{ + "build": { + "context": "${localWorkspaceFolder}/.devcontainer", + "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", + "args": { + "CUDA": "12.0", + "PYTHON_PACKAGE_MANAGER": "pip", + "BASE": "rapidsai/devcontainers:23.10-cpp-llvm16-cuda12.0-ubuntu22.04" + } + }, + "hostRequirements": {"gpu": "optional"}, + "features": { + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.10": {} + }, + "overrideFeatureInstallOrder": [ + "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" + ], + "initializeCommand": ["/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/share/${localWorkspaceFolderBasename}-cuda12.0-venvs}"], + "postAttachCommand": ["/bin/bash", "-c", "if [ ${CODESPACES:-false} = 'true' ]; then . devcontainer-utils-post-attach-command; . rapids-post-attach-command; fi"], + "workspaceFolder": "/home/coder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/cuspatial,type=bind,consistency=consistent", + "mounts": [ + "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", + "source=${localWorkspaceFolder}/../.local/share/${localWorkspaceFolderBasename}-cuda12.0-venvs,target=/home/coder/.local/share/venvs,type=bind,consistency=consistent" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-python.flake8", + "nvidia.nsight-vscode-edition" + ] + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 841df8838..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "conda" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config,conda/pkgs,conda/${localWorkspaceFolderBasename}/single}" - ], - - "containerEnv": { - "DEFAULT_CONDA_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/pkgs,target=/home/coder/.conda/pkgs,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.conda/${localWorkspaceFolderBasename}/single,target=/home/coder/.conda/envs,type=bind,consistency=consistent" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.devcontainer/launch.sh b/.devcontainer/launch.sh deleted file mode 100755 index 60bc3e38a..000000000 --- a/.devcontainer/launch.sh +++ /dev/null @@ -1,52 +0,0 @@ -#! /usr/bin/env bash - -launch_devcontainer() { - - # Ensure we're in the repo root - cd "$( cd "$( dirname "$(realpath -m "${BASH_SOURCE[0]}")" )" && pwd )/.."; - - local mode="${1:-single}"; - local pkgs="${2:-conda}"; - - case "${pkgs}" in - pip ) ;; - conda ) ;; - * ) pkgs="conda";; - esac - - case "${mode}" in - single ) ;; - unified ) ;; - isolated) ;; - * ) mode="single";; - esac - - local flavor="${pkgs}/${mode}"; - local workspace="$(basename "$(pwd)")"; - local tmpdir="$(mktemp -d)/${workspace}"; - local path="$(pwd)/.devcontainer/${flavor}"; - - mkdir -p "${tmpdir}"; - cp -arL "$path/.devcontainer" "${tmpdir}/"; - sed -i "s@\${localWorkspaceFolder}@$(pwd)@g" "${tmpdir}/.devcontainer/devcontainer.json"; - path="${tmpdir}"; - - local hash="$(echo -n "${path}" | xxd -pu - | tr -d '[:space:]')"; - local url="vscode://vscode-remote/dev-container+${hash}/home/coder"; - - echo "devcontainer URL: ${url}"; - - local launch=""; - if type open >/dev/null 2>&1; then - launch="open"; - elif type xdg-open >/dev/null 2>&1; then - launch="xdg-open"; - fi - - if [ -n "${launch}" ]; then - code --new-window "${tmpdir}"; - exec "${launch}" "${url}" >/dev/null 2>&1; - fi -} - -launch_devcontainer "$@"; diff --git a/.devcontainer/pip/isolated/.devcontainer/devcontainer.json b/.devcontainer/pip/isolated/.devcontainer/devcontainer.json deleted file mode 100644 index f1b0e9d6a..000000000 --- a/.devcontainer/pip/isolated/.devcontainer/devcontainer.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "pip" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip}" - ], - - "updateContentCommand": [ - "/bin/bash", "-c", "sudo chown -R $(id -u):$(id -g) /home/coder/${localWorkspaceFolderBasename} && mkdir -m 0755 -p ~/.config/clangd && cp -n /etc/skel/.config/clangd/config.yaml ~/.config/clangd/config.yaml && cp -ar /workspaces/${localWorkspaceFolderBasename} /home/coder/ && rapids-make-vscode-workspace --update" - ], - - "containerEnv": { - "DEFAULT_VIRTUAL_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolderBasename}-pip-isolated-${devcontainerId},target=/home/coder/${localWorkspaceFolderBasename},type=volume" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.devcontainer/pip/single/.devcontainer/devcontainer.json b/.devcontainer/pip/single/.devcontainer/devcontainer.json deleted file mode 100644 index a93626950..000000000 --- a/.devcontainer/pip/single/.devcontainer/devcontainer.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "pip" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/${localWorkspaceFolderBasename}/single}" - ], - - "updateContentCommand": [ - "/bin/bash", - "-c", - "mkdir -m 0755 -p ~/.config/clangd && cp -n /etc/skel/.config/clangd/config.yaml ~/.config/clangd/config.yaml" - ], - - "containerEnv": { - "PYTHONSAFEPATH": "true", - "PYTHONUNBUFFERED": "true", - "DEFAULT_VIRTUAL_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.local/${localWorkspaceFolderBasename}/single,target=/home/coder/.local,type=bind,consistency=consistent" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.devcontainer/pip/unified/.devcontainer/devcontainer.json b/.devcontainer/pip/unified/.devcontainer/devcontainer.json deleted file mode 100644 index dff5e2d7c..000000000 --- a/.devcontainer/pip/unified/.devcontainer/devcontainer.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shutdownAction": "stopContainer", - - "build": { - "context": "${localWorkspaceFolder}/.devcontainer", - "dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile", - "args": { - "CUDA": "12.0", - "LLVM": "16", - "PYTHON_PACKAGE_MANAGER": "pip" - } - }, - "hostRequirements": { - "gpu": true - }, - - "features": { - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils:23.8": {} - }, - - "overrideFeatureInstallOrder": [ - "ghcr.io/rapidsai/devcontainers/features/rapids-build-utils" - ], - - "initializeCommand": [ - "/bin/bash", "-c", "mkdir -m 0755 -p ${localWorkspaceFolder}/../.{aws,cache,config/pip,local/unified} ${localWorkspaceFolder}/../{rmm,kvikio,cudf,raft,cumlprims_mg,cuml,cugraph-ops,cugraph,cuspatial}" - ], - - "updateContentCommand": [ - "/bin/bash", - "-c", - "mkdir -m 0755 -p ~/.config/clangd && cp -n /etc/skel/.config/clangd/config.yaml ~/.config/clangd/config.yaml" - ], - - "containerEnv": { - "DEFAULT_VIRTUAL_ENV": "rapids" - }, - - "workspaceFolder": "/home/coder", - "workspaceMount": "source=${localWorkspaceFolder},target=/home/coder/${localWorkspaceFolderBasename},type=bind,consistency=consistent", - "mounts": [ - "source=${localWorkspaceFolder}/../rmm,target=/home/coder/rmm,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../kvikio,target=/home/coder/kvikio,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cudf,target=/home/coder/cudf,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../raft,target=/home/coder/raft,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cumlprims_mg,target=/home/coder/cumlprims_mg,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cuml,target=/home/coder/cuml,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cugraph-ops,target=/home/coder/cugraph-ops,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../cugraph,target=/home/coder/cugraph,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.aws,target=/home/coder/.aws,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.cache,target=/home/coder/.cache,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.config,target=/home/coder/.config,type=bind,consistency=consistent", - "source=${localWorkspaceFolder}/../.local/unified,target=/home/coder/.local,type=bind,consistency=consistent" - ], - - "customizations": { - "vscode": { - "extensions": [ - "llvm-vs-code-extensions.vscode-clangd", - "mutantdino.resourcemonitor", - "ms-vscode.cpptools", - "nvidia.nsight-vscode-edition", - "seaube.clangformat", - "tamasfe.even-better-toml" - ], - "settings": { - "C_Cpp.vcpkg.enabled": false, - "C_Cpp.formatting": "disabled", - "C_Cpp.autocomplete": "disabled", - "C_Cpp.errorSquiggles": "disabled", - "C_Cpp.intelliSenseEngine": "disabled", - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp.autoAddFileAssociations": false, - "clang-format.fallbackStyle": "none", - "files.trimFinalNewlines": true, - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "files.associations": { - "*.cu": "cuda-cpp", - "*.cuh": "cuda-cpp", - "**/libcudacxx/include/**/*": "cpp", - "**/libcudacxx-src/include/**/*": "cpp" - }, - "files.watcherExclude": { - "**/build/**": true, - "**/_skbuild/**": true, - "**/target/**": true - }, - "python.linting.flake8Enabled": true, - "[c]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "seaube.clangformat" - } - } - } - } -} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 213950723..7dbcbda29 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -23,6 +23,7 @@ jobs: - wheel-tests-cuspatial - wheel-build-cuproj - wheel-tests-cuproj + - devcontainer secrets: inherit uses: rapidsai/shared-action-workflows/.github/workflows/pr-builder.yaml@branch-23.10 checks: @@ -102,3 +103,11 @@ jobs: with: build_type: pull-request script: ci/test_wheel_cuproj.sh + devcontainer: + secrets: inherit + uses: rapidsai/shared-action-workflows/.github/workflows/build-in-devcontainer.yaml@branch-23.10 + with: + build_command: | + sccache -z; + build-all -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=ON --verbose; + sccache -s; diff --git a/.gitignore b/.gitignore index f080d2c06..a6627d3e7 100644 --- a/.gitignore +++ b/.gitignore @@ -155,3 +155,4 @@ notebooks/cu_taxi.zones.* # clang tooling compile_commands.json +.clangd/ diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 2637a503e..5c17f032a 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -65,7 +65,6 @@ sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_SHORT_TA # Need to distutils-normalize the original version NEXT_SHORT_TAG_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${NEXT_SHORT_TAG}'))") -NEXT_FULL_TAG_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${NEXT_FULL_TAG}'))") DEPENDENCIES=( cudf @@ -86,8 +85,8 @@ for DEP in "${DEPENDENCIES[@]}"; do done # Version in pyproject.toml -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG_PEP440}\"/g" python/cuspatial/pyproject.toml -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG_PEP440}\"/g" python/cuproj/pyproject.toml +sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cuspatial/pyproject.toml +sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cuproj/pyproject.toml # Dependency versions in dependencies.yaml sed_runner "/-cu[0-9]\{2\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*/g" dependencies.yaml @@ -106,3 +105,8 @@ sed_runner "s/cuspatial:[0-9]\+.[0-9]/cuspatial:${NEXT_SHORT_TAG}/g" README.md sed_runner "s/cuspatial=[0-9]\+.[0-9]/cuspatial=${NEXT_SHORT_TAG}/g" README.md sed_runner "s/notebooks:[0-9]\+.[0-9]/notebooks:${NEXT_SHORT_TAG}/g" README.md +# .devcontainer files +find .devcontainer/ -type f -name devcontainer.json -print0 | while IFS= read -r -d '' filename; do + sed_runner "s@rapidsai/devcontainers:[0-9.]*@rapidsai/devcontainers:${NEXT_FULL_TAG}@g" "${filename}" + sed_runner "s@rapidsai/devcontainers/features/rapids-build-utils:[0-9.]*@rapidsai/devcontainers/features/rapids-build-utils:${NEXT_SHORT_TAG_PEP440}@" +done diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 88b40d1cd..83ac445cb 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -7,6 +7,7 @@ channels: - nvidia dependencies: - c-compiler +- clang-tools=16.0.6 - cmake>=3.26.4 - cuda-version=11.8 - cudatoolkit diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index 312191cf9..f628e67b4 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -7,6 +7,7 @@ channels: - nvidia dependencies: - c-compiler +- clang-tools=16.0.6 - cmake>=3.26.4 - cuda-cudart-dev - cuda-cupti-dev diff --git a/cpp/.clangd b/cpp/.clangd index b066cf511..7c4fe036d 100644 --- a/cpp/.clangd +++ b/cpp/.clangd @@ -1,24 +1,32 @@ -# Apply this config conditionally to all C files +# https://clangd.llvm.org/config + +# Apply a config conditionally to all C files If: PathMatch: .*\.(c|h)$ -CompileFlags: - Compiler: /nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.8/envs/rapids/bin/gcc --- -# Apply this config conditionally to all C++ headers +# Apply a config conditionally to all C++ files If: - PathMatch: .*\.(c|h)pp$ -CompileFlags: - Compiler: /nvme/0/vyasr/rapids/compose/etc/conda/cuda_11.8/envs/rapids/bin/g++ + PathMatch: .*\.(c|h)pp --- -# Apply this config conditionally to all CUDA headers +# Apply a config conditionally to all CUDA files If: - PathMatch: .*\.cuh?$ + PathMatch: .*\.cuh? CompileFlags: - Compiler: /usr/local/cuda/bin/nvcc + Add: + - "-x" + - "cuda" + # No error on unknown CUDA versions + - "-Wno-unknown-cuda-version" + # Allow variadic CUDA functions + - "-Xclang=-fcuda-allow-variadic-functions" +Diagnostics: + Suppress: + - "variadic_device_fn" + - "attributes_not_allowed" --- @@ -27,24 +35,31 @@ CompileFlags: Add: # report all errors - "-ferror-limit=0" + - "-fmacro-backtrace-limit=0" + - "-ftemplate-backtrace-limit=0" + # Skip the CUDA version check + - "--no-cuda-version-check" Remove: - # strip CUDA fatbin args - - "-Xfatbin*" - # strip CUDA arch flags + # remove gcc's -fcoroutines + - -fcoroutines + # remove nvc++ flags unknown to clang + - "-gpu=*" + - "-stdpar*" + # remove nvcc flags unknown to clang - "-arch*" - "-gencode*" - "--generate-code*" - # strip CUDA flags unknown to clang + - "-ccbin*" + - "-t=*" + - "--threads*" + - "-Xptxas*" + - "-Xcudafe*" + - "-Xfatbin*" + - "-Xcompiler*" + - "--diag-suppress*" + - "--diag_suppress*" + - "--compiler-options*" - "--expt-extended-lambda" - "--expt-relaxed-constexpr" - "-forward-unknown-to-host-compiler" - "-Werror=cross-execution-space-call" -Hover: - ShowAKA: No -InlayHints: - Enabled: No -Diagnostics: - Suppress: - - "variadic_device_fn" - - "attributes_not_allowed" - - "-Wdeprecated-declarations" diff --git a/cpp/cuproj/CMakeLists.txt b/cpp/cuproj/CMakeLists.txt index 2f4dadf8a..6d6df5d33 100644 --- a/cpp/cuproj/CMakeLists.txt +++ b/cpp/cuproj/CMakeLists.txt @@ -91,6 +91,8 @@ include(cmake/modules/ConfigureCUDA.cmake) # add third party dependencies using CPM rapids_cpm_init() +include(cmake/thirdparty/get_rmm.cmake) + # find or install GoogleTest and Proj if (CUPROJ_BUILD_TESTS) include(cmake/thirdparty/get_gtest.cmake) @@ -103,6 +105,8 @@ endif() add_library(cuproj INTERFACE) add_library(cuproj::cuproj ALIAS cuproj) +target_link_libraries(cuproj INTERFACE rmm::rmm) + set_target_properties(cuproj PROPERTIES BUILD_RPATH "\$ORIGIN" INSTALL_RPATH "\$ORIGIN" diff --git a/dependencies.yaml b/dependencies.yaml index b57f3c2e3..eb564f809 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -12,8 +12,11 @@ files: - develop - docs - py_version + - depends_on_rmm + - depends_on_cudf + - depends_on_cuml + - depends_on_cupy - run_python_cuspatial - - run_python_cuproj - test_python_cuspatial - test_python_cuproj - notebooks @@ -32,6 +35,7 @@ files: output: none includes: - cudatoolkit + - depends_on_cuml - notebooks - py_version checks: @@ -51,6 +55,8 @@ files: extras: table: build-system includes: + - depends_on_rmm + - depends_on_cudf - build_cpp - build_python - build_wheels @@ -60,6 +66,8 @@ files: extras: table: project includes: + - depends_on_rmm + - depends_on_cudf - run_python_cuspatial py_test_cuspatial: output: [pyproject] @@ -75,6 +83,7 @@ files: extras: table: build-system includes: + - depends_on_rmm - build_cpp_cuproj - build_python_cuproj - build_wheels @@ -84,7 +93,8 @@ files: extras: table: project includes: - - run_python_cuproj + - depends_on_rmm + - depends_on_cupy py_test_cuproj: output: [pyproject] pyproject_dir: python/cuproj @@ -198,15 +208,6 @@ dependencies: - cython>=3.0.0 - scikit-build>=0.13.1 - setuptools - - output_types: conda - packages: &build_python_packages_conda - - &cudf_conda cudf==23.10.* - - &rmm_conda rmm==23.10.* - - output_types: requirements - packages: - # pip recognizes the index as a global option for the requirements.txt file - # This index is needed for cudf and rmm. - - --extra-index-url=https://pypi.nvidia.com specific: - output_types: conda matrices: @@ -220,35 +221,13 @@ dependencies: packages: - *gcc_aarch64 - *sysroot_aarch64 - - output_types: [requirements, pyproject] - matrices: - - matrix: {cuda: "12.0"} - packages: - - cudf-cu12==23.10.* - - rmm-cu12==23.10.* - - matrix: {cuda: "11.8"} - packages: &build_python_packages_cu11 - - &cudf_cu11 cudf-cu11==23.10.* - - &rmm_cu11 rmm-cu11==23.10.* - - {matrix: {cuda: "11.5"}, packages: *build_python_packages_cu11} - - {matrix: {cuda: "11.4"}, packages: *build_python_packages_cu11} - - {matrix: {cuda: "11.2"}, packages: *build_python_packages_cu11} - - {matrix: null, packages: [*cudf_conda, *rmm_conda] } build_python_cuproj: common: - output_types: [conda, requirements, pyproject] packages: - - cython>=0.29,<0.30 + - cython>=3.0.0 - scikit-build>=0.13.1 - setuptools - - output_types: conda - packages: - - *rmm_conda - - output_types: requirements - packages: - # pip recognizes the index as a global option for the requirements.txt file - # This index is needed for cudf and rmm. - - --extra-index-url=https://pypi.nvidia.com specific: - output_types: conda matrices: @@ -262,18 +241,6 @@ dependencies: packages: - *gcc_aarch64 - *sysroot_aarch64 - - output_types: [requirements, pyproject] - matrices: - - matrix: {cuda: "12.0"} - packages: - - rmm-cu12==23.10.* - - matrix: {cuda: "11.8"} - packages: - - *rmm_cu11 - - {matrix: {cuda: "11.5"}, packages: *build_python_packages_cu11} - - {matrix: {cuda: "11.4"}, packages: *build_python_packages_cu11} - - {matrix: {cuda: "11.2"}, packages: *build_python_packages_cu11} - - {matrix: null, packages: [*rmm_conda] } build_wheels: common: - output_types: [requirements, pyproject] @@ -316,6 +283,9 @@ dependencies: - output_types: [conda, requirements] packages: - pre-commit + - output_types: conda + packages: + - clang-tools=16.0.6 docs: common: - output_types: [conda] @@ -339,22 +309,9 @@ dependencies: - pydeck - shapely - scikit-image - - output_types: conda - packages: - - &cuml_conda cuml==23.10.* - specific: - output_types: [requirements, pyproject] - matrices: - - {matrix: null, packages: [*cuml_conda]} - - matrix: {cuda: "12.0"} - packages: - - cuml-cu12==23.10.* - - matrix: {cuda: "11.8"} - packages: ¬ebooks_packages_cu11 - - &cuml_cu11 cuml-cu11==23.10.* - - {matrix: {cuda: "11.5"}, packages: *notebooks_packages_cu11} - - {matrix: {cuda: "11.4"}, packages: *notebooks_packages_cu11} - - {matrix: {cuda: "11.2"}, packages: *notebooks_packages_cu11} + packages: + - pyproj py_version: specific: - output_types: conda @@ -375,70 +332,135 @@ dependencies: - output_types: [conda, requirements, pyproject] packages: - geopandas>=0.11.0 + test_python_cuspatial: + common: + - output_types: [conda, requirements, pyproject] + packages: + - pytest + - pytest-cov + - pytest-xdist + test_python_cuproj: + common: + - output_types: [conda, requirements, pyproject] + packages: + - pytest + - pytest-cov + - pytest-xdist + - geopandas>=0.11.0 + - output_types: [requirements, pyproject] + packages: + - pyproj + + depends_on_rmm: + common: - output_types: conda packages: - - *cudf_conda - - *rmm_conda + - &rmm_conda rmm==23.10.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file - # This index is needed for cudf and rmm. - --extra-index-url=https://pypi.nvidia.com specific: - output_types: [requirements, pyproject] matrices: - - matrix: {cuda: "12.0"} - packages: - - cudf-cu12==23.10.* + - matrix: {cuda: "12.2"} + packages: &rmm_packages_pip_cu12 - rmm-cu12==23.10.* + - {matrix: {cuda: "12.1"}, packages: *rmm_packages_pip_cu12} + - {matrix: {cuda: "12.0"}, packages: *rmm_packages_pip_cu12} - matrix: {cuda: "11.8"} - packages: &run_python_cuspatial_packages_cu11 - - cudf-cu11==23.10.* + packages: &rmm_packages_pip_cu11 - rmm-cu11==23.10.* - - {matrix: {cuda: "11.5"}, packages: *run_python_cuspatial_packages_cu11} - - {matrix: {cuda: "11.4"}, packages: *run_python_cuspatial_packages_cu11} - - {matrix: {cuda: "11.2"}, packages: *run_python_cuspatial_packages_cu11} - - {matrix: null, packages: [*cudf_conda, *rmm_conda]} - run_python_cuproj: + - {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} + - {matrix: null, packages: [*rmm_conda]} + + depends_on_cudf: common: - output_types: conda packages: - - *rmm_conda - - cupy>=12.0.0 + - &cudf_conda cudf==23.10.* - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file - # This index is needed for rmm - - --extra-index-url=https://pypi.ngc.nvidia.com - - &cupy_pip cupy-cuda11x>=12.0.0 - - output_types: pyproject - packages: - - *cupy_pip + - --extra-index-url=https://pypi.nvidia.com specific: - output_types: [requirements, pyproject] matrices: - - matrix: {cuda: "12.0"} - packages: - - rmm-cu12==23.10.* + - matrix: {cuda: "12.2"} + packages: &cudf_packages_pip_cu12 + - cudf-cu12==23.10.* + - {matrix: {cuda: "12.1"}, packages: *cudf_packages_pip_cu12} + - {matrix: {cuda: "12.0"}, packages: *cudf_packages_pip_cu12} - matrix: {cuda: "11.8"} - packages: &run_python_cuproj_packages_cu11 - - rmm-cu11==23.10.* - - {matrix: {cuda: "11.5"}, packages: *run_python_cuproj_packages_cu11} - - {matrix: {cuda: "11.4"}, packages: *run_python_cuproj_packages_cu11} - - {matrix: {cuda: "11.2"}, packages: *run_python_cuproj_packages_cu11} - - {matrix: null, packages: [*rmm_conda]} - test_python_cuspatial: + packages: &cudf_packages_pip_cu11 + - cudf-cu11==23.10.* + - {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} + - {matrix: null, packages: [*cudf_conda]} + + depends_on_cuml: common: - - output_types: [conda, requirements, pyproject] + - output_types: conda packages: - - pytest - - pytest-cov - - pytest-xdist - test_python_cuproj: + - &cuml_conda cuml==23.10.* + - output_types: requirements + packages: + # pip recognizes the index as a global option for the requirements.txt file + - --extra-index-url=https://pypi.nvidia.com + specific: + - output_types: [requirements, pyproject] + matrices: + - matrix: {cuda: "12.2"} + packages: &cuml_packages_pip_cu12 + - cuml-cu12==23.10.* + - {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.10.* + - {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} + - {matrix: null, packages: [*cuml_conda]} + + depends_on_cupy: common: - - output_types: [conda, requirements, pyproject] + - output_types: conda packages: - - pytest - - pytest-cov - - pytest-xdist - - geopandas>=0.11.0 + - cupy>=12.0.0 + specific: + - output_types: [requirements, pyproject] + matrices: + # All CUDA 12 + x86_64 versions + - matrix: {cuda: "12.2", arch: x86_64} + packages: &cupy_packages_cu12_x86_64 + - cupy-cuda12x>=12.0.0 + - {matrix: {cuda: "12.1", arch: x86_64}, packages: *cupy_packages_cu12_x86_64} + - {matrix: {cuda: "12.0", arch: x86_64}, packages: *cupy_packages_cu12_x86_64} + + # All CUDA 12 + aarch64 versions + - matrix: {cuda: "12.2", arch: aarch64} + packages: &cupy_packages_cu12_aarch64 + - cupy-cuda12x -f https://pip.cupy.dev/aarch64 # TODO: Verify that this works. + - {matrix: {cuda: "12.1", arch: aarch64}, packages: *cupy_packages_cu12_aarch64} + - {matrix: {cuda: "12.0", arch: aarch64}, packages: *cupy_packages_cu12_aarch64} + + # All CUDA 11 + x86_64 versions + - matrix: {cuda: "11.8", arch: x86_64} + packages: &cupy_packages_cu11_x86_64 + - cupy-cuda11x>=12.0.0 + - {matrix: {cuda: "11.5", arch: x86_64}, packages: *cupy_packages_cu11_x86_64} + - {matrix: {cuda: "11.4", arch: x86_64}, packages: *cupy_packages_cu11_x86_64} + - {matrix: {cuda: "11.2", arch: x86_64}, packages: *cupy_packages_cu11_x86_64} + + # All CUDA 11 + aarch64 versions + - matrix: {cuda: "11.8", arch: aarch64} + packages: &cupy_packages_cu11_aarch64 + - cupy-cuda11x -f https://pip.cupy.dev/aarch64 # TODO: Verify that this works. + - {matrix: {cuda: "11.5", arch: aarch64}, packages: *cupy_packages_cu11_aarch64} + - {matrix: {cuda: "11.4", arch: aarch64}, packages: *cupy_packages_cu11_aarch64} + - {matrix: {cuda: "11.2", arch: aarch64}, packages: *cupy_packages_cu11_aarch64} + - {matrix: null, packages: [cupy-cuda11x>=12.0.0]} diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index 7a25d921a..525c9fda6 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -16,7 +16,7 @@ build-backend = "setuptools.build_meta" requires = [ "cmake>=3.26.4", - "cython>=0.29,<0.30", + "cython>=3.0.0", "ninja", "rmm==23.10.*", "scikit-build>=0.13.1", @@ -49,6 +49,7 @@ classifiers = [ [project.optional-dependencies] test = [ "geopandas>=0.11.0", + "pyproj", "pytest", "pytest-cov", "pytest-xdist", From 6ebb3b75e368610ebe15e1ffcc5135154391944c Mon Sep 17 00:00:00 2001 From: Paul Taylor <178183+trxcllnt@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:34:30 -0700 Subject: [PATCH 16/21] fix update-version.sh (#1272) Fixes copy/paste errors in https://github.com/rapidsai/cuspatial/pull/1263. Authors: - Paul Taylor (https://github.com/trxcllnt) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) URL: https://github.com/rapidsai/cuspatial/pull/1272 --- ci/release/update-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 5c17f032a..64c15b274 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -107,6 +107,6 @@ sed_runner "s/notebooks:[0-9]\+.[0-9]/notebooks:${NEXT_SHORT_TAG}/g" README.md # .devcontainer files find .devcontainer/ -type f -name devcontainer.json -print0 | while IFS= read -r -d '' filename; do - sed_runner "s@rapidsai/devcontainers:[0-9.]*@rapidsai/devcontainers:${NEXT_FULL_TAG}@g" "${filename}" - sed_runner "s@rapidsai/devcontainers/features/rapids-build-utils:[0-9.]*@rapidsai/devcontainers/features/rapids-build-utils:${NEXT_SHORT_TAG_PEP440}@" + sed_runner "s@rapidsai/devcontainers:[0-9.]*@rapidsai/devcontainers:${NEXT_SHORT_TAG}@g" "${filename}" + sed_runner "s@rapidsai/devcontainers/features/rapids-build-utils:[0-9.]*@rapidsai/devcontainers/features/rapids-build-utils:${NEXT_SHORT_TAG_PEP440}@" "${filename}" done From 73e2df7baff44ca06fe9b55d3ab0bf072d5dbb6c Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Mon, 2 Oct 2023 01:22:19 -0500 Subject: [PATCH 17/21] Add binary_predicates.ipynb workflow and test data to package. (#1258) A missing package in this notebook is required in order for it to be usable with 23.08. Authors: - H. Thomson Comer (https://github.com/thomcom) Approvers: - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cuspatial/pull/1258 --- .../cuspatial/cuspatial/testing/__init__.py | 0 .../cuspatial/testing/test_geometries.py | 580 +++++++++++++++++ .../tests/binpreds/binpred_test_dispatch.py | 588 +----------------- .../test_binpred_cartesian_dispatch_list.py | 8 +- .../test_binpred_each_dispatch_list.py | 8 +- 5 files changed, 597 insertions(+), 587 deletions(-) create mode 100644 python/cuspatial/cuspatial/testing/__init__.py create mode 100644 python/cuspatial/cuspatial/testing/test_geometries.py diff --git a/python/cuspatial/cuspatial/testing/__init__.py b/python/cuspatial/cuspatial/testing/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/python/cuspatial/cuspatial/testing/test_geometries.py b/python/cuspatial/cuspatial/testing/test_geometries.py new file mode 100644 index 000000000..c4f934a22 --- /dev/null +++ b/python/cuspatial/cuspatial/testing/test_geometries.py @@ -0,0 +1,580 @@ +# Copyright (c) 2023, NVIDIA CORPORATION. +from shapely.geometry import LineString, Point, Polygon + +"""The fundamental set of tests. This section is dispatched based +on the feature type. Each feature pairing has a specific set of +comparisons that need to be performed to cover the entire test +space. This section contains specific feature representations +that cover all possible geometric combinations.""" + + +point_polygon = Polygon([(0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0)]) +features = { + "point-point-disjoint": ( + """Two points apart.""", + Point(0.0, 0.0), + Point(1.0, 0.0), + ), + "point-point-equal": ( + """Two points together.""", + Point(0.0, 0.0), + Point(0.0, 0.0), + ), + "point-linestring-disjoint": ( + """Point and linestring are disjoint.""", + Point(0.0, 0.0), + LineString([(1.0, 0.0), (2.0, 0.0)]), + ), + "point-linestring-point": ( + """Point and linestring share a point.""", + Point(0.0, 0.0), + LineString([(0.0, 0.0), (2.0, 0.0)]), + ), + "point-linestring-edge": ( + """Point and linestring intersect.""", + Point(0.5, 0.0), + LineString([(0.0, 0.0), (1.0, 0.0)]), + ), + "point-polygon-disjoint": ( + """Point and polygon are disjoint.""", + Point(-0.5, 0.5), + point_polygon, + ), + "point-polygon-point": ( + """Point and polygon share a point.""", + Point(0.0, 0.0), + point_polygon, + ), + "point-polygon-edge": ( + """Point and polygon intersect.""", + Point(0.5, 0.0), + point_polygon, + ), + "point-polygon-in": ( + """Point is in polygon interior.""", + Point(0.5, 0.5), + point_polygon, + ), + "linestring-linestring-disjoint": ( + """ + x---x + + x---x + """, + LineString([(0.0, 0.0), (1.0, 0.0)]), + LineString([(0.0, 1.0), (1.0, 1.0)]), + ), + "linestring-linestring-same": ( + """ + x---x + """, + LineString([(0.0, 0.0), (1.0, 0.0)]), + LineString([(0.0, 0.0), (1.0, 0.0)]), + ), + "linestring-linestring-covers": ( + """ + x + x + / + x + x + """, + LineString([(0.0, 0.0), (1.0, 1.0)]), + LineString([(0.25, 0.25), (0.5, 0.5)]), + ), + "linestring-linestring-touches": ( + """ + x + | + | + | + x---x + """, + LineString([(0.0, 0.0), (0.0, 1.0)]), + LineString([(0.0, 0.0), (1.0, 0.0)]), + ), + "linestring-linestring-touch-interior": ( + """ + x x + | / + | / + |/ + x---x + """, + LineString([(0.0, 1.0), (0.0, 0.0), (1.0, 0.0)]), + LineString([(0.0, 0.0), (1.0, 1.0)]), + ), + "linestring-linestring-touch-edge": ( + """ + x + | + | + | + x-x-x + """, + LineString([(0.0, 0.0), (1.0, 0.0)]), + LineString([(0.5, 0.0), (0.5, 1.0)]), + ), + "linestring-linestring-touch-edge-twice": ( + """ + x + x + / \\ + x---x + x + """, + LineString([(0.0, 0.0), (1.0, 1.0), (2.0, 2.0)]), + LineString([(0.25, 0.25), (1.0, 0.0), (0.5, 0.5)]), + ), + "linestring-linestring-crosses": ( + """ + x + | + x-|-x + | + x + """, + LineString([(0.5, 0.0), (0.5, 1.0)]), + LineString([(0.0, 0.5), (1.0, 0.5)]), + ), + "linestring-linestring-touch-and-cross": ( + """ + x + | + x + |\\ + x---x + x + """, + LineString([(0.0, 0.0), (1.0, 1.0)]), + LineString([(0.5, 0.5), (1.0, 0.1), (-1.0, 0.1)]), + ), + "linestring-polygon-disjoint": ( + """ + point_polygon above is drawn as + ----- + | | + | | + | | + ----- + and the corresponding linestring is drawn as + x---x + or + x + | + | + | + x + """ + """ + x ----- + | | | + | | | + | | | + x ----- + """, + LineString([(-0.5, 0.0), (-0.5, 1.0)]), + point_polygon, + ), + "linestring-polygon-touch-point": ( + """ + x---x---- + | | + | | + | | + ----- + """, + LineString([(-1.0, 0.0), (0.0, 0.0)]), + point_polygon, + ), + "linestring-polygon-touch-edge": ( + """ + ----- + | | + x---x | + | | + ----- + """, + LineString([(-1.0, 0.5), (0.0, 0.5)]), + point_polygon, + ), + "linestring-polygon-overlap-edge": ( + """ + x---- + | | + | | + | | + x---- + """, + LineString([(0.0, 0.0), (0.0, 1.0)]), + point_polygon, + ), + "linestring-polygon-intersect-edge": ( + """ + ----- + | | + | | + | | + x---x-- + """, + LineString([(-0.5, 0.0), (0.5, 0.0)]), + point_polygon, + ), + "linestring-polygon-intersect-inner-edge": ( + """ + ----- + x | + | | + x | + ----- + + The linestring in this case is shorter than the corners of the polygon. + """, + LineString([(0.25, 0.0), (0.75, 0.0)]), + point_polygon, + ), + "linestring-polygon-point-interior": ( + """ + ----x + | /| + | / | + |/ | + x---- + """, + LineString([(0.0, 0.0), (1.0, 1.0)]), + point_polygon, + ), + "linestring-polygon-edge-interior": ( + """ + --x-- + | | | + | | | + | | | + --x-- + """, + LineString([(0.5, 0.0), (0.5, 1.0)]), + point_polygon, + ), + "linestring-polygon-in": ( + """ + ----- + | x | + | | | + | x | + ----- + """, + LineString([(0.5, 0.25), (0.5, 0.75)]), + point_polygon, + ), + "linestring-polygon-in-out": ( + """ + ----- + | | + | x | + | | | + --|-- + | + x + """, + LineString([(0.5, 0.5), (0.5, -0.5)]), + point_polygon, + ), + "linestring-polygon-crosses": ( + """ + x + --|-- + | | | + | | | + | | | + --|-- + x + """, + LineString([(0.5, 1.25), (0.5, -0.25)]), + point_polygon, + ), + "linestring-polygon-cross-concave-edge": ( + """ + x x x + |\\ | /| + | xx- | + | | | + ---x--- + """, + LineString([(0.5, 0.0), (0.5, 1.0)]), + Polygon([(0, 0), (0, 1), (0.3, 0.4), (1, 1), (1, 0)]), + ), + "linestring-polygon-half-in": ( + """ + ----- + | | + | x | + |/ \\| + xx-xx + """, + LineString( + [(0.0, 0.0), (0.25, 0.0), (0.5, 0.5), (0.75, 0.0), (1.0, 0.0)] + ), + point_polygon, + ), + "linestring-polygon-half-out": ( + """ + ----- + | | + | | + | | + xx-xx + \\/ + x + """, + LineString( + [(0.0, 0.0), (0.25, 0.0), (0.5, -0.5), (0.75, 0.0), (1.0, 0.0)] + ), + point_polygon, + ), + "linestring-polygon-two-edges": ( + """ + x---- + | | + | | + | | + x---x + """, + LineString([(0.0, 1.0), (0.0, 0.0), (1.0, 0.0)]), + point_polygon, + ), + "linestring-polygon-edge-to-interior": ( + """ + x---- + | | + | -x + |-/ | + x---- + """, + LineString([(0.0, 1.0), (0.0, 0.0), (1.0, 0.5)]), + point_polygon, + ), + "linestring-polygon-edge-cross-to-exterior": ( + """ + x------ + | | + | ---x + | --- | + x------ + """, + LineString([(0.0, 1.0), (0.0, 0.0), (1.5, 0.5)]), + point_polygon, + ), + "polygon-polygon-disjoint": ( + """ + Polygon polygon tests use a triangle for the lhs and a square for the rhs. + The triangle is drawn as + x---x + | / + | / + |/ + x + + The square is drawn as + + ----- + | | + | | + | | + ----- + """, + Polygon([(0.0, 2.0), (0.0, 3.0), (1.0, 3.0)]), + point_polygon, + ), + "polygon-polygon-touch-point": ( + """ + x---x + | / + | / + |/ + x---- + | | + | | + | | + ----- + """, + Polygon([(0.0, 1.0), (0.0, 2.0), (1.0, 2.0)]), + point_polygon, + ), + "polygon-polygon-touch-edge": ( + """ + x---x + | / + | / + |/ + -x--x + | | + | | + | | + ----- + """, + Polygon([(0.25, 1.0), (0.25, 2.0), (1.25, 2.0)]), + point_polygon, + ), + "polygon-polygon-overlap-edge": ( + """ + x + |\\ + | \\ + | \\ + x---x + | | + | | + | | + ----- + """, + Polygon([(0.0, 1.0), (0.0, 2.0), (1.0, 2.0)]), + point_polygon, + ), + "polygon-polygon-overlap-inside-edge": ( + """ + x + /| + x---x | + \\ / | + x | + / | + x-----x + """, + Polygon([(0, 0), (1, 0), (1, 1), (0, 0)]), + Polygon([(0.25, 0.25), (0.5, 0.5), (0, 0.5), (0.25, 0.25)]), + ), + "polygon-polygon-point-inside": ( + """ + x---x + | / + --|-/ + | |/| + | x | + | | + ----- + """, + Polygon([(0.5, 0.5), (0.5, 1.5), (1.5, 1.5)]), + point_polygon, + ), + "polygon-polygon-point-outside": ( + """ + x + -|\\-- + |x-x| + | | + | | + ----- + """, + Polygon([(0.25, 0.75), (0.25, 1.25), (0.75, 0.75)]), + point_polygon, + ), + "polygon-polygon-in-out-point": ( + """ + x + |\\ + --|-x + | |/| + | x | + | | + x---- + """, + Polygon([(0.5, 0.5), (0.5, 1.5), (1.0, 1.0)]), + point_polygon, + ), + "polygon-polygon-in-point-point": ( + """ + x---- + |\\ | + | x | + |/ | + x---- + """, + Polygon([(0.0, 0.0), (0.0, 1.0), (0.5, 0.5)]), + point_polygon, + ), + "polygon-polygon-contained": ( + """ + ----- + | x| + | /|| + |x-x| + ----- + """, + Polygon([(0.25, 0.25), (0.75, 0.75), (0.75, 0.25)]), + point_polygon, + ), + "polygon-polygon-same": ( + """ + x---x + | | + | | + | | + x---x + """, + point_polygon, + point_polygon, + ), +} + +point_point_dispatch_list = [ + "point-point-disjoint", + "point-point-equal", +] + +point_linestring_dispatch_list = [ + "point-linestring-disjoint", + "point-linestring-point", + "point-linestring-edge", +] + +point_polygon_dispatch_list = [ + "point-polygon-disjoint", + "point-polygon-point", + "point-polygon-edge", + "point-polygon-in", +] + +linestring_linestring_dispatch_list = [ + "linestring-linestring-disjoint", + "linestring-linestring-same", + "linestring-linestring-covers", + "linestring-linestring-touches", + "linestring-linestring-touch-interior", + "linestring-linestring-touch-edge", + "linestring-linestring-touch-edge-twice", + "linestring-linestring-crosses", + "linestring-linestring-touch-and-cross", +] + +linestring_polygon_dispatch_list = [ + "linestring-polygon-disjoint", + "linestring-polygon-touch-point", + "linestring-polygon-touch-edge", + "linestring-polygon-overlap-edge", + "linestring-polygon-intersect-edge", + "linestring-polygon-intersect-inner-edge", + "linestring-polygon-point-interior", + "linestring-polygon-edge-interior", + "linestring-polygon-in", + "linestring-polygon-crosses", + "linestring-polygon-cross-concave-edge", + "linestring-polygon-half-in", + "linestring-polygon-half-out", + "linestring-polygon-two-edges", + "linestring-polygon-edge-to-interior", + "linestring-polygon-edge-cross-to-exterior", +] + +polygon_polygon_dispatch_list = [ + "polygon-polygon-disjoint", + "polygon-polygon-touch-point", + "polygon-polygon-touch-edge", + "polygon-polygon-overlap-edge", + "polygon-polygon-overlap-inside-edge", + "polygon-polygon-point-inside", + "polygon-polygon-point-outside", + "polygon-polygon-in-out-point", + "polygon-polygon-in-point-point", + "polygon-polygon-contained", + "polygon-polygon-same", +] diff --git a/python/cuspatial/cuspatial/tests/binpreds/binpred_test_dispatch.py b/python/cuspatial/cuspatial/tests/binpreds/binpred_test_dispatch.py index 05b38d702..d9babbb79 100644 --- a/python/cuspatial/cuspatial/tests/binpreds/binpred_test_dispatch.py +++ b/python/cuspatial/cuspatial/tests/binpreds/binpred_test_dispatch.py @@ -4,6 +4,15 @@ from shapely.geometry import LineString, Point, Polygon import cuspatial +from cuspatial.testing.test_geometries import ( # noqa: F401 + features, + linestring_linestring_dispatch_list, + linestring_polygon_dispatch_list, + point_linestring_dispatch_list, + point_point_dispatch_list, + point_polygon_dispatch_list, + polygon_polygon_dispatch_list, +) """Test Dispatch""" @@ -35,585 +44,6 @@ def predicate(request): return request.param -"""The fundamental set of tests. This section is dispatched based -on the feature type. Each feature pairing has a specific set of -comparisons that need to be performed to cover the entire test -space. This section contains specific feature representations -that cover all possible geometric combinations.""" - - -point_polygon = Polygon([(0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0)]) -features = { - "point-point-disjoint": ( - """Two points apart.""", - Point(0.0, 0.0), - Point(1.0, 0.0), - ), - "point-point-equal": ( - """Two points together.""", - Point(0.0, 0.0), - Point(0.0, 0.0), - ), - "point-linestring-disjoint": ( - """Point and linestring are disjoint.""", - Point(0.0, 0.0), - LineString([(1.0, 0.0), (2.0, 0.0)]), - ), - "point-linestring-point": ( - """Point and linestring share a point.""", - Point(0.0, 0.0), - LineString([(0.0, 0.0), (2.0, 0.0)]), - ), - "point-linestring-edge": ( - """Point and linestring intersect.""", - Point(0.5, 0.0), - LineString([(0.0, 0.0), (1.0, 0.0)]), - ), - "point-polygon-disjoint": ( - """Point and polygon are disjoint.""", - Point(-0.5, 0.5), - point_polygon, - ), - "point-polygon-point": ( - """Point and polygon share a point.""", - Point(0.0, 0.0), - point_polygon, - ), - "point-polygon-edge": ( - """Point and polygon intersect.""", - Point(0.5, 0.0), - point_polygon, - ), - "point-polygon-in": ( - """Point is in polygon interior.""", - Point(0.5, 0.5), - point_polygon, - ), - "linestring-linestring-disjoint": ( - """ - x---x - - x---x - """, - LineString([(0.0, 0.0), (1.0, 0.0)]), - LineString([(0.0, 1.0), (1.0, 1.0)]), - ), - "linestring-linestring-same": ( - """ - x---x - """, - LineString([(0.0, 0.0), (1.0, 0.0)]), - LineString([(0.0, 0.0), (1.0, 0.0)]), - ), - "linestring-linestring-covers": ( - """ - x - x - / - x - x - """, - LineString([(0.0, 0.0), (1.0, 1.0)]), - LineString([(0.25, 0.25), (0.5, 0.5)]), - ), - "linestring-linestring-touches": ( - """ - x - | - | - | - x---x - """, - LineString([(0.0, 0.0), (0.0, 1.0)]), - LineString([(0.0, 0.0), (1.0, 0.0)]), - ), - "linestring-linestring-touch-interior": ( - """ - x x - | / - | / - |/ - x---x - """, - LineString([(0.0, 1.0), (0.0, 0.0), (1.0, 0.0)]), - LineString([(0.0, 0.0), (1.0, 1.0)]), - ), - "linestring-linestring-touch-edge": ( - """ - x - | - | - | - x-x-x - """, - LineString([(0.0, 0.0), (1.0, 0.0)]), - LineString([(0.5, 0.0), (0.5, 1.0)]), - ), - "linestring-linestring-touch-edge-twice": ( - """ - x - x - / \\ - x---x - x - """, - LineString([(0.0, 0.0), (1.0, 1.0), (2.0, 2.0)]), - LineString([(0.25, 0.25), (1.0, 0.0), (0.5, 0.5)]), - ), - "linestring-linestring-crosses": ( - """ - x - | - x-|-x - | - x - """, - LineString([(0.5, 0.0), (0.5, 1.0)]), - LineString([(0.0, 0.5), (1.0, 0.5)]), - ), - "linestring-linestring-touch-and-cross": ( - """ - x - | - x - |\\ - x---x - x - """, - LineString([(0.0, 0.0), (1.0, 1.0)]), - LineString([(0.5, 0.5), (1.0, 0.1), (-1.0, 0.1)]), - ), - "linestring-polygon-disjoint": ( - """ - point_polygon above is drawn as - ----- - | | - | | - | | - ----- - and the corresponding linestring is drawn as - x---x - or - x - | - | - | - x - """ - """ - x ----- - | | | - | | | - | | | - x ----- - """, - LineString([(-0.5, 0.0), (-0.5, 1.0)]), - point_polygon, - ), - "linestring-polygon-touch-point": ( - """ - x---x---- - | | - | | - | | - ----- - """, - LineString([(-1.0, 0.0), (0.0, 0.0)]), - point_polygon, - ), - "linestring-polygon-touch-edge": ( - """ - ----- - | | - x---x | - | | - ----- - """, - LineString([(-1.0, 0.5), (0.0, 0.5)]), - point_polygon, - ), - "linestring-polygon-overlap-edge": ( - """ - x---- - | | - | | - | | - x---- - """, - LineString([(0.0, 0.0), (0.0, 1.0)]), - point_polygon, - ), - "linestring-polygon-intersect-edge": ( - """ - ----- - | | - | | - | | - x---x-- - """, - LineString([(-0.5, 0.0), (0.5, 0.0)]), - point_polygon, - ), - "linestring-polygon-intersect-inner-edge": ( - """ - ----- - x | - | | - x | - ----- - - The linestring in this case is shorter than the corners of the polygon. - """, - LineString([(0.25, 0.0), (0.75, 0.0)]), - point_polygon, - ), - "linestring-polygon-point-interior": ( - """ - ----x - | /| - | / | - |/ | - x---- - """, - LineString([(0.0, 0.0), (1.0, 1.0)]), - point_polygon, - ), - "linestring-polygon-edge-interior": ( - """ - --x-- - | | | - | | | - | | | - --x-- - """, - LineString([(0.5, 0.0), (0.5, 1.0)]), - point_polygon, - ), - "linestring-polygon-in": ( - """ - ----- - | x | - | | | - | x | - ----- - """, - LineString([(0.5, 0.25), (0.5, 0.75)]), - point_polygon, - ), - "linestring-polygon-in-out": ( - """ - ----- - | | - | x | - | | | - --|-- - | - x - """, - LineString([(0.5, 0.5), (0.5, -0.5)]), - point_polygon, - ), - "linestring-polygon-crosses": ( - """ - x - --|-- - | | | - | | | - | | | - --|-- - x - """, - LineString([(0.5, 1.25), (0.5, -0.25)]), - point_polygon, - ), - "linestring-polygon-cross-concave-edge": ( - """ - x x x - |\\ | /| - | xx- | - | | | - ---x--- - """, - LineString([(0.5, 0.0), (0.5, 1.0)]), - Polygon([(0, 0), (0, 1), (0.3, 0.4), (1, 1), (1, 0)]), - ), - "linestring-polygon-half-in": ( - """ - ----- - | | - | x | - |/ \\| - xx-xx - """, - LineString( - [(0.0, 0.0), (0.25, 0.0), (0.5, 0.5), (0.75, 0.0), (1.0, 0.0)] - ), - point_polygon, - ), - "linestring-polygon-half-out": ( - """ - ----- - | | - | | - | | - xx-xx - \\/ - x - """, - LineString( - [(0.0, 0.0), (0.25, 0.0), (0.5, -0.5), (0.75, 0.0), (1.0, 0.0)] - ), - point_polygon, - ), - "linestring-polygon-two-edges": ( - """ - x---- - | | - | | - | | - x---x - """, - LineString([(0.0, 1.0), (0.0, 0.0), (1.0, 0.0)]), - point_polygon, - ), - "linestring-polygon-edge-to-interior": ( - """ - x---- - | | - | -x - |-/ | - x---- - """, - LineString([(0.0, 1.0), (0.0, 0.0), (1.0, 0.5)]), - point_polygon, - ), - "linestring-polygon-edge-cross-to-exterior": ( - """ - x------ - | | - | ---x - | --- | - x------ - """, - LineString([(0.0, 1.0), (0.0, 0.0), (1.5, 0.5)]), - point_polygon, - ), - "polygon-polygon-disjoint": ( - """ - Polygon polygon tests use a triangle for the lhs and a square for the rhs. - The triangle is drawn as - x---x - | / - | / - |/ - x - - The square is drawn as - - ----- - | | - | | - | | - ----- - """, - Polygon([(0.0, 2.0), (0.0, 3.0), (1.0, 3.0)]), - point_polygon, - ), - "polygon-polygon-touch-point": ( - """ - x---x - | / - | / - |/ - x---- - | | - | | - | | - ----- - """, - Polygon([(0.0, 1.0), (0.0, 2.0), (1.0, 2.0)]), - point_polygon, - ), - "polygon-polygon-touch-edge": ( - """ - x---x - | / - | / - |/ - -x--x - | | - | | - | | - ----- - """, - Polygon([(0.25, 1.0), (0.25, 2.0), (1.25, 2.0)]), - point_polygon, - ), - "polygon-polygon-overlap-edge": ( - """ - x - |\\ - | \\ - | \\ - x---x - | | - | | - | | - ----- - """, - Polygon([(0.0, 1.0), (0.0, 2.0), (1.0, 2.0)]), - point_polygon, - ), - "polygon-polygon-overlap-inside-edge": ( - """ - x - /| - x---x | - \\ / | - x | - / | - x-----x - """, - Polygon([(0, 0), (1, 0), (1, 1), (0, 0)]), - Polygon([(0.25, 0.25), (0.5, 0.5), (0, 0.5), (0.25, 0.25)]), - ), - "polygon-polygon-point-inside": ( - """ - x---x - | / - --|-/ - | |/| - | x | - | | - ----- - """, - Polygon([(0.5, 0.5), (0.5, 1.5), (1.5, 1.5)]), - point_polygon, - ), - "polygon-polygon-point-outside": ( - """ - x - -|\\-- - |x-x| - | | - | | - ----- - """, - Polygon([(0.25, 0.75), (0.25, 1.25), (0.75, 0.75)]), - point_polygon, - ), - "polygon-polygon-in-out-point": ( - """ - x - |\\ - --|-x - | |/| - | x | - | | - x---- - """, - Polygon([(0.5, 0.5), (0.5, 1.5), (1.0, 1.0)]), - point_polygon, - ), - "polygon-polygon-in-point-point": ( - """ - x---- - |\\ | - | x | - |/ | - x---- - """, - Polygon([(0.0, 0.0), (0.0, 1.0), (0.5, 0.5)]), - point_polygon, - ), - "polygon-polygon-contained": ( - """ - ----- - | x| - | /|| - |x-x| - ----- - """, - Polygon([(0.25, 0.25), (0.75, 0.75), (0.75, 0.25)]), - point_polygon, - ), - "polygon-polygon-same": ( - """ - x---x - | | - | | - | | - x---x - """, - point_polygon, - point_polygon, - ), -} - -point_point_dispatch_list = [ - "point-point-disjoint", - "point-point-equal", -] - -point_linestring_dispatch_list = [ - "point-linestring-disjoint", - "point-linestring-point", - "point-linestring-edge", -] - -point_polygon_dispatch_list = [ - "point-polygon-disjoint", - "point-polygon-point", - "point-polygon-edge", - "point-polygon-in", -] - -linestring_linestring_dispatch_list = [ - "linestring-linestring-disjoint", - "linestring-linestring-same", - "linestring-linestring-covers", - "linestring-linestring-touches", - "linestring-linestring-touch-interior", - "linestring-linestring-touch-edge", - "linestring-linestring-touch-edge-twice", - "linestring-linestring-crosses", - "linestring-linestring-touch-and-cross", -] - -linestring_polygon_dispatch_list = [ - "linestring-polygon-disjoint", - "linestring-polygon-touch-point", - "linestring-polygon-touch-edge", - "linestring-polygon-overlap-edge", - "linestring-polygon-intersect-edge", - "linestring-polygon-intersect-inner-edge", - "linestring-polygon-point-interior", - "linestring-polygon-edge-interior", - "linestring-polygon-in", - "linestring-polygon-crosses", - "linestring-polygon-cross-concave-edge", - "linestring-polygon-half-in", - "linestring-polygon-half-out", - "linestring-polygon-two-edges", - "linestring-polygon-edge-to-interior", - "linestring-polygon-edge-cross-to-exterior", -] - -polygon_polygon_dispatch_list = [ - "polygon-polygon-disjoint", - "polygon-polygon-touch-point", - "polygon-polygon-touch-edge", - "polygon-polygon-overlap-edge", - "polygon-polygon-overlap-inside-edge", - "polygon-polygon-point-inside", - "polygon-polygon-point-outside", - "polygon-polygon-in-out-point", - "polygon-polygon-in-point-point", - "polygon-polygon-contained", - "polygon-polygon-same", -] - - def object_dispatch(name_list): """Generate a list of test cases for a given set of test names.""" for name in name_list: diff --git a/python/cuspatial/cuspatial/tests/binpreds/test_binpred_cartesian_dispatch_list.py b/python/cuspatial/cuspatial/tests/binpreds/test_binpred_cartesian_dispatch_list.py index 772853ef2..d2a9a841f 100644 --- a/python/cuspatial/cuspatial/tests/binpreds/test_binpred_cartesian_dispatch_list.py +++ b/python/cuspatial/cuspatial/tests/binpreds/test_binpred_cartesian_dispatch_list.py @@ -2,7 +2,10 @@ import geopandas import numpy as np -from binpred_test_dispatch import ( # noqa: F401 +from binpred_test_dispatch import predicate # noqa: F401 + +import cuspatial +from cuspatial.testing.test_geometries import ( features, linestring_linestring_dispatch_list, linestring_polygon_dispatch_list, @@ -10,11 +13,8 @@ point_point_dispatch_list, point_polygon_dispatch_list, polygon_polygon_dispatch_list, - predicate, ) -import cuspatial - def sample_test_data(features, dispatch_list, size, lib=cuspatial): """Creates either a cuspatial or geopandas GeoSeries object using the diff --git a/python/cuspatial/cuspatial/tests/binpreds/test_binpred_each_dispatch_list.py b/python/cuspatial/cuspatial/tests/binpreds/test_binpred_each_dispatch_list.py index 9f7aa3219..f5ea64e3c 100644 --- a/python/cuspatial/cuspatial/tests/binpreds/test_binpred_each_dispatch_list.py +++ b/python/cuspatial/cuspatial/tests/binpreds/test_binpred_each_dispatch_list.py @@ -1,7 +1,10 @@ # Copyright (c) 2023, NVIDIA CORPORATION. import geopandas -from binpred_test_dispatch import ( # noqa: F401 +from binpred_test_dispatch import predicate # noqa: F401 + +import cuspatial +from cuspatial.testing.test_geometries import ( features, linestring_linestring_dispatch_list, linestring_polygon_dispatch_list, @@ -9,11 +12,8 @@ point_point_dispatch_list, point_polygon_dispatch_list, polygon_polygon_dispatch_list, - predicate, ) -import cuspatial - def sample_test_data(features, dispatch_list, lib=cuspatial): """Creates either a cuSpatial or geopandas GeoSeries object using the From 366183c857f104a8b5a2410f9c1437ada264a296 Mon Sep 17 00:00:00 2001 From: Michael Wang Date: Fri, 6 Oct 2023 04:42:47 +0800 Subject: [PATCH 18/21] Benchmark `GeoSeries.Distance` (#1277) closes #994 There are primitive benchmark results for `GeoSeries.distance` in #1231. This PR plans to add more benchmark coverage: TODO: - [x] point-point - [x] point-linestring - [x] point-polygon - [x] linestring-linestring - [x] linestring-polygon - [x] polygon-polygon - [x] Geometry complexity dimension - [x] Geometry spatial relationship dimension - [ ] Write the blog Authors: - Michael Wang (https://github.com/isVoid) Approvers: - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cuspatial/pull/1277 --- python/cuspatial/benchmarks/api/bench_api.py | 141 ++++++++++++++++++- python/cuspatial/benchmarks/conftest.py | 85 ++++++++++- 2 files changed, 222 insertions(+), 4 deletions(-) diff --git a/python/cuspatial/benchmarks/api/bench_api.py b/python/cuspatial/benchmarks/api/bench_api.py index ccc899f14..d93e45ebb 100644 --- a/python/cuspatial/benchmarks/api/bench_api.py +++ b/python/cuspatial/benchmarks/api/bench_api.py @@ -1,7 +1,7 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. - +# Copyright (c) 2022-2023, NVIDIA CORPORATION. import cupy import geopandas +import pytest import cudf @@ -125,7 +125,7 @@ def bench_haversine_distance(benchmark, gpu_dataframe): benchmark(cuspatial.haversine_distance, points_first, points_second) -def bench_pairwise_linestring_distance(benchmark, gpu_dataframe): +def bench_distance_pairwise_linestring(benchmark, gpu_dataframe): geometry = gpu_dataframe["geometry"] benchmark( cuspatial.pairwise_linestring_distance, @@ -293,3 +293,138 @@ def bench_point_in_polygon(benchmark, polygons): short_dataframe = polygons.iloc[0:31] geometry = short_dataframe["geometry"] benchmark(cuspatial.point_in_polygon, points, geometry) + + +# GeoSeries.distance benchmarking. + + +@pytest.mark.parametrize("align", [True, False]) +@pytest.mark.parametrize("n", [1e3, 1e4, 1e5, 1e6, 1e7]) +@pytest.mark.parametrize("lib", ["cuspatial", "geopandas"]) +def bench_distance_point(benchmark, lib, point_generator_device, n, align): + points = point_generator_device(int(n)) + other_points = point_generator_device(int(n)) + index = cudf.Index(cupy.arange(len(other_points) - 1, -1, -1)) + + if lib == "geopandas": + points = points.to_geopandas() + other_points = other_points.to_geopandas() + index = index.to_pandas() + + other_points.index = index + benchmark(points.distance, other_points, align) + + +@pytest.mark.parametrize("align", [True, False]) +@pytest.mark.parametrize("n", [1e3, 1e4, 1e5, 1e6, 1e7]) +@pytest.mark.parametrize("lib", ["cuspatial", "geopandas"]) +def bench_distance_point_linestring( + benchmark, + point_generator_device, + linestring_generator_device, + lib, + n, + align, +): + points = point_generator_device(int(n)) + linestrings = linestring_generator_device(int(n), 20) + index = cudf.Index(cupy.arange(len(linestrings) - 1, -1, -1)) + + if lib == "geopandas": + points = points.to_geopandas() + linestrings = linestrings.to_geopandas() + index = index.to_pandas() + + linestrings.index = index + benchmark(points.distance, linestrings, align) + + +@pytest.mark.parametrize("align", [True, False]) +@pytest.mark.parametrize("n", [1e3, 1e4, 1e5, 1e6, 1e7]) +@pytest.mark.parametrize("lib", ["cuspatial", "geopandas"]) +def bench_distance_point_polygon( + benchmark, point_generator_device, polygon_generator_device, lib, n, align +): + points = point_generator_device(int(n)) + polygons = polygon_generator_device(int(n), 38) + index = cudf.Index(cupy.arange(len(polygons) - 1, -1, -1)) + + if lib == "geopandas": + points = points.to_geopandas() + polygons = polygons.to_geopandas() + index = index.to_pandas() + + polygons.index = index + benchmark(points.distance, polygons, align) + + +@pytest.mark.parametrize("align", [True, False]) +@pytest.mark.parametrize("n", [1e3, 1e4, 1e5, 1e6, 1e7]) +@pytest.mark.parametrize("lib", ["cuspatial", "geopandas"]) +def bench_distance_linestring_linestring( + benchmark, linestring_generator_device, lib, n, align +): + lines1 = linestring_generator_device(int(n), 20) + lines2 = linestring_generator_device(int(n), 20) + index = cudf.Index(cupy.arange(len(lines1) - 1, -1, -1)) + + if lib == "geopandas": + lines1 = lines1.to_geopandas() + lines2 = lines2.to_geopandas() + index = index.to_pandas() + + lines1.index = index + benchmark(lines1.distance, lines2, align) + + +@pytest.mark.parametrize("align", [True, False]) +@pytest.mark.parametrize("n", [1e3, 1e4, 1e5, 1e6, 1e7]) +@pytest.mark.parametrize("lib", ["cuspatial", "geopandas"]) +@pytest.mark.parametrize( + "num_segments, num_sides", [(5, 5), (20, 38), (100, 100), (1000, 1000)] +) +def bench_distance_linestring_polygon( + benchmark, + lib, + linestring_generator_device, + polygon_generator_device, + n, + align, + num_segments, + num_sides, +): + lines = linestring_generator_device(int(n), num_segments) + polygons = polygon_generator_device(int(n), num_sides) + index = cudf.Index(cupy.arange(len(lines) - 1, -1, -1)) + + if lib == "geopandas": + lines = lines.to_geopandas() + polygons = polygons.to_geopandas() + index = index.to_pandas() + + lines.index = index + benchmark(lines.distance, polygons, align) + + +@pytest.mark.parametrize("align", [True, False]) +@pytest.mark.parametrize("n", [1e3, 1e4, 1e5, 1e6, 1e7]) +@pytest.mark.parametrize("lib", ["cuspatial", "geopandas"]) +@pytest.mark.parametrize("intersects", [True, False]) +def bench_distance_polygon( + benchmark, lib, polygon_generator_device, n, align, intersects +): + polygons1 = polygon_generator_device( + int(n), 38, radius=1.0, all_concentric=True + ) + polygons2 = polygon_generator_device( + int(n), 38, radius=0.5, all_concentric=True + ) + index = cudf.Index(cupy.arange(len(polygons1) - 1, -1, -1)) + + if lib == "geopandas": + polygons1 = polygons1.to_geopandas() + polygons2 = polygons2.to_geopandas() + index = index.to_pandas() + + polygons1.index = index + benchmark(polygons1.distance, polygons2, align) diff --git a/python/cuspatial/benchmarks/conftest.py b/python/cuspatial/benchmarks/conftest.py index f7a475444..5459663b5 100644 --- a/python/cuspatial/benchmarks/conftest.py +++ b/python/cuspatial/benchmarks/conftest.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2023, NVIDIA CORPORATION. """Defines pytest fixtures for all benchmarks. @@ -11,7 +11,9 @@ import geopandas as gpd import numpy as np import pandas as pd +import pytest import pytest_cases +from numba import cuda from shapely.geometry import ( LineString, MultiLineString, @@ -176,3 +178,84 @@ def shapefile(tmp_path, gpdf_100): p = d / "read_polygon_shapefile" gpdf_100.to_file(p) return p + + +@pytest.fixture() +def point_generator_device(): + def generator(n): + coords = cp.random.random(n * 2, dtype="f8") + return cuspatial.GeoSeries.from_points_xy(coords) + + return generator + + +# Numba kernel to generate a closed ring for each polygon +@cuda.jit +def generate_polygon_coordinates( + coordinate_array, centroids, radius, num_vertices +): + i = cuda.grid(1) + if i >= coordinate_array.size: + return + + point_idx = i // 2 + geometry_idx = point_idx // (num_vertices + 1) + + # The last index should wrap around to 0 + intra_point_idx = point_idx % (num_vertices + 1) + + centroid = centroids[geometry_idx] + angle = 2 * np.pi * intra_point_idx / num_vertices + + if i % 2 == 0: + coordinate_array[i] = centroid[0] + radius * np.cos(angle) + else: + coordinate_array[i] = centroid[1] + radius * np.sin(angle) + + +@pytest.fixture() +def polygon_generator_device(): + def generator(n, num_vertices, radius=1.0, all_concentric=False): + geometry_offsets = cp.arange(n + 1) + part_offsets = cp.arange(n + 1) + + # Each polygon has a closed ring, so we need to add an extra point + ring_offsets = cp.arange( + (n + 1) * (num_vertices + 1), step=(num_vertices + 1) + ) + num_points = int(ring_offsets[-1].get()) + + if not all_concentric: + centroids = cp.random.random((n, 2)) + else: + centroids = cp.zeros((n, 2)) + coords = cp.ndarray((num_points * 2,), dtype="f8") + generate_polygon_coordinates.forall(len(coords))( + coords, centroids, radius, num_vertices + ) + return cuspatial.GeoSeries.from_polygons_xy( + coords, ring_offsets, part_offsets, geometry_offsets + ) + + return generator + + +@pytest.fixture() +def linestring_generator_device(polygon_generator_device): + """Reusing polygon_generator_device, treating the rings of the + generated polygons as linestrings. This is to gain locality to + the generated linestrings. + """ + + def generator(n, segment_per_linestring): + polygons = polygon_generator_device( + n, segment_per_linestring, all_concentric=False + ) + + return cuspatial.GeoSeries.from_linestrings_xy( + polygons.polygons.xy, + polygons.polygons.ring_offset, + polygons.polygons.geometry_offset, + ) + + return generator From 6c9ac1105a9e7473dad26431952fac77549b3c1a Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Thu, 5 Oct 2023 16:03:26 -0500 Subject: [PATCH 19/21] Re-enable cuspatial tests and dependency. (#1253) A poorly understood cuproj->cuspatial dependency required that cuspatial be removed from cuproj's tests during the 23.08->23.10 merge rebase. This PR re-enables those tests. Authors: - H. Thomson Comer (https://github.com/thomcom) - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) Approvers: - Michael Wang (https://github.com/isVoid) - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) URL: https://github.com/rapidsai/cuspatial/pull/1253 --- ci/build_wheel.sh | 5 ++++ ci/test_wheel_cuproj.sh | 4 +++ dependencies.yaml | 30 ++++++++++++++++++-- python/cuproj/cuproj/tests/test_transform.py | 10 ++----- python/cuproj/pyproject.toml | 3 +- 5 files changed, 42 insertions(+), 10 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 6801137e3..ff997e245 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -34,11 +34,16 @@ if ! rapids-is-release-build; then alpha_spec=',>=0.0.0a0' fi +# Add CUDA version suffix to dependencies sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file} if [[ ${package_name} == "cuspatial" ]]; then sed -r -i "s/cudf==(.*)\"/cudf${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} fi +if [[ ${package_name} == "cuproj" ]]; then + sed -r -i "s/cuspatial==(.*)\"/cuspatial${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} +fi + if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} fi diff --git a/ci/test_wheel_cuproj.sh b/ci/test_wheel_cuproj.sh index 0f52ddeb5..e89d1c650 100755 --- a/ci/test_wheel_cuproj.sh +++ b/ci/test_wheel_cuproj.sh @@ -12,6 +12,10 @@ apt update DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libgdal-dev python -m pip install --no-binary fiona 'fiona>=1.8.19,<1.9' +# Download the cuspatial built in the previous step +RAPIDS_PY_WHEEL_NAME="cuspatial_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-cuspatial-dep +python -m pip install --no-deps ./local-cuspatial-dep/cuspatial*.whl + # echo to expand wildcard before adding `[extra]` requires for pip python -m pip install $(echo ./dist/cuproj*.whl)[test] diff --git a/dependencies.yaml b/dependencies.yaml index eb564f809..de80a97bc 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -103,6 +103,7 @@ files: key: test includes: - test_python_cuproj + - depends_on_cuspatial channels: - rapidsai @@ -311,7 +312,7 @@ dependencies: - scikit-image - output_types: [requirements, pyproject] packages: - - pyproj + - pyproj>=3.6.0,<3.7a0 py_version: specific: - output_types: conda @@ -349,7 +350,7 @@ dependencies: - geopandas>=0.11.0 - output_types: [requirements, pyproject] packages: - - pyproj + - pyproj>=3.6.0,<3.7a0 depends_on_rmm: common: @@ -426,6 +427,31 @@ dependencies: - {matrix: {cuda: "11.2"}, packages: *cuml_packages_pip_cu11} - {matrix: null, packages: [*cuml_conda]} + depends_on_cuspatial: + common: + - output_types: conda + packages: + - &cuspatial_conda cuspatial==23.10.* + - output_types: requirements + packages: + # pip recognizes the index as a global option for the requirements.txt file + - --extra-index-url=https://pypi.nvidia.com + specific: + - output_types: [requirements, pyproject] + matrices: + - matrix: {cuda: "12.2"} + packages: &cuspatial_packages_pip_cu12 + - cuspatial-cu12==23.10.* + - {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.10.* + - {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} + - {matrix: null, packages: [*cuspatial_conda]} + depends_on_cupy: common: - output_types: conda diff --git a/python/cuproj/cuproj/tests/test_transform.py b/python/cuproj/cuproj/tests/test_transform.py index a02e66fb2..d90d3297e 100644 --- a/python/cuproj/cuproj/tests/test_transform.py +++ b/python/cuproj/cuproj/tests/test_transform.py @@ -1,18 +1,16 @@ import cupy as cp -# import geopandas as gpd +import geopandas as gpd import numpy as np import pytest from cupy.testing import assert_allclose from pyproj import Transformer from pyproj.enums import TransformDirection +from shapely.geometry import Point -# import cuspatial +import cuspatial from cuproj import Transformer as cuTransformer -# from shapely.geometry import Point - - valid_crs_combos = [ (4326, 32756), (32756, 4326), @@ -178,7 +176,6 @@ def test_wgs84_to_utm_grid(dtype, container_type, dtype, container_type, min_corner, max_corner, crs_to) -""" Temporary fix to repair 23.08 -> 23.10 automerge # test __cuda_array_interface__ support by using cuspatial geoseries as input def test_geoseries_input(): s = gpd.GeoSeries( @@ -200,4 +197,3 @@ def test_geoseries_input(): assert_allclose(cuproj_x, pyproj_x) assert_allclose(cuproj_y, pyproj_y) -""" diff --git a/python/cuproj/pyproject.toml b/python/cuproj/pyproject.toml index 525c9fda6..719888df7 100644 --- a/python/cuproj/pyproject.toml +++ b/python/cuproj/pyproject.toml @@ -48,8 +48,9 @@ classifiers = [ [project.optional-dependencies] test = [ + "cuspatial==23.10.*", "geopandas>=0.11.0", - "pyproj", + "pyproj>=3.6.0,<3.7a0", "pytest", "pytest-cov", "pytest-xdist", From 32d908f8970626fe70f35de84f6fd023ef59362e Mon Sep 17 00:00:00 2001 From: Ray Douglass <3107146+raydouglass@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:01:05 -0400 Subject: [PATCH 20/21] Add `curl` for notebook testing (#1281) Adds `curl` as a notebook dependency which is used in two notebooks: `notebooks/nyc_taxi_years_correlation.ipynb` & `notebooks/ZipCodes_Stops_PiP_cuSpatial.ipynb` (https://github.com/search?q=repo%3Arapidsai%2Fcuspatial+curl&type=code). This is similar to https://github.com/rapidsai/cugraph/pull/3918 and will fix errors in the notebooks tests in `rapidsai/docker`. Authors: - Ray Douglass (https://github.com/raydouglass) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) --- conda/environments/all_cuda-118_arch-x86_64.yaml | 1 + conda/environments/all_cuda-120_arch-x86_64.yaml | 1 + dependencies.yaml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 83ac445cb..2dd10b7e6 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -14,6 +14,7 @@ dependencies: - cudf==23.10.* - cuml==23.10.* - cupy>=12.0.0 +- curl - cxx-compiler - cython>=3.0.0 - doxygen diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index f628e67b4..8153d1d2c 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -17,6 +17,7 @@ dependencies: - cudf==23.10.* - cuml==23.10.* - cupy>=12.0.0 +- curl - cxx-compiler - cython>=3.0.0 - doxygen diff --git a/dependencies.yaml b/dependencies.yaml index de80a97bc..5a8a9c14a 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -313,6 +313,9 @@ dependencies: - output_types: [requirements, pyproject] packages: - pyproj>=3.6.0,<3.7a0 + - output_types: [conda] + packages: + - curl py_version: specific: - output_types: conda From 38bad5c5d5d0740ca8e119ec000573a9211e2c46 Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Wed, 11 Oct 2023 10:28:42 -0400 Subject: [PATCH 21/21] Update Changelog [skip ci] --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd4eea2f..8efec71f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,35 @@ +# cuSpatial 23.10.00 (11 Oct 2023) + +## 🚨 Breaking Changes + +- Update to Cython 3.0.0 ([#1235](https://github.com/rapidsai/cuspatial/pull/1235)) [@vyasr](https://github.com/vyasr) + +## 🐛 Bug Fixes + +- Add `curl` for notebook testing ([#1281](https://github.com/rapidsai/cuspatial/pull/1281)) [@raydouglass](https://github.com/raydouglass) +- Use `conda mambabuild` not `mamba mambabuild` ([#1265](https://github.com/rapidsai/cuspatial/pull/1265)) [@bdice](https://github.com/bdice) +- Add back deleted conda env files ([#1261](https://github.com/rapidsai/cuspatial/pull/1261)) [@harrism](https://github.com/harrism) + +## 📖 Documentation + +- [REVIEW] Add cudf example code for haversine distance into 23.10 ([#1260](https://github.com/rapidsai/cuspatial/pull/1260)) [@taureandyernv](https://github.com/taureandyernv) + +## 🛠️ Improvements + +- Benchmark `GeoSeries.Distance` ([#1277](https://github.com/rapidsai/cuspatial/pull/1277)) [@isVoid](https://github.com/isVoid) +- fix update-version.sh ([#1272](https://github.com/rapidsai/cuspatial/pull/1272)) [@trxcllnt](https://github.com/trxcllnt) +- Update image names ([#1269](https://github.com/rapidsai/cuspatial/pull/1269)) [@AyodeAwe](https://github.com/AyodeAwe) +- Update to clang 16.0.6. ([#1266](https://github.com/rapidsai/cuspatial/pull/1266)) [@bdice](https://github.com/bdice) +- Simplify wheel build scripts and allow alphas of RAPIDS dependencies ([#1264](https://github.com/rapidsai/cuspatial/pull/1264)) [@divyegala](https://github.com/divyegala) +- Update devcontainers to align with other RAPIDS repositories ([#1263](https://github.com/rapidsai/cuspatial/pull/1263)) [@trxcllnt](https://github.com/trxcllnt) +- Use `copy-pr-bot` ([#1262](https://github.com/rapidsai/cuspatial/pull/1262)) [@ajschmidt8](https://github.com/ajschmidt8) +- Add binary_predicates.ipynb workflow and test data to package. ([#1258](https://github.com/rapidsai/cuspatial/pull/1258)) [@thomcom](https://github.com/thomcom) +- Re-enable cuspatial tests and dependency. ([#1253](https://github.com/rapidsai/cuspatial/pull/1253)) [@thomcom](https://github.com/thomcom) +- Fix 23.08 -> 23.10 automerge ([#1251](https://github.com/rapidsai/cuspatial/pull/1251)) [@thomcom](https://github.com/thomcom) +- Change path to trajectories_extracted.p to improve CI run consistency. ([#1247](https://github.com/rapidsai/cuspatial/pull/1247)) [@thomcom](https://github.com/thomcom) +- Update to Cython 3.0.0 ([#1235](https://github.com/rapidsai/cuspatial/pull/1235)) [@vyasr](https://github.com/vyasr) +- Branch 23.10 merge 23.08 ([#1230](https://github.com/rapidsai/cuspatial/pull/1230)) [@vyasr](https://github.com/vyasr) + # cuSpatial 23.08.00 (9 Aug 2023) ## 🚨 Breaking Changes