From 5095094ca79c19049225daec6a58aed00c807823 Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Mon, 20 May 2024 17:36:34 -0400 Subject: [PATCH 01/12] DOC v24.08 Updates [skip ci] --- .github/workflows/build.yaml | 12 ++++++------ .github/workflows/pr.yaml | 16 ++++++++-------- .github/workflows/test.yaml | 4 ++-- VERSION | 2 +- cucim.code-workspace | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 17a953717..f18070040 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -38,7 +38,7 @@ jobs: if: github.ref_type == 'branch' needs: [python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -51,7 +51,7 @@ jobs: python-build: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -60,7 +60,7 @@ jobs: upload-conda: needs: [cpp-build, python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -78,7 +78,7 @@ jobs: wheel-publish: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 7b686cd7f..5020f00c3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,32 +20,32 @@ jobs: - wheel-build - wheel-tests secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.08 checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.08 conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 with: build_type: pull-request conda-python-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 with: build_type: pull-request conda-python-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 with: build_type: pull-request docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -55,14 +55,14 @@ jobs: wheel-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 with: build_type: pull-request script: ci/build_wheel.sh wheel-tests: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 with: build_type: pull-request script: ci/test_wheel.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4724fea3e..7205ec4e4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: conda-python-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 with: build_type: nightly branch: ${{ inputs.branch }} @@ -24,7 +24,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.06 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/VERSION b/VERSION index 0bff6981a..ec8489fda 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -24.06.00 +24.08.00 diff --git a/cucim.code-workspace b/cucim.code-workspace index 099b210fe..82eafdcd1 100644 --- a/cucim.code-workspace +++ b/cucim.code-workspace @@ -33,7 +33,7 @@ "CUCIM_TESTDATA_FOLDER": "${workspaceDirectory}/test_data", // Add cuslide plugin's library path to LD_LIBRARY_PATH "LD_LIBRARY_PATH": "${workspaceDirectory}/build-debug/lib:${workspaceDirectory}/cpp/plugins/cucim.kit.cuslide/build-debug/lib:${workspaceDirectory}/temp/cuda/lib64:${os_env:LD_LIBRARY_PATH}", - "CUCIM_TEST_PLUGIN_PATH": "cucim.kit.cuslide@24.06.00.so" + "CUCIM_TEST_PLUGIN_PATH": "cucim.kit.cuslide@24.08.00.so" }, "cwd": "${workspaceDirectory}", "catch2": { @@ -226,7 +226,7 @@ }, { "name": "CUCIM_TEST_PLUGIN_PATH", - "value": "cucim.kit.cuslide@24.06.00.so" + "value": "cucim.kit.cuslide@24.08.00.so" } ], "console": "externalTerminal", @@ -254,7 +254,7 @@ }, { "name": "CUCIM_TEST_PLUGIN_PATH", - "value": "cucim.kit.cuslide@24.06.00.so" + "value": "cucim.kit.cuslide@24.08.00.so" } ], "console": "externalTerminal", @@ -286,7 +286,7 @@ }, { "name": "CUCIM_TEST_PLUGIN_PATH", - "value": "cucim.kit.cuslide@24.06.00.so" + "value": "cucim.kit.cuslide@24.08.00.so" } ], "console": "externalTerminal", From 4e35a649b8928a181b97feda05f1d1c29733a340 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 7 Jun 2024 14:55:52 -0500 Subject: [PATCH 02/12] Adopt CI/packaging codeowners (#739) --- .github/CODEOWNERS | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8bbb437b7..5d4b30faa 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,8 +9,14 @@ python/ @rapidsai/cucim-python-codeowners **/CMakeLists.txt @rapidsai/cucim-cmake-codeowners **/cmake/ @rapidsai/cucim-cmake-codeowners -#build/ops code owners -/.github/ @rapidsai/ops-codeowners -/ci/ @rapidsai/ops-codeowners -/conda/ @rapidsai/ops-codeowners -dependencies.yaml @rapidsai/ops-codeowners +#CI code owners +/.github/ @rapidsai/ci-codeowners +/ci/ @rapidsai/ci-codeowners +/.pre-commit-config.yaml @rapidsai/ci-codeowners + +#packaging code owners +/.devcontainer/ @rapidsai/packaging-codeowners +/conda/ @rapidsai/packaging-codeowners +/dependencies.yaml @rapidsai/packaging-codeowners +/build.sh @rapidsai/packaging-codeowners +pyproject.toml @rapidsai/packaging-codeowners From a6c4f59c7a1b4c9bc2c8e09697d1f0c3b0cc0311 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 10 Jun 2024 08:59:25 -0500 Subject: [PATCH 03/12] use rapids-build-backend (#736) Contributes to https://github.com/rapidsai/build-planning/issues/31 Contributes to https://github.com/rapidsai/dependency-file-generator/issues/89 Proposes introducing `rapids-build-backend` as this project's build backend, to reduce the complexity of various CI/build scripts. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) - Gregory Lee (https://github.com/grlee77) - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/cucim/pull/736 --- .pre-commit-config.yaml | 2 +- ci/build_cpp.sh | 4 +--- ci/build_docs.sh | 2 +- ci/build_python.sh | 13 ++---------- ci/build_wheel.sh | 17 ++------------- ci/check_style.sh | 2 +- ci/test_python.sh | 2 +- conda/recipes/cucim/build.sh | 2 +- conda/recipes/cucim/meta.yaml | 2 ++ dependencies.yaml | 28 ++++++++++++++++++++++--- python/cucim/pyproject.toml | 14 +++++++++++-- python/cucim/src/cucim/_version.py | 17 +++++++++++++-- python/cucim/tests/unit/test_version.py | 25 ++++++++++++++++++++++ 13 files changed, 89 insertions(+), 41 deletions(-) create mode 100644 python/cucim/tests/unit/test_version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfffa3dca..101ae3391 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: additional_dependencies: - tomli - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.8.0 + rev: v1.13.11 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 28d8644e0..9b419b816 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -13,12 +13,10 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -version=$(rapids-generate-version) - rapids-logger "Begin cpp build" conda config --set path_conflict prevent -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libcucim +RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcucim rapids-upload-conda-to-s3 cpp diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 1f8865a4c..e73d05198 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -9,7 +9,7 @@ rapids-logger "Create test conda environment" rapids-dependency-file-generator \ --output conda \ - --file_key docs \ + --file-key docs \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml rapids-mamba-retry env create --yes -f env.yaml -n docs diff --git a/ci/build_python.sh b/ci/build_python.sh index 684ce04b7..25925f906 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,16 +13,7 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -package_name="cucim" -package_dir="python/cucim" -package_src_dir="${package_dir}/src/${package_name}" - -version=$(rapids-generate-version) - -commit=$(git rev-parse HEAD) - -echo "${version}" > VERSION -sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_src_dir}/_version.py" +rapids-generate-version > ./VERSION rapids-logger "Begin py build" conda config --set path_conflict prevent @@ -31,7 +22,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cucim diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 8d3fcf941..4005c36d4 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -12,28 +12,15 @@ CMAKE_BUILD_TYPE="release" source rapids-configure-sccache source rapids-date-string -version=$(rapids-generate-version) -commit=$(git rev-parse HEAD) +rapids-generate-version > ./VERSION RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -# Patch project metadata files to include the CUDA version suffix and version override. -pyproject_file="${package_dir}/pyproject.toml" - PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" -# update package name to have the cuda suffix -sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -echo "${version}" > VERSION -sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_src_dir}/_version.py" - -if [[ ${PACKAGE_CUDA_SUFFIX} == "-cu12" ]]; then - # change pyproject.toml to use CUDA 12.x version of cupy - sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} -fi # Install pip build dependencies (not yet using pyproject.toml) rapids-dependency-file-generator \ - --file_key "py_build" \ + --file-key "py_build" \ --output "requirements" \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee build_requirements.txt pip install -r build_requirements.txt diff --git a/ci/check_style.sh b/ci/check_style.sh index 9bc26fe71..f8bc16525 100755 --- a/ci/check_style.sh +++ b/ci/check_style.sh @@ -8,7 +8,7 @@ rapids-logger "Create checks conda environment" rapids-dependency-file-generator \ --output conda \ - --file_key checks \ + --file-key checks \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml rapids-mamba-retry env create --yes -f env.yaml -n checks diff --git a/ci/test_python.sh b/ci/test_python.sh index d6e76971e..ae14da4a0 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -12,7 +12,7 @@ RAPIDS_VERSION_NUMBER=$(rapids-generate-version) rapids-logger "Generate Python testing dependencies" rapids-dependency-file-generator \ --output conda \ - --file_key test_python \ + --file-key test_python \ --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml rapids-mamba-retry env create --yes -f env.yaml -n test diff --git a/conda/recipes/cucim/build.sh b/conda/recipes/cucim/build.sh index 3f26cb963..a66acc30d 100644 --- a/conda/recipes/cucim/build.sh +++ b/conda/recipes/cucim/build.sh @@ -18,6 +18,6 @@ cp -P python/install/lib/* python/cucim/src/cucim/clara/ pushd python/cucim echo "PYTHON: ${PYTHON}" -$PYTHON -m pip install . -vv +$PYTHON -m pip install --config-settings rapidsai.disable-cuda=true . -vv popd diff --git a/conda/recipes/cucim/meta.yaml b/conda/recipes/cucim/meta.yaml index dbacd8015..8282a671d 100644 --- a/conda/recipes/cucim/meta.yaml +++ b/conda/recipes/cucim/meta.yaml @@ -65,8 +65,10 @@ requirements: - libcucim ={{ version }} - numpy 1.23 - python + - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-image >=0.19.0,<0.23.0a0 - scipy >=1.6 + - setuptools >=24.2.0 run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major != "11" %} diff --git a/dependencies.yaml b/dependencies.yaml index d69b3cd75..f0e7bcda4 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -36,6 +36,14 @@ files: pyproject_dir: python/cucim extras: table: build-system + includes: + - rapids_build_setuptools + py_rapids_build: + output: pyproject + pyproject_dir: python/cucim + extras: + table: tool.rapids-build-backend + key: requires includes: - build py_run: @@ -92,7 +100,6 @@ dependencies: - cxx-compiler - output_types: [requirements, pyproject] packages: - - setuptools>=24.2.0 - wheel specific: - output_types: conda @@ -240,6 +247,12 @@ dependencies: - matrix: packages: - python>=3.8,<3.12 + rapids_build_setuptools: + common: + - output_types: [conda, requirements, pyproject] + packages: + - rapids-build-backend>=0.3.0,<0.4.0.dev0 + - setuptools>=24.2.0 run: common: - output_types: [conda, requirements, pyproject] @@ -266,9 +279,18 @@ dependencies: # Not sure where these go, if anywhere: # - openslide # - xorg-libxcb + specific: - output_types: [requirements, pyproject] - packages: - - cupy-cuda11x>=12.0.0 + matrices: + - matrix: {cuda: "12.*"} + packages: + - cupy-cuda12x>=12.0.0 + - matrix: {cuda: "11.*"} + packages: + - &cupy_cu11 cupy-cuda11x>=12.0.0 + - matrix: + packages: + - *cupy_cu11 test_python: common: - output_types: [conda, requirements, pyproject] diff --git a/python/cucim/pyproject.toml b/python/cucim/pyproject.toml index b63ef7cdc..806419559 100644 --- a/python/cucim/pyproject.toml +++ b/python/cucim/pyproject.toml @@ -2,10 +2,10 @@ # See file LICENSE for terms. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "rapids_build_backend.build" requires = [ + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "setuptools>=24.2.0", - "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project] @@ -90,6 +90,16 @@ docs = [ [project.entry-points."console_scripts"] cucim = "cucim.clara.cli:main" +[tool.rapids-build-backend] +build-backend = "setuptools.build_meta" +commit-files = [ + "src/cucim/COMMIT_FILE" +] +dependencies-file = "../../dependencies.yaml" +requires = [ + "wheel", +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + [tool.setuptools] license-files = [ "LICENSE", diff --git a/python/cucim/src/cucim/_version.py b/python/cucim/src/cucim/_version.py index 9abb33848..e61fd2958 100644 --- a/python/cucim/src/cucim/_version.py +++ b/python/cucim/src/cucim/_version.py @@ -15,6 +15,19 @@ import importlib.resources __version__ = ( - importlib.resources.files("cucim").joinpath("VERSION").read_text().strip() + importlib.resources.files(__package__) + .joinpath("VERSION") + .read_text() + .strip() ) -__git_commit__ = "" +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/cucim/tests/unit/test_version.py b/python/cucim/tests/unit/test_version.py new file mode 100644 index 000000000..256da0a89 --- /dev/null +++ b/python/cucim/tests/unit/test_version.py @@ -0,0 +1,25 @@ +# +# Copyright (c) 2024, NVIDIA CORPORATION. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import cucim + + +def test_version_constants_are_populated(): + # __git_commit__ will only be non-empty in a built distribution + assert isinstance(cucim.__git_commit__, str) + + # __version__ should always be non-empty + assert isinstance(cucim.__version__, str) + assert len(cucim.__version__) > 0 From 25efed5425d3988c0a0356b188e5534143ec3ba9 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 11 Jun 2024 09:24:47 -0700 Subject: [PATCH 04/12] Remove text builds of documentation (#738) This PR removes text builds of the documentation, which we do not currently use for anything. Contributes to https://github.com/rapidsai/build-planning/issues/71. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Jake Awe (https://github.com/AyodeAwe) URL: https://github.com/rapidsai/cucim/pull/738 --- ci/build_docs.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index e73d05198..4bc3e63f2 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -31,10 +31,8 @@ export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build Python docs" pushd docs sphinx-build -b dirhtml ./source _html -sphinx-build -b text ./source _text -mkdir -p "${RAPIDS_DOCS_DIR}/cucim/"{html,txt} +mkdir -p "${RAPIDS_DOCS_DIR}/cucim/"html mv _html/* "${RAPIDS_DOCS_DIR}/cucim/html" -mv _text/* "${RAPIDS_DOCS_DIR}/cucim/txt" popd rapids-upload-docs From f25b2c6651dcfe151f93b84dcc8719d95045ee1e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 24 Jun 2024 11:23:45 -0500 Subject: [PATCH 05/12] remove .gitattributes (#740) Contributes to https://github.com/rapidsai/build-planning/issues/31 Removes `.gitattributes` files. These have been here since the beginning of the project (https://github.com/rapidsai/cucim/commit/048d53e6f99c2129b9febd08e0ae6d1b37d74451), for use with `versioneer`. Per the `git` docs ([link](https://git-scm.com/docs/gitattributes#_export_subst)), setting the attribute `export-subst` on a file via a `.gitattributes` tell `git` to replace placeholders in the file with some `git` information. This is no longer done in `_version.py` files in this project, and this project no longer uses `versioneer` (#615). `rapids-build-backend` handles storing git commit information in the published packages. ## Notes for Reviewers For more details, see https://github.com/rapidsai/build-planning/issues/31#issuecomment-2176853319 Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Mike Sarahan (https://github.com/msarahan) - Gregory Lee (https://github.com/grlee77) URL: https://github.com/rapidsai/cucim/pull/740 --- python/cucim/.gitattributes | 1 - 1 file changed, 1 deletion(-) delete mode 100644 python/cucim/.gitattributes diff --git a/python/cucim/.gitattributes b/python/cucim/.gitattributes deleted file mode 100644 index 3708d19e1..000000000 --- a/python/cucim/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -src/cucim/_version.py export-subst From d8722aa09d3cd449278cec39fb929da136ccaa7f Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 2 Jul 2024 13:11:33 -0400 Subject: [PATCH 06/12] Use verify-alpha-spec hook (#744) With the deployment of rapids-build-backend, we need to make sure our dependencies have alpha specs. Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - James Lamb (https://github.com/jameslamb) URL: https://github.com/rapidsai/cucim/pull/744 --- .pre-commit-config.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 101ae3391..d2e786b7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,6 +28,10 @@ repos: args: ["--toml", "python/cucim/pyproject.toml"] additional_dependencies: - tomli + - repo: https://github.com/rapidsai/pre-commit-hooks + rev: v0.2.0 + hooks: + - id: verify-alpha-spec - repo: https://github.com/rapidsai/dependency-file-generator rev: v1.13.11 hooks: From fbca7fa847f8bf9916ea013dd274d88be43c99fb Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 9 Jul 2024 09:16:30 -0500 Subject: [PATCH 07/12] skip CMake 3.30.0, require CMake >=3.26.4 (#745) Contributes to https://github.com/rapidsai/build-planning/issues/80 Adds constraints to avoid pulling in CMake 3.30.0, for the reasons described in that issue. ## Notes for Reviewers Most of the rest of RAPIDS is using `cmake >=3.26.4`... but I didn't change the floor here to match that, because I didn't know if it was intentional that `cucim` allows a wider range of `cmake` versions. Let me know if you'd prefer I bump the `cmake` minimum version to `3.26.4` as part of this. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) - Kyle Edwards (https://github.com/KyleFromNVIDIA) - Gregory Lee (https://github.com/grlee77) URL: https://github.com/rapidsai/cucim/pull/745 --- CMakeLists.txt | 4 +--- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-122_arch-x86_64.yaml | 2 +- conda/recipes/cucim/conda_build_config.yaml | 3 +++ conda/recipes/cucim/meta.yaml | 2 +- conda/recipes/libcucim/conda_build_config.yaml | 3 +++ conda/recipes/libcucim/meta.yaml | 2 +- cpp/plugins/cucim.kit.cumed/CMakeLists.txt | 4 +--- cpp/plugins/cucim.kit.cuslide/CMakeLists.txt | 4 +--- dependencies.yaml | 2 +- examples/cpp/CMakeLists.txt.examples.release.in | 4 +--- python/CMakeLists.txt | 4 +--- 12 files changed, 16 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac1aff40e..ff7e7ca8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,7 @@ # limitations under the License. # -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 5a8e835a2..9e0bbb497 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -9,7 +9,7 @@ dependencies: - GPUtil>=1.4.0 - c-compiler - click -- cmake>=3.23.1,!=3.25.0 +- cmake>=3.26.4,!=3.30.0 - cuda-version=11.8 - cudatoolkit - cupy>=12.0.0 diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index 0aa83182a..2e9eb13c4 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -9,7 +9,7 @@ dependencies: - GPUtil>=1.4.0 - c-compiler - click -- cmake>=3.23.1,!=3.25.0 +- cmake>=3.26.4,!=3.30.0 - cuda-cudart-dev - cuda-nvcc - cuda-version=12.2 diff --git a/conda/recipes/cucim/conda_build_config.yaml b/conda/recipes/cucim/conda_build_config.yaml index 8a1b64ec6..001878ff2 100644 --- a/conda/recipes/cucim/conda_build_config.yaml +++ b/conda/recipes/cucim/conda_build_config.yaml @@ -15,3 +15,6 @@ c_stdlib: c_stdlib_version: - "2.17" + +cmake_version: + - ">=3.26.4,!=3.30.0" diff --git a/conda/recipes/cucim/meta.yaml b/conda/recipes/cucim/meta.yaml index 8282a671d..47768a92f 100644 --- a/conda/recipes/cucim/meta.yaml +++ b/conda/recipes/cucim/meta.yaml @@ -51,7 +51,7 @@ requirements: - {{ compiler('cuda') }} {% endif %} - cuda-version ={{ cuda_version }} - - cmake >=3.23.1,!=3.25.0 + - cmake {{ cmake_version }} - make - ninja - {{ stdlib("c") }} diff --git a/conda/recipes/libcucim/conda_build_config.yaml b/conda/recipes/libcucim/conda_build_config.yaml index d8a71327a..ff870eb5c 100644 --- a/conda/recipes/libcucim/conda_build_config.yaml +++ b/conda/recipes/libcucim/conda_build_config.yaml @@ -16,6 +16,9 @@ c_stdlib: c_stdlib_version: - "2.17" +cmake_version: + - ">=3.26.4,!=3.30.0" + # The CTK libraries below are missing from the conda-forge::cudatoolkit package # for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages # and the "*_run_*" version specifiers correspond to `11.x` packages. diff --git a/conda/recipes/libcucim/meta.yaml b/conda/recipes/libcucim/meta.yaml index 5d24c368f..b373ffbbe 100644 --- a/conda/recipes/libcucim/meta.yaml +++ b/conda/recipes/libcucim/meta.yaml @@ -56,7 +56,7 @@ requirements: {% endif %} - cuda-version ={{ cuda_version }} - binutils - - cmake >=3.23.1,!=3.25.0 + - cmake {{ cmake_version }} - make - ninja - {{ stdlib("c") }} diff --git a/cpp/plugins/cucim.kit.cumed/CMakeLists.txt b/cpp/plugins/cucim.kit.cumed/CMakeLists.txt index dc775742d..b1743e70a 100644 --- a/cpp/plugins/cucim.kit.cumed/CMakeLists.txt +++ b/cpp/plugins/cucim.kit.cumed/CMakeLists.txt @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt b/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt index 047b5ee61..c52c564d8 100644 --- a/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt +++ b/cpp/plugins/cucim.kit.cuslide/CMakeLists.txt @@ -13,9 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements diff --git a/dependencies.yaml b/dependencies.yaml index f0e7bcda4..682d20344 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -92,7 +92,7 @@ dependencies: # python/cucim/src/cucim/clara/ before calling `pip install .`. - output_types: [conda, requirements] packages: - - cmake>=3.23.1,!=3.25.0 + - cmake>=3.26.4,!=3.30.0 - ninja - output_types: conda packages: diff --git a/examples/cpp/CMakeLists.txt.examples.release.in b/examples/cpp/CMakeLists.txt.examples.release.in index ddb8570de..bae629eb7 100644 --- a/examples/cpp/CMakeLists.txt.examples.release.in +++ b/examples/cpp/CMakeLists.txt.examples.release.in @@ -13,9 +13,7 @@ # limitations under the License. # -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) project(cucim-cpp-examples VERSION @VERSION@ DESCRIPTION "cuCIM CPP examples" LANGUAGES CUDA CXX) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index adbbde7e9..70334a980 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -13,9 +13,7 @@ # limitations under the License. # -# CUDA_STANDARD 17 is supported from CMAKE 3.18 -# : https://cmake.org/cmake/help/v3.18/prop_tgt/CUDA_STANDARD.html -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.26.4) ################################################################################ # Prerequisite statements From 540e96e6add411b99f0dd07c78c2623a851919eb Mon Sep 17 00:00:00 2001 From: Gregory Lee Date: Wed, 10 Jul 2024 20:59:56 -0400 Subject: [PATCH 08/12] Minor fixes for NumPy 2.0 compatiblity (#746) This MR resolves issues 3 and 4 reported [here](https://github.com/rapidsai/cucim/issues/742#issuecomment-2218492642) when testing with NumPy 2.0 and CuPy 13.2 locally (issues 1 and 2 will be addressed in CuPy itself) https://github.com/rapidsai/cucim/issues/742#issuecomment-2218492642 For now, leave NumPy pinning as-is. Tests should continue to pass with NumPy 1.x Authors: - Gregory Lee (https://github.com/grlee77) Approvers: - https://github.com/jakirkham URL: https://github.com/rapidsai/cucim/pull/746 --- python/cucim/src/cucim/skimage/segmentation/_chan_vese.py | 1 + python/cucim/tests/unit/core/test_stain_normalizer.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py b/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py index 789518cb1..ea33f26b5 100644 --- a/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py +++ b/python/cucim/src/cucim/skimage/segmentation/_chan_vese.py @@ -429,6 +429,7 @@ def chan_vese( energies = [] phivar = tol + 1 + dt = cp.asarray(dt, dtype=float_dtype) while phivar > tol and i < max_num_iter: # Save old level set values oldphi = phi diff --git a/python/cucim/tests/unit/core/test_stain_normalizer.py b/python/cucim/tests/unit/core/test_stain_normalizer.py index aa969c523..34a44384c 100644 --- a/python/cucim/tests/unit/core/test_stain_normalizer.py +++ b/python/cucim/tests/unit/core/test_stain_normalizer.py @@ -137,7 +137,7 @@ def test_result_value(self, image, expected): stain_extraction_pca(image) else: result = stain_extraction_pca(image) - cp.testing.assert_allclose(result, expected) + cp.testing.assert_allclose(result, expected, rtol=1e-6) class TestStainNormalizerMacenko: From 7bbfe936daec341ae67fd798aba4629b9ba80688 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Tue, 16 Jul 2024 13:29:05 -0400 Subject: [PATCH 09/12] Build and test with CUDA 12.5.1 (#747) This PR updates the latest CUDA build/test version 12.2.2 to 12.5.1. Contributes to https://github.com/rapidsai/build-planning/issues/73 Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - James Lamb (https://github.com/jameslamb) - https://github.com/jakirkham URL: https://github.com/rapidsai/cucim/pull/747 --- .github/workflows/build.yaml | 12 ++++++------ .github/workflows/pr.yaml | 16 ++++++++-------- .github/workflows/test.yaml | 4 ++-- ...x86_64.yaml => all_cuda-125_arch-x86_64.yaml} | 4 ++-- dependencies.yaml | 6 +++++- 5 files changed, 23 insertions(+), 19 deletions(-) rename conda/environments/{all_cuda-122_arch-x86_64.yaml => all_cuda-125_arch-x86_64.yaml} (95%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f18070040..36c60e21a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@cuda-12.5.1 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -38,7 +38,7 @@ jobs: if: github.ref_type == 'branch' needs: [python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@cuda-12.5.1 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -51,7 +51,7 @@ jobs: python-build: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@cuda-12.5.1 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -60,7 +60,7 @@ jobs: upload-conda: needs: [cpp-build, python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@cuda-12.5.1 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@cuda-12.5.1 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -78,7 +78,7 @@ jobs: wheel-publish: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@cuda-12.5.1 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5020f00c3..d05c7a39f 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,32 +20,32 @@ jobs: - wheel-build - wheel-tests secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@cuda-12.5.1 checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@cuda-12.5.1 conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@cuda-12.5.1 with: build_type: pull-request conda-python-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@cuda-12.5.1 with: build_type: pull-request conda-python-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@cuda-12.5.1 with: build_type: pull-request docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@cuda-12.5.1 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -55,14 +55,14 @@ jobs: wheel-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@cuda-12.5.1 with: build_type: pull-request script: ci/build_wheel.sh wheel-tests: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@cuda-12.5.1 with: build_type: pull-request script: ci/test_wheel.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7205ec4e4..d415e8652 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: conda-python-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@cuda-12.5.1 with: build_type: nightly branch: ${{ inputs.branch }} @@ -24,7 +24,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@cuda-12.5.1 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml similarity index 95% rename from conda/environments/all_cuda-122_arch-x86_64.yaml rename to conda/environments/all_cuda-125_arch-x86_64.yaml index 2e9eb13c4..d183e447d 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -12,7 +12,7 @@ dependencies: - cmake>=3.26.4,!=3.30.0 - cuda-cudart-dev - cuda-nvcc -- cuda-version=12.2 +- cuda-version=12.5 - cupy>=12.0.0 - cxx-compiler - gcc_linux-64=11.* @@ -53,4 +53,4 @@ dependencies: - zstd - pip: - opencv-python-headless>=4.6 -name: all_cuda-122_arch-x86_64 +name: all_cuda-125_arch-x86_64 diff --git a/dependencies.yaml b/dependencies.yaml index 682d20344..840cea8eb 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -3,7 +3,7 @@ files: all: output: conda matrix: - cuda: ["11.8", "12.2"] + cuda: ["11.8", "12.5"] arch: [x86_64] includes: - build @@ -164,6 +164,10 @@ dependencies: cuda: "12.2" packages: - cuda-version=12.2 + - matrix: + cuda: "12.5" + packages: + - cuda-version=12.5 cuda: specific: - output_types: conda From 0e75c7676dc3dd818ae735d660d0fead88e523ba Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 19 Jul 2024 12:19:19 -0400 Subject: [PATCH 10/12] Use workflow branch 24.08 again (#749) After updating everything to CUDA 12.5.1, use `shared-workflows@branch-24.08` again. Contributes to https://github.com/rapidsai/build-planning/issues/73 Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - James Lamb (https://github.com/jameslamb) URL: https://github.com/rapidsai/cucim/pull/749 --- .github/workflows/build.yaml | 12 ++++++------ .github/workflows/pr.yaml | 16 ++++++++-------- .github/workflows/test.yaml | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 36c60e21a..f18070040 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,7 +28,7 @@ concurrency: jobs: cpp-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -38,7 +38,7 @@ jobs: if: github.ref_type == 'branch' needs: [python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 with: arch: "amd64" branch: ${{ inputs.branch }} @@ -51,7 +51,7 @@ jobs: python-build: needs: [cpp-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -60,7 +60,7 @@ jobs: upload-conda: needs: [cpp-build, python-build] secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -68,7 +68,7 @@ jobs: sha: ${{ inputs.sha }} wheel-build: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} @@ -78,7 +78,7 @@ jobs: wheel-publish: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08 with: build_type: ${{ inputs.build_type || 'branch' }} branch: ${{ inputs.branch }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d05c7a39f..5020f00c3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,32 +20,32 @@ jobs: - wheel-build - wheel-tests secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.08 checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.08 conda-cpp-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08 with: build_type: pull-request conda-python-build: needs: conda-cpp-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08 with: build_type: pull-request conda-python-tests: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 with: build_type: pull-request docs-build: needs: conda-python-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08 with: build_type: pull-request node_type: "gpu-v100-latest-1" @@ -55,14 +55,14 @@ jobs: wheel-build: needs: checks secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08 with: build_type: pull-request script: ci/build_wheel.sh wheel-tests: needs: wheel-build secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 with: build_type: pull-request script: ci/test_wheel.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d415e8652..7205ec4e4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,7 +16,7 @@ on: jobs: conda-python-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08 with: build_type: nightly branch: ${{ inputs.branch }} @@ -24,7 +24,7 @@ jobs: sha: ${{ inputs.sha }} wheel-tests: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@cuda-12.5.1 + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08 with: build_type: nightly branch: ${{ inputs.branch }} From 80c27d65c6a7e3b58781343ddca3db48c9c7b6f9 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Wed, 31 Jul 2024 15:23:15 -0700 Subject: [PATCH 11/12] Drop NumPy build dependency (#751) Partially addresses issue: https://github.com/rapidsai/build-planning/issues/82 Even though cuCIM currently `#include`s ``, the actual C++ code appears not to use NumPy. So this attempts to drop the header and the NumPy build dependency. Authors: - https://github.com/jakirkham Approvers: - Mike Sarahan (https://github.com/msarahan) - Gigon Bae (https://github.com/gigony) URL: https://github.com/rapidsai/cucim/pull/751 --- conda/recipes/cucim/meta.yaml | 3 +-- python/pybind11/cucim_py.cpp | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/conda/recipes/cucim/meta.yaml b/conda/recipes/cucim/meta.yaml index 47768a92f..ed800d086 100644 --- a/conda/recipes/cucim/meta.yaml +++ b/conda/recipes/cucim/meta.yaml @@ -63,7 +63,6 @@ requirements: {% endif %} - cupy >=12.0.0 - libcucim ={{ version }} - - numpy 1.23 - python - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-image >=0.19.0,<0.23.0a0 @@ -74,7 +73,7 @@ requirements: {% if cuda_major != "11" %} - cuda-cudart {% endif %} - - {{ pin_compatible('numpy') }} + - numpy >=1.23,<2.0a0 - click - cupy >=12.0.0 - lazy_loader >=0.1 diff --git a/python/pybind11/cucim_py.cpp b/python/pybind11/cucim_py.cpp index 62f041e2d..bb91b5c43 100644 --- a/python/pybind11/cucim_py.cpp +++ b/python/pybind11/cucim_py.cpp @@ -19,9 +19,11 @@ #include #include -#include +#include +#include #include #include +#include #include #include @@ -445,11 +447,30 @@ py::object py_read_region(const CuImage& cuimg, { py::gil_scoped_acquire scope_guard; - auto arr = pybind11::array_t::ensure(location); - if (arr) // fast copy + py::object mv_obj = py::none(); + try { - py::buffer_info buf = arr.request(); - int64_t* data_array = static_cast(buf.ptr); + mv_obj = py::cast(py::memoryview(location)); + } + catch (const std::exception& e) + { + } + + if (!mv_obj.is_none()) // fast copy + { + py::memoryview mv(mv_obj); + py::buffer_info buf(PyMemoryView_GET_BUFFER(mv.ptr()), false); + + if (buf.format != py::format_descriptor::format()) + { + throw std::invalid_argument("Expected int64 array-like"); + } + if (PyBuffer_IsContiguous(buf.view(), 'C') == 0) + { + throw std::invalid_argument("Expected C-contiguous array-like"); + } + + const int64_t* data_array = static_cast(buf.ptr); ssize_t data_size = buf.size; locations.reserve(data_size); locations.insert(locations.end(), &data_array[0], &data_array[data_size]); From 2c63e753e8168536999a456006ef7011b32d310b Mon Sep 17 00:00:00 2001 From: Ray Douglass Date: Wed, 7 Aug 2024 10:39:26 -0400 Subject: [PATCH 12/12] Update Changelog [skip ci] --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc436634..28e824cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +# cucim 24.08.00 (7 Aug 2024) + +## 🛠️ Improvements + +- Drop NumPy build dependency ([#751](https://github.com/rapidsai/cucim/pull/751)) [@jakirkham](https://github.com/jakirkham) +- Use workflow branch 24.08 again ([#749](https://github.com/rapidsai/cucim/pull/749)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Build and test with CUDA 12.5.1 ([#747](https://github.com/rapidsai/cucim/pull/747)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- Minor fixes for NumPy 2.0 compatiblity ([#746](https://github.com/rapidsai/cucim/pull/746)) [@grlee77](https://github.com/grlee77) +- skip CMake 3.30.0, require CMake >=3.26.4 ([#745](https://github.com/rapidsai/cucim/pull/745)) [@jameslamb](https://github.com/jameslamb) +- Use verify-alpha-spec hook ([#744](https://github.com/rapidsai/cucim/pull/744)) [@KyleFromNVIDIA](https://github.com/KyleFromNVIDIA) +- remove .gitattributes ([#740](https://github.com/rapidsai/cucim/pull/740)) [@jameslamb](https://github.com/jameslamb) +- Adopt CI/packaging codeowners ([#739](https://github.com/rapidsai/cucim/pull/739)) [@bdice](https://github.com/bdice) +- Remove text builds of documentation ([#738](https://github.com/rapidsai/cucim/pull/738)) [@vyasr](https://github.com/vyasr) +- use rapids-build-backend ([#736](https://github.com/rapidsai/cucim/pull/736)) [@jameslamb](https://github.com/jameslamb) + # cucim 24.06.00 (5 Jun 2024) ## 🚨 Breaking Changes